Electronic – Window comparator using LM339 – invert output

comparatorvoltage

I'm using the LM339 for an application with different voltage ranges. I am using the window comparator circuit since I want to test a specific range (4 – 8V). The circuit shown below actually identifies this "window" but not as I am expecting. When the input value is in this window I want to light the led, instead the led is off. Is there a way I could invert this output to light it in the window and turn it off when it's out of range?

Sorry if it's too dumb, but I'm stuck with this.

Led is off when the value is in 4 - 8V, and on otherwise

Best Answer

Put the LED between the combined output and ground and put the resistor directly to 12V.

When either of the comparators turns on it will short the output to ground and turn off the LED.

The function needed is a logical AND. The input level should be less than the upper limit AND above the lower limit.

The original connection of the LED performed a logical OR - it would light if the input was above the upper limit OR below the lower limit.

The open-collector outputs of the LM339 cannot be configured to do a logical AND but by inverting the logic we can do a DeMorgan conversion and now cause the LED to be OFF if the input is above the upper limit or below the lower limit which means it is ON while the input is within the window.

Related Topic