need guidance in comparator cct LM311 - Page 1
Forum section: electronics / beginners

author: hasamsiddiqui@gamil.com
author_rank: Newbie
timestamp: July 28, 2025, 11:07:05 am
content: Hi,First of all, I am not very good at electronics, and I'm stuck. Kindly please guide me.I have attempted to configure a comparator circuit using the LM311 IC. I applied a sine wave of 0.36 V to pin 2 (inverting input) through a 10 kΩ resistor, and provided a reference voltage to pin 3 (non-inverting input) using a voltage divider with a 1 kΩ resistor connected to the biasing voltage. I also shorted pins 5 and 6 as suggested in some configurations.A 4.7 kΩ pull-up resistor was connected between the output pin (pin 7) and the biasing voltage. However, on the oscilloscope, I observed only a constant DC level of 15 V at the output—no square wave transitions were visible to indicate the expected high and low logic levels.Could you kindly guide me on where I might be making a mistake in the configuration?Best regards,Hasham

author: Zero999
author_rank: Super Contributor
timestamp: July 28, 2025, 11:15:12 am
content: The schematic is missing the connection to pin 1, which should be 0V.You've got the functions of pins 2 and 3 mixed up in your description. The schematic is correct: pin 2 is non-inverting and pin 3 is inverting.

author: Grandchuck
author_rank: Super Contributor
timestamp: July 28, 2025, 11:20:15 am
content: Pin 3 should be connected to the center of the voltage divider.

author: PGPG
author_rank: Frequent Contributor
timestamp: July 28, 2025, 12:03:05 pm
content: You are not clear in your explanation and even in your schematic - you let us guess what a schematic really is.From schematic it looks that (-) input is connected to GND and it should work (provided you supply it from +15Vand -15V).But I'm not sure if you really have there -15V.But if so ((-) input grounded) then two 1k resistors are used for 'nothing'.So may be you connected (-) input between these resistors. Who knows.If so then you have +7.5V at (-) input and 0.36V sinus at (+) input. So at (+) you have voltage varying from -0.36V to +0.36V. It is all the time smaller than +7.5V at (-) so you should all the time have constant output (comparison gives all the time the same result). But as (+) input is smaller you should all the time have '0' (negative) at output, but you say you have '1' (positive) at output.May be you mixed (-) and (+).Or may be you don't have -15V at all and you operate with one of inputs at voltages out of operating input voltage range.I'd suggest to be more precision in describing what you have done.

author: GigaJoe
author_rank: Frequent Contributor
timestamp: July 28, 2025, 07:50:43 pm
content: something like this ?Pin 1 connected to ground - it would be meander 0 to +12V ; connected to negative would be -12 to +12 , both noninverted

author: Zero999
author_rank: Super Contributor
timestamp: July 28, 2025, 09:30:21 pm
content: Actually the pull-up can be connected to a different voltage, to achieve a different output, to the power supply.I think the original poster is confused with the dual and single power supply configurations.Here's an example.U1 is configured with a dual supply. The input is connected directly to AC and the negative pin goes to -15V.U2 is configured with a single supply. The input is AC coupled with a resistor and the reference point is biased to half the supply voltage. The negative pin goes to 0V.Note these circuits are prone to noise when there's no AC input. Bias one input at a slightly DC voltage than the other and add some hysteresis to prevent this.

author: ledtester
author_rank: Super Contributor
timestamp: July 29, 2025, 01:15:32 am
content: This stackexchange page has a simple LM311 circuit that uses +/-15 supplies:https://electronics.stackexchange.com/a/751162Some notes:- as shown the output pin (pin 7) is connected to +5V. You can connect it to +15 but use a larger resistor value (like the 4.7K in the OP's original circuit)- with a clean sine wave input on pin 3 I would first try the circuit with Rf removed just to see if you get transitions. Rf is used to provide hysteresis which prevents the output from oscillating too much if the input is noisy.

author: Zero999
author_rank: Super Contributor
timestamp: July 29, 2025, 10:42:44 am
content: Quote from: ledtester on July 29, 2025, 01:15:32 amThat will work, but note the output will be inverted.Here's how to add hysteresis, without inverting the signal.