LM741 as a voltage comparator question - Page 1
Forum section: electronics / beginners

author: Chris Wilson
author_rank: Super Contributor
timestamp: November 15, 2016, 11:46:05 pm
content: I am trying to devise a simple circuit to take the output from a Hall effect ACS712 current measuring IC module measuring into an OpAmp used as a comparator to have its output go high when more than 20 Amps is taken by the circuit. I have some LM741's and have bread boarded just the 741, a 50K multi turn pot as a resistive divider, a 12V supply and a LED with a 1k dropper resistor on the 741's output to ground. I need the comparator to output 12V when the input from the Hall effect device goes over 1.2V which is what it outputs when supplying around 20 Amps. I am ignoring the Hall effect device for now and just inputting around 1.2V to the 741 directly from a different bench supplyMy issues are, the LED permanently glows, albeit dimly, although at a certain set input voltage level (from a separate bench supply) it glows brightly, and secondly it is extremely hard to set it to trip around such a low voltage accurately. I tried a 1K multi turn pot and that was seemingly no better.I have, I think, an idea as to what's wrong, but don't have the knowledge to work out a cure. If I measure the multi turn preset resistor out of circuit, set to as near to a change over at 1.2 V input, the wiper to end of track is about 150 Ohms at one side, and over 9K at the other, on the 1K pot. So the resistive divider is needing to be skewed dramatically. The fix though??Is the 741 not suitable for my purpose? What should I be using? I have a feeling I once heard someone say using an ordinary OpAmp as a voltage comparator is not a very good idea.What am I doing wrong please?Thanks for any replies.

author: Andy Watson
author_rank: Super Contributor
timestamp: November 15, 2016, 11:54:17 pm
content: What power supply are you using for the 741? You need to look at the common-mode input range for the op-amp, and the output range too. 741s are a very old design that requires significant "headroom" to operate - headroom at both the positive and negative supply voltage.

author: Chris Wilson
author_rank: Super Contributor
timestamp: November 16, 2016, 12:01:10 am
content: Hi Andy, thanks for the fast reply. I am using a decent well regulated bench supply for powering the 741 itself, at 12V DC. The circuit it will eventually go in has only 12V available.The test voltage (1.2V) I am inputting comes from a different well regulated bench supply. So the divider "reference voltage" and power to the 741 itself are from one supply, and the 1.2V from a totally separate one.

author: Andy Watson
author_rank: Super Contributor
timestamp: November 16, 2016, 12:06:09 am
content: What about the negative supply to the 741?If you want to operate at or about the voltage that you're putting on pin 4 (the negative supply) you will need an op-amp, or better still, a comparator that includes that "rail" in its common-mode range.If you must use a 741, you could try biasing the hall-effect and reference voltage such that they are centred on 6V. But be aware that the output of the 741 is also limited in voltage range - it will only operate to within approximately 1V of either supply rail.

author: strawberry
author_rank: Super Contributor
timestamp: November 16, 2016, 12:29:02 am
content: OP have saturation voltage at both output states at partikular load .you have to lift reference point about 2..3V at least(like differential amp bipolar supply -2..3V +9..10V in this case)Different are rail-to-rail op ampsThat is why comparatorsWhy can't make it simple with one NPN and one PNP transistor?

author: Paul Moir
author_rank: Frequent Contributor
timestamp: November 16, 2016, 12:31:11 am
content: It's a good lesson for beginners on reading datasheets. Look at the input voltage range, which is specified at -12v/+12v (minimum: always use the pessimistic figure. "Typical" is for Page 1 claims.) If you look at footnote one below it, this value is when the supply voltage is +15v/-15v. This means at the +-15v supply, you can't input within 3 volts of the rails and expect reasonable operation.With 12v/0v the answer isn't specified but it's probably even worse since someone thought to add a "Recommended Operating Condition" minimum supply voltage of +10v/-10v. Older datasheets suggested it was conceivably usable at +4.5v/-4.5v supply voltages, but I'm guessing that was a little optimistic and now TI has better opamps to sell you.I find on datasheets they don't like to point out the flaws with their parts. In this case the woeful performance with inputs near it's rails. You might not even think of it until you see an LM324 datasheet highlighting "Operation down to 3v!" and "Common mode input range includes the negative rail!".

author: kfnight
author_rank: Regular Contributor
timestamp: November 16, 2016, 12:39:41 am
content: Quote from: Chris Wilson on November 15, 2016, 11:46:05 pmIt depends on your application. Op-amps typically consume more power and have slower switching speeds than a dedicated comparator, but they do alright in a pinch.

author: Chris Wilson
author_rank: Super Contributor
timestamp: November 16, 2016, 12:50:39 am
content: OK, this is more complex than I had imagined. I am happy to buy a dedicated comparator IC, but the basic 12V supply with no center rail is a given, and I don't think altering the output voltage of the ACS712 current measuring device (http://www.allegromicro.com/en/Products/Current-Sensor-ICs/Zero-To-Fifty-Amp-Integrated-Conductor-Sensor-ICs/ACS712.aspx) is an option. So what device will let me set its output to go high if it sees anything over 1.2 volts on its input, without too much fiddling about?Much appreciate the replies, this is a great forum.

author: Andy Watson
author_rank: Super Contributor
timestamp: November 16, 2016, 01:06:07 am
content: LM339 ? I think it includes ground in its common mode range.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: November 16, 2016, 01:30:36 am
content: One thing that you need to ask yourself is how are you getting 9K resistance from a 1K pot....QuoteWhile the comments above about the LM741 not being a good choice for this project are correct ... there may be something else going on here too.

author: Seekonk
author_rank: Super Contributor
timestamp: November 16, 2016, 01:54:35 pm
content: Not going to bother looking this up, but doesn't the 712 go from +- amps centered around 2.5V? So your trip voltage would be 3.7V? If you want to go simple use a LM431 to sense the trip voltage. It will drive up to 100ma which covers a lot of relays. Just put a voltage divider pot between sensor and the reference pin. It trips at above the reference voltage of 2.5V. No hyst but that could be added.

author: David Hess
author_rank: Super Contributor
timestamp: November 16, 2016, 03:11:36 pm
content: From your description, it sounds like you are exceeding the common mode input voltage range of the 741. Either offset the trip and sensor voltage or switch to a single supply operational amplifier.Quote from: Chris Wilson on November 15, 2016, 11:46:05 pmOperational amplifiers are not ideal replacements for comparators but most can work as such and they do sometimes have advantages. The 741 is one such operational amplifier with its high differential input voltage range and benign behavior.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: November 17, 2016, 02:57:33 am
content: On my breadboard, LM393N (one half) works quite well with the single 12V supply, switches accurately at 1.2V with little hysteresis. The output works as a current sink rather than source, but that should be no problem for the OP.