Single supply window comparator - Vcc tied to Vref

Thread Starter

JStitzlein

Joined Dec 6, 2010
53
I'm trying to create a window comparator using a LM 393. To eliminate one extra supply, I tied Vcc/Vinput to my Vref input... After trying all day, I realized this doesn't work. Am I wiring something wrong or does this need three supplies?

Thanks in advance



P.S. - the only way I got it to work was with three supplies, but theres got to be an easier way?
 

praondevou

Joined Jul 9, 2011
2,942
The comparators need pull up resistors. It's an open collector output. The output voltage will always be zero , either through the output resistors or the internal transistor.

Can you tell us what is it you want to achieve? How is the output voltage supposed to react on input voltage changes?
 

Thread Starter

JStitzlein

Joined Dec 6, 2010
53
The comparators need pull up resistors. It's an open collector output. The output voltage will always be zero , either through the output resistors or the internal transistor.

Can you tell us what is it you want to achieve? How is the output voltage supposed to react on input voltage changes?
I didn't modify my schematic to reflect the pullup resistors. The output voltage should switch between either op amp and produce a high. I got the circuit from here:
http://ecelab.com/circuit-window-comp.htm
 

Adjuster

Joined Dec 26, 2010
2,148
In addition, if the inputs can respond to voltages as high as Vcc at all, for many devices this will be close to the maximum voltage limit (for the LM393 it is too high). http://www.ti.com/lit/ds/symlink/lm393-n.pdf

If Vref is to be obtained from Vcc, typically a potential divider is used to cut the voltage down to a more convenient level..
 

SgtWookie

Joined Jul 17, 2007
22,210
I see you're using 13.7 and 13.9 for voltages, which leads me to think you may be considering using the LM393 in a vehicle. Note that the LM393 and the LM339 are NOT rated for the automotive temperature range.

The LM393 can sense nearly down to ground, but it can't sense within about 1.5v of it's supply.

Also, the LM339 and LM393 can't sink more than 6mA current without the output saturation voltage getting pretty high. If you want to keep the output nice and low when its' sinking current, keep the current through the pull-up resistor at or below 4mA.

To calculate the pull-up resistor value:
Rpullup >= Vcc / 4mA
 

BJT_user

Joined Oct 9, 2011
35
Using only two supplies is viable, but you need to have a little additional circuitry.

First, your reference inputs need to be connected to a series-resistor divider network that will set the reference voltages at the point you want the comparitors to trigger. IE, with 12 volts Vcc, you can use three 10K resistors in series to produce reference voltages that are 1/3 and 2/3 Vcc, which comes out to 4 and 8 volts. These would then be the low and high trigger points in your window. Your trigger pionts can be any levels you select, of course. You just need to generate them using properly calculated resistors tied in series between Gnd and Vcc.

Now, If you tie the two reference pins together, as I see in your schematic, you will end up with a single trigger point instead of a window. But you will still need to connect the combined reference pins to a series-resistor voltage divider network with the values calculated to generate the reference voltage you want the comparitors to trigger at.

As far as the outputs of the LM339, Praondevou got it exactly right. Take a look at the representative schematic here; http://www.usmicrowaves.com/comparators/LM393.htm. The comparitors can only provide a ground connection when triggered, so you'll need to tie your loads from each output, to Vcc.

Hope this helps.
 
Last edited:

Thread Starter

JStitzlein

Joined Dec 6, 2010
53
hey guys, i got it working. I replicated the same divider network for Vinput and Vref.

Everything works now, but now I need to modify the circuit as it doesn't operate the way I need to. If Vinput is left open, it lights the bottom led. How can I keep the Top led lit?
 
Last edited:

BJT_user

Joined Oct 9, 2011
35
How can I keep the Top led lit?
Just tie a high-value resistor from Vinput to Vcc. The value can't be too low or it will influence the Vinput voltage while it is being monitored. I'd recommend a 1 megaohm at least. That way when Vinput is left open, it will sense Vcc potential through the resisstor and turns on the upper light (assuming the upper light triggers when Vinput goes above the reference voltage).
 
Last edited:
Top