# Best way to make an LED turn on only when a certain voltage is reached?

Discussion in 'General Electronics Chat' started by SiegeX1, May 9, 2011.

1. ### SiegeX1 Thread Starter Member

Mar 10, 2009
25
0
I want to have an LED turn on when ~10V power is applied. I was thinking on using a Zener diode in series with the LED as shown in the attached screenshot. This seems to work fairly well, the LED starts to come on right around 9V and is drawing 20mA right around 10V. Is this a suitable way of doing what I want?

Thanks

File size:
88.9 KB
Views:
142
2. ### danforth Member

May 8, 2011
22
0
I think it will be similar to a "low battery indicator" circuit. I may be wrong though...

3. ### Jaguarjoe Active Member

Apr 7, 2010
770
90
If you put a ~6v zener in series with a ~2 v LED, that's 8v. With 10v coming in your resistor needs to be R = E/I = 2/.02 = 100 ohms to eat the extra 2v. With the 50 ohm resistor in there now, the current will 40ma, a bit much for the LED. OTOH, at 9v with the 100 ohm resistor, I is now 10ma. Safe for the LED and it still lights up.
The other way to go is with a comparator or a cheap 8 pin uC to get exact on/off points, but this might be over complicating things.

4. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
I've done the circuit with the zener. It works but the display is "mushy". There is no clear transition, everything is gradual. If this is good enough, then all is well.

A comparitor is anything but mushy, it is on or off, no in between.

In my article LEDs, 555s, Flashers, and Light Chasers in Chapter 3, The LED / Resistor Only Bargraph I describe how to use the Vf to make a crude bar graph. Like the zener circuit, it is mushy, it takes 3 or so LEDs to make a full transition between lite and dark, but it works. There are chips that have the comparitors in there that will do the same thing much cleaner.

SiegeX1 likes this.
5. ### SiegeX1 Thread Starter Member

Mar 10, 2009
25
0
Thanks for the replies and the suggestion about using a comparator. I mocked up a circuit with a comparator as seen in the attachment below. Any gripes with me using a diode's forward voltage to step down the Vm input so it's not right at the rail? Also, any problems with using 30k resistors? The SPICE results with a DC-sweep from 0-15V seem very promising but I know simulation is no replacement for real-world experience.

Thanks

File size:
113.8 KB
Views:
123
6. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
Never used that comparator, I tend towards LM393 and LM339, but it looks good from here.

7. ### #12 Expert

Nov 30, 2010
16,672
7,314
This circuit is not as tight as yours, but I achieved "from nothing to saturated" in two tenths of a volt by putting about 12.6 volts through a 12v zener to a 91 ohm resistor, then a 1k to the base of an npn, and the final adjustment is with a resistor from the base to ground. Generally 2.2k to 4.7k gives a few tenths of a volt threshold adjustment.

of course, the LED is in the collector circuit with a 1.2k current limiter.

I this isn't too sloppy for you, it only requires a transistor, not a comparator. If you're lucky, you get what you pay for. More transistors cause sharper results.

SiegeX1 likes this.
8. ### SiegeX1 Thread Starter Member

Mar 10, 2009
25
0
Thanks for this idea, I threw it into LTspice and it worked great! I wanted to make another circuit for a 5V LED and I can use this with a dual NPN IC. I attached schematics for both the 10V and the 5V versions with waveforms in case anybody else wants to follow this design.

Thanks

File size:
200.1 KB
Views:
90
9. ### #12 Expert

Nov 30, 2010
16,672
7,314
Don't forget, you can put a resistor from VB to ground and get a little bit of adjustability.

I'm glad I could get you that little bit more of what you needed with a simple circuit. It makes my efforts feel worthwhile.

10. ### nbw Member

May 8, 2011
36
10
I second the bog-standard little LM339. Very easy to use, and has a great snap-on/off action.

11. ### SiegeX1 Thread Starter Member

Mar 10, 2009
25
0
Regarding the LM339. Is there a way that I can use this to drive an LED after the non-inverting input crosses Vref and also have the output latched such that when the comparator goes high it stays high until power is removed?

I have a Current Sense IC which puts out a voltage between 0-2V depending on the current running through it (5 amps at full scale). I want to use a voltage comparator to detect this IC's output voltage and if it goes over 1V I want to both drive another IC's 'Disable' TTL input as well as turn on an LED indicating the device is disabled. The app notes for this Current sense IC suggests connecting a diode from the comparators output to the non-inverting input. I tried doing this in LTspice but it completely destroyed its functionality.

I have a feeling that the comparator in the app notes does not have an open collector output, but rather a push-pull/totem-pole. The problem is I'm having a hell of a time finding a reliable voltage comparator with push-pull output stage that can directly drive an LED at 20mA.

Any suggestions?

Thanks again!

12. ### Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
Do you need a logic high to drive the Disable input? What is your logic high voltage (+5V, +12V, ...)?

13. ### SiegeX1 Thread Starter Member

Mar 10, 2009
25
0
The datasheet for the Si8233 MOSFET driver which has the DISABLE input pin seems to imply 2V via the VIH spec on page 6.

Also, while I'm linking to datasheets, here is the link to the app note I mentioned in my last post which shows the latched voltage comparator on page 2.

To make it a bit easier for you guys, I've taken a screenshot of the relevant app note circuit and attached it. I still want to also drive a LED which the app note circuit doesn't show.

Thanks all

File size:
135.3 KB
Views:
39
14. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
With any comparator just swap the inputs if you want to invert the signal. Most comparators have open collector outputs, so a pull up resistor is required.

To turn a simple LED on/off that is major overkill.

This is a PWM circuit from chapter 5 of LEDs, 555s, Flashers, and Light Chasers

15. ### SiegeX1 Thread Starter Member

Mar 10, 2009
25
0
Hi Bill,

The problem isn't so much 'how do I drive an LED with an open collector comparator', that I know.

It's 'how do I drive and LATCH the output HIGH (with minimal components) AND drive an LED?

16. ### SiegeX1 Thread Starter Member

Mar 10, 2009
25
0
So I think I found the comparator to do what I want...the LT1116. It has a LATCH input pin that works at logic levels. I tied the output to this pin and when the output went high, it stayed high. I've given up on trying to find a comparator that can both do this AND directly drive an LED so I just used an NPN to do that. See attached schematic. Anybody see anything wrong with this?

Thanks

File size:
74.8 KB
Views:
42
17. ### Ron H AAC Fanatic!

Apr 14, 2005
7,050
657
I found a comparator, but it can only source/sink 10mA. Is that enough for your LED?
It has a latch input, so if you feed the output back to Latch, it will never change output states until it is powered down. I'm not sure what it will power up in the right state, although it did in the simulation.
Unfortunately, it's \$4.00 at Digikey, and it's a 7ns comparator, which is overkill.
See the attachment.

File size:
28.7 KB
Views:
45
18. ### Jotto Member

Apr 1, 2011
159
17
I don't mean to get this conversation off track, but what is the program you both are using? Its very impressive.

19. ### SiegeX1 Thread Starter Member

Mar 10, 2009
25
0
Looks like we had very similar ideas! The LT1116 (which is pin compatible to the LT1713) actually says +/-20mA on it's absolute maximum rating. If I run this at 15mA and look for a super bright Red LED, I think 15mA should be just fine.

Also, thanks for the idea of using a battery to establish a 5V rail and then use net names for the +5V; makes the schematic much cleaner.

It's called LTspice, it's actually a fully featured CAD program which was procured by Linear Technologies and given out for free so people can model Linear's IC's. However, as you can see its very flexible and since it uses SPICE, you can simulate any IC that has a spice model for it.

Last edited: May 12, 2011
20. ### SiegeX1 Thread Starter Member

Mar 10, 2009
25
0
I contacted Linear to see if it was kosher to tie the Output pin directly to the latch pin and they said doing this would put the Output pin in an undefined state upon power-up. They suggested that I put a 1K series resistor between the two pins and then use an NMOS to connect the latch pin to GND and have an external control signal turn on the gate for ~0.5ms to allow the system to settle on a known (low) state.

This advice is sound, but the glaring problem is that it requires an external control signal to do this; that just really isn't acceptable. I racked my brain a bit and I *think* I came up with a way to do functionally the same thing with no added external signals but I really could use some expert advice as to whether or not this looks like it will work.

My idea is to use a P-channel JFET instead of an NMOS since the J-Fet's channel is normally on. Next, I'll tie the gate of the JFET to the +5V rail through an RC circuit who's time constant is such that the gate voltage won't pass Vth(off) until roughly ~0.5ms. I'm thinking on using the PMBFJ175 P-CH JFET since it has a Vgs(off) of 3V. It's on-resistance is 125ohm which is a bit higher than I would have liked but I think it's OK for this application as I'm not going to be drawing much current to pull the latch pin low. What do you guys think?

File size:
57.6 KB
Views:
40