# Basic comparator strange problem

I am trying to create a super simple Low Battery alert monitor, by utilizing an open-loop comparator. LBO is active-low - it's connected to a TTL input pin of a uC, running from same Vbatt voltage. The circuit's running from two series AA cells so I get 3.0V when it's fresh, and I want to create an alert when battery voltage (Vbatt) falls below ~2.15V. Zener diode is Vz=1.8V @ 50uA.

I calculated the voltage divider R43/R46 so that it'll give that 1.8V threshold voltage when Vbatt reaches 2.15V, and indeed it does so. So whenever Vbatt>2.15 I get higher voltage on V+ than V-, but for some strange reason the comparator does not output its VCC, (I measure 0V on its output pin) only when Vbatt reaches 3.3V (used a programmable power supply) and so V+=2.75, V-=2.11V I detect that the comparator is switching to output VCC.

Why does this simple circuit doesn't work? Why does this comparator needs >0.6V difference between V+/V- to switch its output to high? Is there some parameter I am missing? Can I solve this issue without changing the circuit (only resistor values)?

simulate this circuit – Schematic created using CircuitLab

Info:

U5 comparator is Diodes AP331A chose it because it can run from single supply down to 2.0V which matches the whole idea.

D1 zener is DDZ9678

• "and so V+=2.75, V-=2.11V..." This may be a clue. Why does V- read 2.11V when Vz is 1.8V? Could you have a wiring error? Sep 16, 2013 at 18:02
• Never mind, Fig. 4 in the data sheet gives the answer. Sep 16, 2013 at 18:09
• please fix your question so it refers to "comparators" and not "opamps" Sep 16, 2013 at 19:01

I think you are outside the input common mode voltage range. The data sheet gives (V+) - 1.5 max.

• Good catch. So the opamp works with a supply voltage of 2V but the input range is only 0 to 0.5V...and it's less if the temperature is other than room temperature. A little misleading datasheet, I'd say. Sep 16, 2013 at 18:50
• Well spotted - just in case the OP doesn't understand, the valid input voltage range extends from 0V to Vsupply minus 1.5V Sep 16, 2013 at 18:59
• Oh, that's gives me an impossible range to work with, as I need to catch that ~1.8V threshold! :-( Do you guys have any recommendation for a different comparator/opamp that can do this trick? (work from a single rail and detect it's below a threshold, <0.3V from the VCC itself?) Sep 17, 2013 at 9:56
• OK, I found a new comparator candidate: NXP NCX2200 nxp.com/documents/data_sheet/NCX2200.pdf I think it's Vicr is full rail-to-rail so it'll do the work, unfortunately I have to do a layout change in my PCB as its not pin compatible. What do you think? Sep 17, 2013 at 12:15
• The NXC2200 looks like it should work. Be aware that it has an active pull-up on the output; you won't need R45 Sep 17, 2013 at 12:41

This probably doesn't answer your question, but if you need a comparator function in a circuit, use a comparator, not an op-amp. There are some major design differences between the two; comparators are optimized for response time, not linearity.

Also an opamp used in saturation (the two "+" and "-" inputs not near each other) may have two major drawbacks:

1. Current consumption may rise above the normal amount when an opamp is in its linear region
2. Response time needed to come out of saturation is generally not specified, and can be long (hopefully less than 1msec)
• He's using a comparator - read the data sheet. Sep 16, 2013 at 18:58
• Bah! Then fix the question! It's not about an opamp. Sep 16, 2013 at 19:01
• Hee hee "Bah" I can imagine that +1 for pointing out the minor inadequacy in the question and making me smile Sep 16, 2013 at 19:04
• Thanks for pointing it out; I just happened to read the question during a quick break and thought I'd chime in. I would have noticed if it was an LM393 or something similar. Sep 16, 2013 at 19:42
• You used "opamp" in the question several times. Please don't; it has nothing to do with opamps and is misleading. Sep 17, 2013 at 13:46

Just as info for a better solution I decided on:

• first I switched to using to a true rail-to-rail range comparator like the NXP NCX2200.
• second, I switched to using a shunt voltage reference IC instead of the (temprature/input voltage un-stable) zener diode.
• Third, I scrapped the whole thing and switched to using a single IC solution (voltage detector) that does what I need with zero external components: ST STM1061N22WX6F datasheet: http://www.st.com/web/en/resource/technical/document/datasheet/CD00065467.pdf
• Thanks for closing the loop on this. In general, it's better to add this sort of thing as an edit/addition to the text of the question so that it's right up front for the next reader. Sep 18, 2013 at 19:20