LM311 input signal trouble

Thread Starter

alimutlu1

Joined Aug 4, 2017
23
Hi everyone,

I want to build a comparator circuit by using LM311 but there is a problem while applying input signal in the pin 3(-Vin) of LM311. I normally have 2 khz sinus signal which does not include clipped(picture1). When I start to the circuit, I see clipped signal(picture2).
Can anybody help me?
IMG_0357 (1).JPG IMG_0358.JPG
 

WBahn

Joined Mar 31, 2012
32,849
How, pray tell, are we supposed to tell you what is wrong with a circuit that you won't show?

What does it mean to "start the circuit"?
 

Ylli

Joined Nov 13, 2015
1,092
Let's see the schematic. Comparators normally use positive feedback to create a hysterisis. Depending on the impedance of your source, this can cause some apparent distortion.
 

Ylli

Joined Nov 13, 2015
1,092
Add a 2.2K resistor in between your input signal and pin 3. See if that improves matters.

Oh, and you need a pull-up on the output of that LM311 - it has an open collector output.
 

Thread Starter

alimutlu1

Joined Aug 4, 2017
23
Thanks a lot Ylli. But now I have another problem. I want to square wave in the output. Because it is neccesary that if the input greater than 9v, output will go low. if the input lower than 6v, output will go low again. In that case, output will be high between 6V and 9V. Also can you tell me how do you know putting 2.2k in there? thanks a lotIMG_0360.JPG
 

crutschow

Joined Mar 14, 2008
38,512
Use a 10kΩ resistor to pin 3 (in place of the 2.2k) and a diode (preferably a Schottky) from pin 3 (cathode) to ground (anode).
 

dl324

Joined Mar 30, 2015
18,329
Also can you tell me how do you know putting 2.2k in there?
It isn't always required. You are direct coupling the input and it must be swinging negative. The comparator input was clamping the input signal to one diode drop below VEE (ground in your case).
 

Thread Starter

alimutlu1

Joined Aug 4, 2017
23
It isn't always required. You are direct coupling the input and it must be swinging negative. The comparator input was clamping the input signal to one diode drop below VEE (ground in your case).
I did not understand. can you clarify that?
 

dl324

Joined Mar 30, 2015
18,329
I did not understand. can you clarify that?
That resistor would normally be used to minimize the effect of input bias current.

In your case, you were exceeding the negative input voltage range and were forward biasing the CB junction of that input transistor. Adding the resistor limited the current and removed the distortion you saw on the input signal, but you're still violating input voltage range.

Adding a Schottky diode clamp to that input as mentioned by @crutschow would clean up the output.
 

dl324

Joined Mar 30, 2015
18,329
But now I have another problem. I want to square wave in the output. Because it is neccesary that if the input greater than 9v, output will go low. if the input lower than 6v, output will go low again. In that case, output will be high between 6V and 9V.
You'll need another comparator to do that.

Since you're only interested in the range from 6-9V, you can replace the clamp diode with a signal diode in series with the input.
 

Ylli

Joined Nov 13, 2015
1,092
The 2.2k resistor is just equivalent to the parallel combination of all the resistors on the positive input. Compensates for offset currents and isolates the input from loading of the comparator a bit.

Looks like the square portion of that waveform is just about right. Don't know where the sine portion of that output waveform is coming from. Is your input signal going below ground? If so, the LM311 will get mad at you and do strange things.
 

dl324

Joined Mar 30, 2015
18,329
Is your input signal going below ground?
The input is about 16V P-P. I had to look closely at the pictures to find where zero was for each trace:
scope1.jpg

I usually use an analog scope and have to keep track of vertical offsets myself...
 
Last edited:

WBahn

Joined Mar 31, 2012
32,849
You input signal is going below the negative supply rail for the device. Internal input protection circuits are attempting to clamp the input signal to the rails.

Are you specifically attempting to create hysteresis?

Are you aware that the LM311's output is both open collector AND open emitter? You need external circuitry/connections to both pull it HI and pull it LO.
 

RichardO

Joined May 4, 2013
2,270
Are you aware that the LM311's output is both open collector AND open emitter? You need external circuitry/connections to both pull it HI and pull it LO.
Since you are taking the output from pin 7 (the collector) you need to ground pin 1 (the emitter).
And dont forget the pullup resistor from pin 7 to +12 volts.
 
Top