Author Topic: LM741 as a voltage comparator question  (Read 4306 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris WilsonTopic starter

  • Super Contributor
  • ***
  • Posts: 1082
  • Country: gb
  • Race car engineer, dog lover, hoarder.
LM741 as a voltage comparator question
« on: November 15, 2016, 11:46:05 pm »


    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 supply

    My 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.
     


     

Best regards,

                 Chris Wilson.
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2117
Re: LM741 as a voltage comparator question
« Reply #1 on: November 15, 2016, 11:54:17 pm »
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.

 

Offline Chris WilsonTopic starter

  • Super Contributor
  • ***
  • Posts: 1082
  • Country: gb
  • Race car engineer, dog lover, hoarder.
Re: LM741 as a voltage comparator question
« Reply #2 on: November 16, 2016, 12:01:10 am »
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.
Best regards,

                 Chris Wilson.
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2117
Re: LM741 as a voltage comparator question
« Reply #3 on: November 16, 2016, 12:06:09 am »
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.

« Last Edit: November 16, 2016, 12:26:22 am by Andy Watson »
 

Offline strawberry

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: LM741 as a voltage comparator question
« Reply #4 on: November 16, 2016, 12:29:02 am »
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 amps
That is why comparators

Why can't make it simple with one NPN and one PNP transistor?
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: LM741 as a voltage comparator question
« Reply #5 on: November 16, 2016, 12:31:11 am »
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!".
« Last Edit: November 16, 2016, 12:50:09 am by Paul Moir »
 

Offline kfnight

  • Regular Contributor
  • *
  • Posts: 71
Re: LM741 as a voltage comparator question
« Reply #6 on: November 16, 2016, 12:39:41 am »
I have a feeling I once heard someone say using an ordinary OpAmp as a voltage comparator is not a very good idea.   

It 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.
 

Offline Chris WilsonTopic starter

  • Super Contributor
  • ***
  • Posts: 1082
  • Country: gb
  • Race car engineer, dog lover, hoarder.
Re: LM741 as a voltage comparator question
« Reply #7 on: November 16, 2016, 12:50:39 am »
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.
Best regards,

                 Chris Wilson.
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2117
Re: LM741 as a voltage comparator question
« Reply #8 on: November 16, 2016, 01:06:07 am »
LM339 ? I think it includes ground in its common mode range.
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: LM741 as a voltage comparator question
« Reply #9 on: November 16, 2016, 01:30:36 am »
One thing that you need to ask yourself is how are you getting 9K resistance from a 1K pot....

Quote
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.

While 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.

The easiest person to fool is yourself. -- Richard Feynman
 

Offline Seekonk

  • Super Contributor
  • ***
  • Posts: 1960
  • Country: us
Re: LM741 as a voltage comparator question
« Reply #10 on: November 16, 2016, 01:54:35 pm »
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.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17117
  • Country: us
  • DavidH
Re: LM741 as a voltage comparator question
« Reply #11 on: November 16, 2016, 03:11:36 pm »
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.

I have a feeling I once heard someone say using an ordinary OpAmp as a voltage comparator is not a very good idea.   

Operational 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.
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: LM741 as a voltage comparator question
« Reply #12 on: November 17, 2016, 02:57:33 am »
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.

The easiest person to fool is yourself. -- Richard Feynman
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf