# How do I make an LED turn on when my output reaches 5v?

I'm a hobbyist and pretty new to many of the components involved, so I hope you guys can help me here. I'm trying to keep the circuit as simple as possible.

I made a small variable power supply with a buck converter and would like an LED to come on when my output reaches 5V. I'm not really concerned about it staying on after 5V is exceeded, but I definitely want it off if the voltage is lower than that. After looking into it a bit, I'm assuming I'll need a MOSFET or a transistor of some sort but I don't know enough about either of them to begin finding the correct one. If it matters, here is the buck converter I'm using:

The only other things in the circuit are a volt meter wired to the output and powered from Vin and GND and I replaced the potentiometer with a larger one.

-
I think one of these would do what you ask and more (that is being able to accurately tack the voltage level). If you already have one of these (since you mention a volt meter) then I'm not sure of the purpose of the led. –  alexan_e Mar 20 '14 at 16:49
That's exactly what i have on there right now. I want the led in addition to that. –  Bradart Mar 20 '14 at 16:50
You said you want the LED to be off if the voltage is less than 5 volts but on if the voltage is greater than or equal to 5 volts. That's impossible in practice. What is the range of on/off switching that you can accept? –  Joe Hass Mar 20 '14 at 18:07
I suppose anything 4.8-5.2 volts would be an acceptable range. –  Bradart Mar 20 '14 at 18:09

A TL431 is about the cheapest and easiest way to do this. See below schematic. The reference voltage of the TL431 is 2.495V nominally, so about 5V and greater (it's divided by two with the two 1K resistors) will turn the LED on.

If you are trying to detect a nominal 5V supply rail, you should set it to detect a lower voltage such as 4.5V to allow for tolerances. That would mean making R2 a bit bigger or R3 a bit smaller.

Only about 3V is available for the LED so avoid using high $V_F$ types such as blue and white.

The TL431 is a reference and an amplifier, all in a 3-pin package that costs only cents in quantity.

A similar circuit to this is often used to regulate the output voltage of switching power supplies, where an optocoupler LED is placed where your indicator LED is.

simulate this circuit – Schematic created using CircuitLab

-
This looks to be right on my level. If you don't mind, though, I'm trying really hard to understand what's happening in the schematic and I can't seem to grasp the mechanism at work here. Voltage comes in and, with the tl431 not allowing electricity to pass, it goes around and through the pulldown resistors on the right, yes? Then, when the voltage reaches the proper level, it triggers the reference on the 431, allowing the power to go through the LED (which has been resisted down to avoid blowing it up). Is that right? –  Bradart Mar 20 '14 at 17:55
I'll edit to include the datasheet link and block diagram of the chip, please ask again if something is not clear. The TL431 is a reference + a comparator in a 3-pin package. –  Spehro Pefhany Mar 20 '14 at 17:57
The OP said the LED should be off if the voltage is below 5 volts. Doesn't your circuit fail that criteria, if the LED is still on for voltages above 4.5V? :) –  Joe Hass Mar 20 '14 at 18:05
@JoeHass Hi. Yup, I'm questioning the criteria, after giving him what he asked for, just in case it wasn't what he wanted ;-) –  Spehro Pefhany Mar 20 '14 at 18:20

I recommend using an OpAmp as a comparator.

Have a look at this instructable: Voltage controlled switch. It explains how you can build a simple voltage controlled switch just using an opamp, zener diodes and resistors. Its schematic is below:

The comparator compares a reference voltage (generated with the zener diode) to an input voltage and outputs 0V or VCC depending on which input is higher.

The circuit described in the instructable does pretty much what you want.

-
Welcome. Please note what is considered a good answer: Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. –  alexan_e Mar 20 '14 at 17:01
You might also consider using an LM393 comparator in place of an op amp. It's less expensive, but performs the function the same way (that is, with the same inputs). The only functional difference is the potential need for a pull-up resistor on the output, which won't be necessary if the goal is merely to light an LED. –  nsayer Mar 20 '14 at 17:31
Won't the zener diodes fail to conduct when the supply voltage is less than 5V? How can this circuit be reliable at low voltages? –  Joe Hass Mar 20 '14 at 18:11