As you can see in the picture, for LED1 it's all good, 12v and 800 ohms = 15 mA to the led.

But i don't know how to wire LED2 since the load to the LED will change depending on the load/Vout of the supply. How can i wire LED2 in a smart way?

(I'm not gonna use this circuit, it's just for an example)

Update: The reason that i wanted this from the beginning was because i wanted a way to break the load "fast". If i use a switch before LED1 and turn the circuit off, Capacitor C7 and C8 will have to be emptied and that will make the voltage slowly decrease instead of going to 0 directly. So i was thinking of having two switches like this:

enter image description here

And when the load switch is closed = current can flow then i want some kind of indicator (LED) in this case to light up and stay that way until i open the switch again, the lowest voltage possible is 1.25v, and the highest voltage in my case is around 18v. And i want the LED to stay on no matter what voltage i choose between 1.25 > 18v.

Also I'am a beginner in eletronics, so i apologize that i was a bit unclear. Please comment if you need me to add any more info regarding this.

  • \$\begingroup\$ I would just also use an 800 ohm resistor for LED2 as it is in that schematic. LED2 will just change brightness according to the voltage you set at the output but still light up as long as Vout is higher than 2.5 V or thereabouts. \$\endgroup\$ – Bimpelrekkie Mar 24 '16 at 10:21
  • \$\begingroup\$ I see, But since this is an LM317 the minimum voltage is 1.25 (with that voltage the LED will turn off) \$\endgroup\$ – Xane Mar 24 '16 at 10:24
  • 1
    \$\begingroup\$ That is correct. If you want to fix that then you should feed LED2 from the 12 V at the input and use an NPN transistor to switch it on and off. Then LED2 can be on even when Vout = 1.25 V. But de note that LED2 does not add much information, it will only be off when 1) no LED1 is also off 2) The LM317 is broken or shuts down 3) you short the output. But if that is what you need then the transistor solution is usable. \$\endgroup\$ – Bimpelrekkie Mar 24 '16 at 10:45
  • \$\begingroup\$ Sorry for the lack of info, basically what i want is that when PR1 (wire to the far right) Have any voltage across it, i want LED2 to be turned on. When no voltage goes through it i want it to be off. \$\endgroup\$ – Xane Mar 24 '16 at 11:11
  • \$\begingroup\$ You really shouldn't accept a answer so quickly. Others may have different things to say, but probably won't bother when there is already a accepted answer. I know that's what I do. \$\endgroup\$ – Olin Lathrop Mar 24 '16 at 11:18

First, 12 V into 800 Ω in series with a LED does not result in 15 mA. You are forgetting the LED voltage drop. Figure 2.1 V for a green LED. That leaves 9.9 V across the resistor. (9.9 V)/(800 Ω) = 12.4 mA. However, that's still fine. For most circumstances, even 5 mA is enough to light a indicator LED.

To figure out how to light LED2, you have to first specify when it is supposed to be lit. Should it light when the voltage is at least 90% of the intended value? Just light as long as there is any meaningful voltage on the output? Something else? It's not clear, since there isn't much point in the second indicator anyway. What is it supposed to show you that the first indicator won't?

Let's say the purpose is just to show there is some meaningful voltage on the output. The indicator will then tell you that the load isn't shorting the output, or that the regulator isn't in thermal shutdown. The basic problem is that the output voltage varies quite a lot, and you want the LED to be fairly constant.

Here's a quick and dirty circuit that should still be good enough:

The basic concept is to run Q1 as a fixed current sink. With the values shown, this current should be around 6 mA. This is the current thru the LED as long as the output voltage is above a minimum value in the 1.5-2.0 V range. The LED current won't change much as the output voltage varies above that.

This works by D2 and D3 forming a fixed voltage source when enough current flows thru them. This current comes from Vout, with R1 limiting it to a safe value. With Vout at 2 V and above, the voltage at the top of D2 should be reasonably constant.

The base of Q1 is held at this voltage. The B-E drop of Q1 and the drop across D2 should be about the same, so the drop across D3 appears across R2. With 700 mV across R2, 5.8 mA will flow thru it. Most of this comes from the collector of Q1, which comes thru D1.

Higher values of Vout just cause more current to flow thru D2,D3, but the voltage across these won't change much. There will be some change and temperature dependence, but the current thru the LED will be fixed well enough to serve its indicator function. This is a case where ±25% is still good enough. You'd need to see two LEDs side by side to notice a 25% difference in brightness.


You now say that the LED needs to be on with as little as 1.25 V on Vout. The circuit above might just barely do that, but will probably require a little higher voltage to be solidly and reliably on. Try it and see if it's good enough.

There are other topologies that can have a lower and more accurate threshold voltage. A simple one is a resistor divider straight into the base of a NPN with grounded emitter. Collector then activates a circuit on the input side of the regulator to turn on a LED.

  • \$\begingroup\$ Thanks for the great explination, this is exactly what i was looking for. Also like i said in one comment here: "what i want is that when PR1 (wire to the far right) Have any voltage across it, i want LED2 to be turned on. When no voltage goes through it i want it to be off." \$\endgroup\$ – Xane Mar 24 '16 at 11:17
  • \$\begingroup\$ @Xane - You need to pay more attention to Olin's point. You have not actually specified what "Have any voltage across it." For instances, Olin's circuit won't turn on the LED for an output of 0.6 volts, and the LED current will reach about 3 mA at about 2 volts. Do you care about low voltages? Is 1 volt enough to do weird things? You haven't said (and the exact numbers don't matter), so you made Olin guess. \$\endgroup\$ – WhatRoughBeast Mar 24 '16 at 11:45
  • \$\begingroup\$ @WhatRoughBeast: Olin could also have asked for details before. ;) I for example, would have provided an example using a shunt resistor and switing the LED using the voltage drop across the shunt caused by the load. Nevertheless the question was not clear enough initially. ;) \$\endgroup\$ – try-catch-finally Mar 24 '16 at 13:04
  • \$\begingroup\$ I will update the question with further info soon. \$\endgroup\$ – Xane Mar 24 '16 at 15:04
  • \$\begingroup\$ @Xane - You also want to be careful you don't confuse yourself and others with imprecise language as far as "across" and "through" are concerned. A voltage difference appears "across" (or between) two nodes, never through; current goes "through" a branch. If you want the LED to light only when a load is applied (without regard to the available voltage), that's something else entirely. The condition you would want to detect is current flow; in that case you'd need to specify the threshold current for what constitutes a "load", e.g. >10mA. \$\endgroup\$ – scanny Mar 24 '16 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.