# How can I efficiently drive an LED?

I understand that I can not connect an LED directly to a battery because it will draw too much current. Thus, there must be something else in the circuit to limit the current. What options are there? Are some methods more efficient than others?

## 4 Answers

An LED requires a minimum voltage before it will turn on at all. This voltage varies with the type of LED, but is typically in the neighborhood of 1.5V - 4.4V. Once this voltage is reached, current will increase very rapidly with voltage, limited only by the LED's small resistance. Consequently, any voltage much higher than this will result in a very huge current through the LED, until either the power supply is unable to supply enough current and its voltage sags, or the LED is destroyed. Above is an example of the current-voltage relationship for an LED. Since current rises so rapidly with voltage, usually we can simplify our analysis by assuming the voltage across an LED is a constant value, regardless of current. In this case, 2V looks about right.

# Straight Across the Battery

No battery is a perfect voltage source. As the resistance between its terminals decreases, and the current draw goes up, the voltage at the battery terminals will decrease. Consequently, there is a limit to the current the battery can provide. If the battery can't supply too much current to destroy your LED, and the battery itself won't be destroyed by sourcing this much current, putting the LED straight across the battery is the easiest, most efficient way to do it.

Most batteries don't meet these requirements, but some coin cells do. You might know them from LED throwies.

# Series Resistor

The simplest method to limit the LED current is to place a resistor in series. We known from Ohm's law that the current through a resistor is equal to the voltage across it divided by the resistance. Thus, there's a linear relationship between voltage and current for a resistor. Placing a resistor in series with the LED serves to flatten the voltage-current curve above such that small changes in supply voltage don't cause the current to shoot up radically. Current will still increase, just not radically. The value of the resistor is simple to calculate: subtract the LED's forward voltage from your supply voltage, and this is the voltage that must be across the resistor. Then, use Ohm's law to find the resistance necessary to get the current desired in the LED.

The big disadvantage here is that a resistor reduces the voltage by converting electrical energy into heat. We can calculate the power in the resistor with any of these:

$P = IE$
$P = I^2 R$
$P = E^2/R$

Any power in the resistor is power not used to make light. So why don't we make the supply voltage very close to the LED voltage, so we don't need a very big resistor, thus reducing our power losses? Because if the resistor is too small, it won't regulate the current well, and our circuit will be subject to large variations in current with temperature, manufacturing variation, and supply voltage, just as if we had no resistor at all. As a rule of thumb, at least 25% of the voltage should be dropped over the resistor. Thus, one can never achieve better than 75% efficiency with a series resistor.

You might be wondering if multiple LEDs can be put in parallel, sharing a single current limiting resistor. You can, but the result will not be stable, one LED may hog all the current, and be damaged. See Why exactly can't a single resistor be used for many parallel LEDs?.

# Linear Current Source

If the goal is to deliver a constant current to the LEDs, why not make a circuit that actively regulates the current to the LEDs? This is called a current source, and here an example of one you can build with ordinary parts: Here's how it works: Q2 gets its base current through R1. As Q2 turns on, a large current flows through D1, through Q2, and through R2. As this current flows through R2, the voltage across R2 must increase (Ohm's law). If the voltage across R2 increases to 0.6V, then Q1 will begin to turn on, stealing base current from Q2, limiting the current in D1, Q2, and R2.

So, R2 controls the current. This circuit works by limiting the voltage across R2 to no more than 0.6V. So to calculate the value needed for R2, we can just use Ohm's law to find the resistance that gives us the desired current at 0.6V.

But what have we gained? Now any excess voltage is just being dropped in Q2 and R2, instead of a series resistor. Not much more efficient, and much more complex. Why would we bother?

Remember that with a series resistor, we needed at least 25% of the total voltage to be across the resistor to get adequate current regulation. Even so, the current still varies a little with supply voltage. With this circuit, the current hardly varies with supply voltage under all conditions. We can put many LEDs in series with D1, such that their total voltage drop is say, 20V. Then, we need only another 0.6V for R2, plus a little more so Q2 has room to work. Our supply voltage could be 21.5V, and we are wasting only 1.5V in things that aren't LEDs. This means our efficiency can approach $20V / 21.5V = 93 \%$. That's much better than the 75% we can muster with a series resistor. # Switched Mode Current Sources

For the ultimate solution, there is a way to (in theory, at least) drive LEDs with 100% efficiency. It's called a switched mode power supply, and uses an inductor to convert any voltage to exactly the voltage needed to drive the LEDs. It's not a simple circuit, and we can't make it entirely 100% efficient in practice since no real components are ideal. However, properly designed, this can be more efficient than the linear current source above, and maintain the desired current over a wider range of input voltages.

Here's a simple example that can be built with ordinary parts: I won't claim that this design is very efficient, but it does serve to demonstrate the principle of operation. Here's how it works:

U1, R1, and C1 generate a square wave. Adjusting R1 controls the duty cycle and frequency, and consequently, the brightness of the LED.

When the output (pin 3) is low, Q1 is switched on. Current flows through the inductor, L1. This current grows as energy is stored in the inductor.

Then, the output goes high. Q1 switches off. But an inductor acts as a flywheel for current. The current that was flowing in L1 must continue flowing, and the only way to do that is through D1. The energy stored in L1 is transferred to D1.

The output goes low again, and thus the circuit alternates between storing energy in L1 and dumping it in D1. So actually, the LED blinks rapidly, but at around 25kHz, it's not visible.

The neat thing about this is it doesn't matter what our supply voltage is, or what the forward voltage of D1 is. In fact, we can put many LEDs in series with D1 and they will still light, even if the total forward voltage of the LEDs exceeds the supply voltage.

With some extra circuitry, we can make a feedback loop that monitors the current in D1 and effectively adjusts R1 for us, so the LED will maintain the same brightness over a wide range of supply voltages. Handy, if you want the LED to stay bright as the battery gets low. Replace U1 with a microcontroller and make some adjustments here and there to make this more efficient, and you really have something. • There's also inductor-less PWM to limit the thermal load to within the package spec even while driving at a higher peak current than the device continuous rating. Higher perceived brightness for less average power has been claimed by some using this technique. Some sort of current limiting is still required in this case, whether it be battery impedance, series resistor, or current source. – HikeOnPast Jan 23 '13 at 2:57
• @HikeOnPast that's been covered – Phil Frost Jan 23 '13 at 3:01
• +1 - this post should be sticky or hung in a gallery or something for everyone who ever asks about "how to light an LED" or all the thousands of variations on the same question. – John U Jan 23 '13 at 9:17
• @clabacchio graphs by gnuplot – Phil Frost Apr 17 '13 at 12:13
• See also Joule thief for efficiently driving LEDs from very low voltage sources such as nearly exhausted single-cell batteries. – RedGrittyBrick Jun 16 '13 at 9:16

There is one other way, much less commonly seen. Good for one LED, very simple, you can throw anything from about 4v to 20v at it, and it happily gives the LED a fairly constant current.

Blue is the input voltage, 20v to 4v. Green is the current to the LED, about 12mA. Red is the power dissipated by the JFET, datasheet here. • What witchcraft is this? How does this even work? – Yarek T Feb 3 '16 at 22:28
• Although this is an unorthodox usage for a JFET, this effect can be explained by the "Zero–Gate–Voltage Drain Current" rating in the datasheet. With the gate tied directly to the source, the gate always appears as 0v, so the JFET behaves as though it is "on." The conduction channel inside the JFET is narrow enough that it effectively limits the amount of current that can flow through it. This phenomenon varies greatly with different JFETs and even devices from the same batch. (The 2N3819 is rated 2-20mA; 12mA is a typical value.) – rdtsc Apr 4 '16 at 2:50
• "There is one other way, much less commonly seen." The JFET forms a CCS, so conceptually it is not different from those approaches being discussed earlier. It is much less used for two reasons: 1) JFETs have very poor consistency from device to device; 2) the power dissipation on the JFET can easily exceed its rating. – dannyf Jan 20 '17 at 17:36
• Hence why I said "you can throw anything from about 4v to 20v at it". Of course power dissipation has to be taken into consideration, and ~20v is the max for this device. Efficient? Not really. But quite useful. If you can find a simpler way to drive an LED from 4v to 20v with a current of +/-0.3mA, we'd love to see it. – rdtsc May 26 '17 at 18:28
• Adding a resistor RS in series with the source (LED side) allows current regulation below the maximum available current I_DSS at VGS=0. Voltage drop across RS is made equal to -VGS and the circuit will find an equilibrium at a lower current: the larger RS the lower the current, until the desired one. – andrea Sep 2 '17 at 8:23

Here is a collection of LED driver options you can play with. simulate this circuit – Schematic created using CircuitLab

• V2 would have to be >=4v for some LED types. The LM317 also needs 1.25v over the LED voltage to regulate. – rdtsc May 13 '20 at 12:54
• Use that one with the LM317. Current = 1.25V / R4. It works for homebrew electronics perfekt. Is short proof and protectet against overheating. – Bill Sep 27 '20 at 11:48
• @Bill it is tremendously inefficient unless you drive many LEDs: LM317 needs 2.5V minimum between I-O terminals to work properly. Then add the drop across R4 and you have at least 3.75V dropped across your current source. To make this thing efficient you would need that drop to be less than 0.25 times the drop across the LED (for 80% efficiency), so you would need AT LEAST 15V across the LED, which of course cannot be a single device, but a LED string of at least ~5-6 LEDs (depending on actual drop of a single LED). So it's usefulness as a general purpose driver circuit is quite limited. – Lorenzo Donati -- Codidact.com May 7 at 8:22
• Also @rdtsc: NONE of those circuits are going to work at all with V2=1V, with ANY kind of LED: even IR LEDs have at least ~1.2V of drop when on. Other LEDs that emit light having higher frequency (shorter wavelength) have higher drops (for physical reasons related to the energy of the emitted photons, which is proportional to their frequency). I suspect a typo. Probably V2 was meant to be 10V or 12V. – Lorenzo Donati -- Codidact.com May 7 at 8:29

that's not quite true - as it depends on a lot of factors.

the issue with leds is that 1) once they start to conduct, a little bit increase in voltage will create tremendous increase in current. with the right combination, that can mean damages; 2) as the leds heat up, their forward voltage drop declines, which causes the current through the leds to go up. that in turn causes the power dissipation on the leds to go up, and the leds heat up. that leds to a vicious cycle.

So one way to avoid that is to introduce negative feedback so that when the current in the leds goes up, the voltage across the leds goes down.

many ways to do that. resistors, sensors, active controls, etc.

• "that's not quite true": what, exactly? using current sourcing in any case supplies the needed amount of current whatever the change of LED voltage. If the LED current shall be reduced with temperature, maybe to avoid overheating, that's another matter and probably there are no design margins. To clarify "many ways to do that. resistors, sensors, active controls, etc.": it's generic, a whole world of electronics, "right" and "wrong", as the original question asked. – andrea Sep 2 '17 at 8:26