Comparator (LM339) Question


Joined Aug 1, 2013
Observation, when output low there is a small current thru RED LED, eg. its log curve at low V,
and if modern high bright LED used it possibly can glow at a low level ?
maybe, but ...

If you swap the two LEDs, now the difference Vf difference between the single LED and the LED + diode string is significantly (in Vf terms) greater. The same is true if both LEDs are red, but less true for green. I completely understand how conditions and components could combine to have the off LED glow dimly, but, with low-cost "standard" LEDs and room lighting, I have not seen it.



Joined Jun 8, 2013
My guess from your first question is that you do not understand the output stage of an LM339. The 339 is not a normal opamp. The output can sink current as in your first schematic, but it cannot source current as would be needed in the second schematic. In short, your approach (which would work with a true opamp) will not work with a comparator that has an open collector output.

But it can be done with one comparator using a trick. In this schematic (a fragment from the past), the LM393 is a dual version of the LM339. When pin 1 is high, current goes through the resistor, red LED, and the signal diode. When pin 1 is low, the green LED "shorts out" the red LED + diode combination because it has a lower forward voltage (2.1 V) than the combination (1.8 V + 0.6 V = 2.4 V). The green LED runs with higher current, so choose the resistor accordingly.

Apologies for the schematic quality (no reference designators, decoupling, unused pin treatments, etc.). I'll clean it up soon.

View attachment 199841

I got curious and tried this circuit.....The red LED was too bright when off. I had to shunt the RED led with a 270 ohm resistor to get it to work. But worked well with shunt resistor around RED led.