LM311N can not create negative square wave

Thread Starter

picaso

Joined Oct 24, 2009
5
Hello all

I am trying to design a comparator circuit using the LM331N op-amp. I found in the datasheet and here also http://www.swarthmore.edu/NatSci/echeeve1/Class/e72/E72L2/Lab2(OpAmp).html how to design it. The problem is when i feed a sinusoidal signal from a function generator 20Hz and 1Vp amplitude i do not get the negative square wave when there is possitive input signal it gives me almost +100mV. i do get the positive square wave +5V when there is negative input signal. Should not i get also -5V when possitve input signal? What am i doing wrong in this design?
Thank you in advance.
 

Attachments

#12

Joined Nov 30, 2010
18,224
For starters, You grounded your output. You grounded the balance pins. You don't seem to understand that the 311 is an open collector chip and it can not output a negative voltage.

Read some more and start with a schematic. They are easier to read.
 

SgtWookie

Joined Jul 17, 2007
22,230
Disconnect pin 1 from ground, and reconnect it to Vss_1/pin 4/-5v.

Download the datasheet for the LM311 from National Semiconductor:
http://www.national.com/ds/LM/LM111.pdf
Look at the schematic diagram for the IC, on page 18. Note that pin 1 (GND) is on the emitter of the open-collector output. Since you currently have pin 1 connected to GND, that's as low as the output can go.
 

Adjuster

Joined Dec 26, 2010
2,148
You appear to have grounded pins 5 (BAL) and 6 (B/STB). These pins should either be left open, or used according to the arrangements shown in the LM311 datasheet Application notes.

Page 1 of the National Semiconductor datasheet dated January 2001 shows a specific instruction NOT to ground the Strobe pin.
 

Thread Starter

picaso

Joined Oct 24, 2009
5
hey

thank you guys now it works fine. electronics is not my stronger subject. as far pins 5 and 6 i ground them because my teacher told me so (ground all pins that are not connected anywhere). sometimes somethings are in front and you cant see them like on page 1 of datasheet!!!!

Thank you
 

thatoneguy

Joined Feb 19, 2009
6,359
hey

thank you guys now it works fine. electronics is not my stronger subject. as far pins 5 and 6 i ground them because my teacher told me so (ground all pins that are not connected anywhere). sometimes somethings are in front and you cant see them like on page 1 of datasheet!!!!

Thank you
NEVER DO THAT!

Only ground unused inputs in digital circuits, such as when you are only using 2 gates in a 4 gate IC, ground the inputs (NOT THE OUTPUTS) of the unused 2 gates. I suspect your teacher remembered a version of that and stated what you heard above, grounding all will often destroy your project before you even try it.

In analog circuits, Read the datasheet for instructions about unused pins.

If you actually build the circuit in your original post (with the errors corrected), you will need to add decoupling/bypass caps, about 0.1uF (100nF) between both V+ and ground, and another between V- and ground. The "switching action" of a comparator will "glitch" the power supply, and anything else connected to it if they are left out. (See sticky in Electonics Chat about decoupling caps)
 
Top