Author Topic: Op-amp Comparator Circuit  (Read 4574 times)

0 Members and 1 Guest are viewing this topic.

Offline just5554Topic starter

  • Contributor
  • Posts: 20
  • Country: lt
Op-amp Comparator Circuit
« on: June 28, 2017, 07:03:57 pm »
I want to modify 1.3Ah 9.6V Ni-Cd battery charger, so it would turn off at 11.6 V or at least LED would turn on. I tried with zener diodes, mosfet, but it's too linear, there's no clear indication. I found that I can make it with comparator. Will these circuits work? Oh, and do I need a resistor on MOSFET gate?



« Last Edit: June 29, 2017, 06:58:55 am by just5554 »
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Op-amp Comparator Circuit
« Reply #1 on: June 28, 2017, 09:09:41 pm »
You posted your schematics "over there" where it takes all day for that site to wake up and it is full of ads. Instead, attach your schematics to your posts on this forum.
A comparator must have some hysteresis so that when the input is at its threshold then it doesn't oscillate or amplify a tiny amount of noise.
 
The following users thanked this post: just5554

Offline 4CX35000

  • Regular Contributor
  • *
  • Posts: 107
  • Country: gb
Re: Op-amp Comparator Circuit
« Reply #2 on: June 28, 2017, 09:24:28 pm »
What IC are using for the comparator ?.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Op-amp Comparator Circuit
« Reply #3 on: June 28, 2017, 09:32:18 pm »
This particular circuit does not need any hysteresis, because as soon as the transistor switches off, the potential on the inverting input is going to shoot up, completely saturating the input.

Two problems with this circuit:
How are you going to get it to start?
What is there to limit the current flowing into the battery from the power supply?

LM7805 is also a terrible choice for a voltage reference.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 
The following users thanked this post: just5554

Offline just5554Topic starter

  • Contributor
  • Posts: 20
  • Country: lt
Re: Op-amp Comparator Circuit
« Reply #4 on: June 29, 2017, 07:16:31 am »
I'd be using LM393. The reason that I'm using 5V regulator is because power supply isn't very stable, and it's voltage is very high while not connected, and low when connected to discharged battery. To turn on I think would just plug battery in, then voltage across battery would be lower and therefore divided voltage would also be lower than Vref. and it would turn on. That's my "hypothesis". Power supply is 12Vdc 400mA, but while not connected it goes up to 16V. This is the original circuit, but that transistor and LED doesn't help at all.
 

Offline Codebird

  • Regular Contributor
  • *
  • Posts: 161
  • Country: gb
Re: Op-amp Comparator Circuit
« Reply #5 on: June 29, 2017, 07:34:40 am »
Quote
I'd be using LM393.

There's your problem. The LM393 is an open collector output. I'll pull down, but not drive high. You can drive a MOSFET off that, but only in conjunction with a pull-up resistor.

The MOSFET gate resistor is optional, but it's good practice to include one to prevent ringing and serve as a current limiter in event of a MOSFET fault.
 
The following users thanked this post: just5554

Offline just5554Topic starter

  • Contributor
  • Posts: 20
  • Country: lt
Re: Op-amp Comparator Circuit
« Reply #6 on: June 29, 2017, 09:09:35 am »
Now I'm building this circuit with mosfet, and I'm thinking, do I need resistor between mosfet source and drain?
 

Offline just5554Topic starter

  • Contributor
  • Posts: 20
  • Country: lt
Re: Op-amp Comparator Circuit
« Reply #7 on: June 29, 2017, 04:13:44 pm »

Two problems with this circuit:
How are you going to get it to start?

Well you're right, I just built circuit and now I know what you meant, while charging voltage on IN- is very low, but if I turn pot to turn it off, after it turns off, voltage shoots up from 5V to 8V. How should I make it then? Without 5V reg., but with resistors voltage divider, so IN+ and IN - would change proportional?

EDIT: okay i tried with voltage divider instead of 5v reg., and I get same result.  :-// :-//
« Last Edit: June 29, 2017, 04:29:34 pm by just5554 »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: Op-amp Comparator Circuit
« Reply #8 on: June 29, 2017, 09:44:07 pm »
None of the schematics have the essential pull-up to drive the output transistor.

A potential divider from the power supply, is a much worse than the LM7805 as a reference.

The first circuit stands a chance of working if a pull-up resistor is added.

With the addition of a pull-up on the MOSFET, the second circuit will oscillate because it looks at the voltage on the negative side of the battery.

The third circuit will just cause the green LED to glow dimly.

Why not use the TL431 as both a reference and comparator?
 
The following users thanked this post: just5554

Offline 4CX35000

  • Regular Contributor
  • *
  • Posts: 107
  • Country: gb
Re: Op-amp Comparator Circuit
« Reply #9 on: June 29, 2017, 09:51:06 pm »
I'm not certain which version of the circuit you are using, but what your observing is the unregulated PSU voltage increasing to a higher voltage as defined by the transformer output voltage and rectifier arrangement (Off load voltage).

The 7805 is a voltage regulator which will output 5v regardless of the PSU voltage is doing so long as the voltage stays within the 7805 specification (See manufacturer datasheet for the 7805).

As for being the correct device or not; then just think that the 7805 is designed to run devices upto 1 amp and yet your using it to drive a high impedance input on a comparitor device voltage reference and therefore it is a waste as the comparitor is probably using well under 1uA. In a typical circuit similar to the one your using a zener diode would be used as to provide the reference with a potential divider network to control the current and limit the voltage to a lower level.

Potential dividers do not regulate and therefore any changes in the supply voltage will be reflected in the output of the potential divider.

 
 
The following users thanked this post: just5554

Offline bson

  • Supporter
  • ****
  • Posts: 2269
  • Country: us
Re: Op-amp Comparator Circuit
« Reply #10 on: June 29, 2017, 09:52:11 pm »

The base of the PNP sits one diode drop below the emitter, so it's going to turn on right away, only the 10k base resistor severely limits its base current so in reality the LED will probably never light up.  In reality it will probably teeter on the threshold/toe.  The battery voltage is irrelevant.  This won't work as either a charger or battery tester...

« Last Edit: June 29, 2017, 09:54:11 pm by bson »
 
The following users thanked this post: just5554

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Op-amp Comparator Circuit
« Reply #11 on: June 29, 2017, 10:24:47 pm »
The base of the PNP sits one diode drop below the emitter, so it's going to turn on right away, only the 10k base resistor severely limits its base current so in reality the LED will probably never light up.  In reality it will probably teeter on the threshold/toe.  The battery voltage is irrelevant.  This won't work as either a charger or battery tester...
100mV of difference between the junctions is enough to pull 10uA through the base, which is going to give 1-2mA to the LED. Very easily achievable.

But the circuit is really just an indicator that current is flowing, not a charging circuit.

The reason that I'm using 5V regulator is because power supply isn't very stable, and it's voltage is very high while not connected, and low when connected to discharged battery.
The problem isn't that you're using a reference voltage, it's that LM7805 is a terrible choice of device for this purpose. It's a regulator, not a reference.

Your circuit won't start because your reference voltage is referenced to the circuit ground, while you are trying to compare it to a voltage that is referenced to the positive supply rail (ignoring the diode). When your circuit turns off, the voltage is going to shoot up because you are going to unload the supply rail AND because as soon as you disconnect it, the bias current of the comparator is going to push the potential upwards and reverse bias the diode.
On top of everything, you're relying on the supply to limit the current that is going to be shoved into the battery. Bad idea.

I realize that what I just wrote may be a bit overwhelming for a novice to fully grasp, so I'm going to simplify it: The circuit is terrible in every way, I suggest you find a new one.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 
The following users thanked this post: just5554

Offline just5554Topic starter

  • Contributor
  • Posts: 20
  • Country: lt
Re: Op-amp Comparator Circuit
« Reply #12 on: June 30, 2017, 08:21:44 am »
Thanks for the tips, so I'll be using circuit that shows when battery is charged, I've built it and it works.  :-+
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Op-amp Comparator Circuit
« Reply #13 on: June 30, 2017, 08:56:34 am »
Thanks for the tips, so I'll be using circuit that shows when battery is charged, I've built it and it works.  :-+


Don't use a 7805 as the reference:
1. You aren't drawing any significant current from the output, so all bets are off as far as regulation.
2. The 7805 can draw a few mA - this is unnecessary waste of power.
3. 7805 is a terrible reference.

Use TL431 or similar, cheaper (probably) and uses less power, far more accurate.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf