Op-amp Comparator Circuit - Page 1
Forum section: electronics / beginners

author: just5554
author_rank: Contributor
timestamp: June 28, 2017, 07:03:57 pm
content: 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?

author: Audioguru
author_rank: Super Contributor
timestamp: June 28, 2017, 09:09:41 pm
content: 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.

author: 4CX35000
author_rank: Regular Contributor
timestamp: June 28, 2017, 09:24:28 pm
content: What IC are using for the comparator ?.

author: Dave
author_rank: Super Contributor
timestamp: June 28, 2017, 09:32:18 pm
content: 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.

author: just5554
author_rank: Contributor
timestamp: June 29, 2017, 07:16:31 am
content: 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.

author: Codebird
author_rank: Regular Contributor
timestamp: June 29, 2017, 07:34:40 am
content: QuoteThere'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.

author: just5554
author_rank: Contributor
timestamp: June 29, 2017, 09:09:35 am
content: Now I'm building this circuit with mosfet, and I'm thinking, do I need resistor between mosfet source and drain?

author: just5554
author_rank: Contributor
timestamp: June 29, 2017, 04:13:44 pm
content: Quote from: Dave on June 28, 2017, 09:32:18 pmWell 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.

author: Zero999
author_rank: Super Contributor
timestamp: June 29, 2017, 09:44:07 pm
content: 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?

author: 4CX35000
author_rank: Regular Contributor
timestamp: June 29, 2017, 09:51:06 pm
content: 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.

author: bson
author_rank: Unknown
timestamp: June 29, 2017, 09:52:11 pm
content: Quote from: just5554 on June 29, 2017, 07:16:31 amThe 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...

author: Dave
author_rank: Super Contributor
timestamp: June 29, 2017, 10:24:47 pm
content: Quote from: bson on June 29, 2017, 09:52:11 pm100mV 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.Quote from: just5554 on June 29, 2017, 07:16:31 amThe 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.

author: just5554
author_rank: Contributor
timestamp: June 30, 2017, 08:21:44 am
content: Thanks for the tips, so I'll be using circuit that shows when battery is charged, I've built it and it works.

author: fcb
author_rank: Super Contributor
timestamp: June 30, 2017, 08:56:34 am
content: Quote from: just5554 on June 30, 2017, 08:21:44 amDon'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.