• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Problem with LM311 voltage comparator

Not open for further replies.


New Member
Dear all

Can't get an LM311 comparator to work as it appears it should - probably something obvious but due to ignorance on my part but I cant see it. Have hooked it up as follows: pins 1 & 4 to ground, 8 to 5v+, 5 & 6 not connected, pins 2 & 3 are inputs (differing voltages) and 7 the output. Cant get pin 7 to turn on though. Is there something obvious about this chip that I am not aware of that would be the problem?

Many thanks for any help :?


New Member
many thanks for your reply

I have tried as you suggested but with no luck. I have attached a diagram of what I am trying to do, hopefully you will be able to see where I am going wrong

Again, many thanks



New Member
LM311 output

Your problem is that the LM311 has an open loop gain of approx. 200,000.
This means that the output will swing to one or the other supply rails with a miniscule input level (approx. 25uV difference between inputs). In your case because of the resistor in the line for pin 3 it goes high turning of the LED.
You need to reduce the gain of the circuit using Feedback. Place resistors between the o/p and the input pins. Have a look at any textbook on negative feedback or search the web. Also read up on Hysteresise (probably spelt wrong) to stop the o/p oscillating at the switch over point.

Hope this helps



New Member
comparator problems

There are some other problems with your circuit. The input signal range for the 311 doesn't include the supply rails (GND and +5V in your case. Note that many of the circuits in the app. note have the reference input biased around 1/2 VCC). Also, assuming the LED has a forward voltage drop of 2V, the 47K resistor can only supply ~ 60 uA; you need 10 - 20 mA for most LEDs (270 ohms should work). Here are some other links for more info:



The 311's output transistor has an open emitter as well as an open collector, so you can drive ground-referenced loads from pin 1 (the input polarity is inverted when you do this - see p.13 below)


Also, I haven't tried this myself, but you may want to try out Nationals' online Webench simulator with the LM311:



New Member
Please excuse my ignorance but I really am a complete newbie on all of this. Just checking I understand your comments correctly, Does the voltage
for the reference input pin (pin 2 or 3) need to be approximately half that supplied to pin 8? And that the 47k resistor (by led) needs to be replaced by one of (approx) 270 ohms?

Thanks for your patience


New Member
Does the voltage
for the reference input pin (pin 2 or 3) need to be approximately half that supplied to pin 8?
No, but it has to be within the specified signal range for the part. The datasheet specs the signal range with a +/- 15V supply, worst case 2V under VCC and 1/2V over the negative supply (GND in your case). I'm not sure how much this spec changes with a 5V supply, you may want to try the online simulator to find out.

And that the 47k resistor (by led) needs to be replaced by one of (approx) 270 ohms?
Yes, 270 - 330 ohms should supply about 10 mA to the LED.
Not open for further replies.

Latest threads

EE World Online Articles