LM311 Differntial comparator output voltage > 1.4V ? - Page 1
Forum section: electronics / beginners

author: casper.bang
author_rank: Frequent Contributor
timestamp: September 22, 2013, 11:40:55 am
content: I'm bread-boarding an LDR-based circuit for controlling a load, making sure it's only on when it's very dark. My requirements for a relatively high sensitivity control and hysteresis control, has proven (via experimentation), that I need a circuit based on a comparator or op-amp. I wanted to use a real comparator since I had some (LM311) and it feels more correct than misusing a 741 op-amp which many circuits are based on. Also, I wanted to use an N-channel FET for driving a load directly (rather than using a relay), since my load is 12V DC-based and will only use few Amps.The current breadboard setup (circuit below) works great in regard to sensetivity and hysteresis, but I can't get the output voltage from the LM311 above 1.4V and 1.4V is not enough to trigger the gate of the FET. I know I could add another transistor between the output of the comparator and the FET (and perhaps I will have to), but I'd rather not if I can avoid it. I tried playing with the values of the voltage dividers, thinking the current somehow maps to the output voltage, but I did not observe this.So I guess my question is; how do I control the output voltage of the comparator to give me the 4-5V that I think I need for the FET?

author: AndyC_772
author_rank: Super Contributor
timestamp: September 22, 2013, 12:16:25 pm
content: You'll need a pull-up resistor on the output of your comparator. If your FET will accept VGS >= 12V, then you can just put, say, a 10k resistor between the output of the comparator and the +12V rail. If the FET has a particularly low VGS rating, you could also add a second, equal resistor between the output and GND so that you effectively have a pull-up to 6V rather than 12.

author: casper.bang
author_rank: Frequent Contributor
timestamp: September 22, 2013, 02:20:39 pm
content: Thanks for the advice Andy, it makes perfect sense when I think about it; help to pull the gate high (higher than 1.4V) "by default" unless sinked by the comparators low output (typically 0.1V). Unfortunately, I can't observe any difference in behavior - except for a rise of a few mV. The IRFZ48 FET has a max gate voltate of 20V, so this aspect should be Ok.Really wish I understood comparators better, specifically why I continue to see a high of only 1.4V on the output. I understand how the two input's work as each-others reference, but how the output voltage factors in eludes me. All I can think of is to add another transistor amplifying the 1.4V to proper 5-6V, but I can't help thinking that it's unnecessary.

author: fcb
author_rank: Super Contributor
timestamp: September 22, 2013, 02:28:16 pm
content: 1. Try the circuit with the 200K hystersis pot and the FET (measure the output from the comparator) disconnected - make sure you have a pull-up resistor.2. I'm sure you are powering the comparator - your cd doesn't show it though.

author: casper.bang
author_rank: Frequent Contributor
timestamp: September 22, 2013, 02:42:36 pm
content: Quote from: fcb on September 22, 2013, 02:28:16 pmDoesn't seem to change anything, output goes from 0.1V when light falls onto the LDR, up to 1.42V when LDR is shaded.QuoteIt's powered alright, I can observe correct behavior and adjust sensitivity and hysteresis - but *not* output voltage.I tried connecting a pot as a 12V voltage divider to the FET's gate, and it seems the gate needs close to 100% (12V) of VCC for the FET to turn on the load. I guess this is normal for a FET and it also means I do need to go from 1.4V -> 12V for the FET to be operating as intended, as a switch.

author: fcb
author_rank: Super Contributor
timestamp: September 22, 2013, 03:19:10 pm
content: Have you tied pin1 and pin4 both to 0V?What are you doing with the strobe line?

author: w2aew
author_rank: Super Contributor
timestamp: September 22, 2013, 03:21:04 pm
content: Silly question - do you have BOTH pins 1 and 4 connected to ground (and 8 connected to 12V)?

author: Wim13
author_rank: Frequent Contributor
timestamp: September 22, 2013, 03:45:59 pm
content: The LM311 has a open collector output, normal op-amps uses totem outputs.So the output of the LM 311 is just the collector of a transistor, withnothing connected, so if not connected to +12 V with a resistor ,nothingwil happen...

author: w2aew
author_rank: Super Contributor
timestamp: September 22, 2013, 03:55:29 pm
content: Quote from: Wim13 on September 22, 2013, 03:45:59 pmJust checked the data sheet, and so it is! Simple fix - add a pullup resistor to the LM311 output.

author: casper.bang
author_rank: Frequent Contributor
timestamp: September 22, 2013, 04:00:37 pm
content: Ok this is embarrassing, fcb and w2aew made me look at pin4 (Vcc-) again and it turns out that I had not connected this, assuming Vcc- was on pin1 (which also needs grounding). Funny that the circuit itself otherwise appeared to work, except for the fixed output voltage aspect. Thanks a lot guys!PS: Output (LDR shaded) is now around 5V which seems to be fine for the FET, without using a pull-up.QuoteInteresting, I learned something about OC today. The hysteresis feedback pot appears to be adequate for this circuit though.

author: w2aew
author_rank: Super Contributor
timestamp: September 22, 2013, 04:09:27 pm
content: You're probably not going to get the desired amount of hysteresis without the pullup resistor though, since the OC output can only sink current when the output transistor is turned on (output low in this case). When the output transistor is off (output high), you probably want the output to go to the VCC rail to give you the amount of hysteresis you intended for the comparator.

author: hgg
author_rank: Frequent Contributor
timestamp: November 13, 2013, 02:45:13 pm
content: Hi,I am having a similar problem but in my case using a thermistor.Although the circuit works perfectly and the on/off transitions are verysharp, I cannot get an output of more than 1.42Vbut only when Ihave the output of the comparator connected to the base of a BC107.If I remove the BC107 and measure the output, then it is close to 12V.Is that normal ?In the LM311N datasheet it lists a parameter named Vol (low level output voltage)and it has a maximum value of 1.5V Does anybody knows what is that?LM311 CircuitThanks.

author: pinkysbrein
author_rank: Contributor
timestamp: November 13, 2013, 03:14:23 pm
content: Silly question, is the emitter connected to ground? (If so you need a base resistor.)

author: hgg
author_rank: Frequent Contributor
timestamp: November 13, 2013, 03:18:49 pm
content: Hi,Yes, of course. I have also connected a resistor to the base of the BC107.The output of the comparator works as it should. 11.6V when triggeredand zero otherwise. My question is why does it go to 1.4V if I connect anNPN transistor to it.Also do you know if Vs- should also be connected to ground even if you areusing a single voltage supply?

author: pinkysbrein
author_rank: Contributor
timestamp: November 13, 2013, 03:31:19 pm
content: Quote from: hgg on November 13, 2013, 03:18:49 pmWell, you you literally said "I have the output of the comparator connected to the base of a BC107." ... lets pull more teeth though ... is it large enough to pull the voltage higher?The base is at around 0.6 volt ... with a 1K base resistor the 1K resistor would only have (12-0.6)/11 ~= 1 Volt across it, because the base resistor forms a divider with the pull up resistor, which brings the comparator output to ~1.6, which is curiously close to your result.Maybe you "of course" have a larger base resistor, but hell if I know.

author: hgg
author_rank: Frequent Contributor
timestamp: November 13, 2013, 03:49:48 pm
content: You are spot on! That was the actual problem!Wrong resistor values...Right output voltage now.Newbie. still learning..Thank you very much!