Quick Answer
An LED is driven by setting its current, usually with a series resistor across the difference between the supply and the LED's forward voltage. How well that works depends on headroom: the more voltage the resistor drops, the less the LED's part-to-part spread matters and the more power is wasted.
Intuition
The pony in a field of spring grass
Turn a pony out onto rich spring grass and it will eat itself into trouble. It has no mechanism for stopping when it has had enough, so the only thing that limits the intake is whatever you put between the animal and the field: a smaller paddock, a grazing muzzle, fewer hours out.
An LED has exactly that shape of problem. Its current rises exponentially with the voltage across it, so there is no voltage at which it settles down and takes a sensible amount. Connect one across a supply that can deliver and it takes everything the supply will give, briefly.
The fence, almost always, is a resistor in series. It has nothing to do with the LED and everything to do with subtraction: the resistor gets whatever voltage the LED does not take, and the current is that voltage divided by the resistance. Choose the resistance and you have chosen the current.
The interesting part is what "whatever the LED does not take" means when the LED's own drop is not a fixed number. If the resistor is dropping most of the supply, a bit of variation in the LED changes almost nothing. If the resistor is dropping very little, the same variation changes everything. That single ratio, which this lesson calls headroom, decides whether a two-part circuit is good enough or whether you need a driver.
Practitioner
The resistor, and choosing it
The LED sets the voltage, the resistor sets the current.
Worked example — Sizing the resistor for one LED
The LED drops 2.05 V and the target current is 12 mA from a 12 V rail.
That computes to 829 Ω, and the nearest real value below it is 820 Ω, which gives 12.1 mA.
Rounding down rather than up is the habit worth having: it lands the current slightly high and safely inside the rating, where rounding up would leave the LED dimmer than intended for no benefit.
The resistor's own rating matters and is often forgotten. Here it dissipates 121 mW against the LED's 24.9 mW, so a quarter-watt part is right and an eighth-watt one is not.
The same part spread, two rails, eight times the consequence.
Worked example — What the part spread costs, and why the rail decides
LEDs of one part number vary in forward voltage by roughly 0.20 V either way, so the same part might drop 1.85 V or 2.25 V.
On the 12 V rail through 820 Ω, that gives anything from 11.9 mA to 12.4 mA, a spread of 4.02 %. Nobody would notice.
On a 3.3 V rail through 100 Ω, where the nominal current is 12.5 mA, the same part spread gives 10.5 mA to 14.5 mA, a spread of 32.0 %. On a row of indicators that is visible.
The rule that falls out of this is worth memorising: the resistor should drop at least a third of the supply, and preferably more. Below that, the LED's own variation starts to dominate and a resistor stops being an adequate answer.
Engineer
More than one LED
Two of these work, and the middle one is the one people build.
Series is the good answer wherever the rail allows it. One resistor sets one current, and every LED in the string necessarily carries it, so matching is automatic and the wasted headroom is shared.
Worked example — A string of three on the same rail
3.0 of these LEDs in series need 6.15 V between them, leaving the resistor the rest of the 12 V rail.
That computes to 488 Ω, so 470 Ω is chosen and the string runs at 12.4 mA.
The LEDs now take 51.3 % of the rail's power instead of 17.1 %, which is three times the light for very little more input.
One resistor feeding several LEDs in parallel is the mistake to know by name, because it looks reasonable, it lights up, and it is wrong.
Worked example — Why two LEDs cannot share one resistor
Put two nominally identical LEDs across one resistor. Their forward voltages differ by up to 0.20 V, and the current through each depends exponentially on the voltage they share.
At an ideality factor of 2.0 and a thermal voltage of 25.85 mV at 300 K, that difference is a current ratio of 47.9.
So one takes 98.0 % and the other 2.05 %. One is over-driven and the other is barely lit, and thermal feedback makes it worse as they warm.
Two identical part numbers, one takes almost everything.
One resistor per LED is the answer where series will not fit. It costs parts and it wastes the headroom several times over, but each loop is independent and no LED can take another's current.
The other cost of headroom
The resistor's share is the headroom you did not use.
Everything that makes a resistor a reliable current setter also makes it a wasteful one, and it is the same quantity in both directions.
Worked example — What the resistor costs
One LED from the 12 V rail draws 146 mW in total, of which 24.9 mW reaches the LED and 121 mW becomes heat in the resistor.
That is 17.1 % useful. Three in series on the same rail reach 51.3 %, and a lower rail does better still for the same reason.
On an indicator this is milliwatts and nobody cares. On a lamp drawing an amp it is the whole design problem, and it is why lighting products contain drivers rather than resistors.
Professional
Drivers, dimming, and the details
All three set a current; they differ in what they waste.
A current source fixes the spread but not the waste. A two-transistor current sink, or a three-terminal regulator wired as one, holds the current regardless of the LED's forward voltage or the rail. That removes both the part spread and any rail variation, which matters on a battery whose voltage falls all day. It still drops the same headroom across the pass element, so the power is identical to the resistor's.
A switching driver removes the waste. It chops the supply and uses an inductor to deliver a controlled average current, so the power lost is a small percentage rather than the whole headroom. The cost is a whole circuit, a magnetic component and an emissions problem, which is why it appears in lamps and not in indicators.
Dimming: switch it, do not squeeze it
The obvious way to dim an LED is to reduce its current, and it is the wrong way. Colour shifts slightly with current, the efficiency changes, and at low currents the part-to-part spread that headroom was hiding comes back.
Worked example — Dimming without moving the operating point
Switch the LED fully on and fully off instead. With 250 µs on in every 1.0 ms, the duty is 0.25.
The LED still runs at 12.1 mA whenever it is on, so its colour and efficiency are unchanged, and the average current is 3.03 mA.
The eye integrates anything above roughly a hundred hertz, so a kilohertz is comfortable and the flicker is invisible.
Two cautions on that. Flicker is not always invisible: a camera, a moving eye, or a scanned display can all make a switched LED visibly strobe even well above the flicker-fusion rate, which is why lighting products push their switching frequency far higher than the eye needs. And switching an LED string means switching an inductive loop, so long wiring to a distant LED needs the same care any switched load does.
Four details worth carrying
Reverse protection. LEDs stand only a few volts in reverse. Anywhere a reversal is possible, put an ordinary diode in parallel facing the other way, or one in series to block.
Choose the resistor for the worst rail, not the nominal one. A supply specified at 12 V that actually reaches higher pushes the current up in proportion to the excess divided by the headroom, which on a well-designed circuit is a small effect and on a badly designed one is not.
Watch the resistor's own rating. 121 mW here is comfortable in a quarter-watt part; scale the current up and the resistor becomes the part that runs hot.
Series strings fail open, and that matters. One LED failing open in a string takes the whole string out, which is either a useful failure indication or an unacceptable one depending on what the string is for. Long strings in lighting products often include a part that shorts out a failed LED for exactly that reason.
Common mistakes
- Feeding several LEDs in parallel from one resistor — a 0.20 V difference in forward voltage splits the current 98.0 % to 2.05 %, so one part is over-driven and the other barely lights.
- Using a resistor with almost no headroom — on a 3.3 V rail the part spread gives a 32.0 % current spread, against 4.02 % on a 12 V rail with the same LEDs.
- Ignoring the resistor's power rating — 121 mW needs a quarter-watt part, and scaling the current up makes the resistor the hot component rather than the LED.
- Dimming by reducing the current — the colour and efficiency both move, and the part spread reappears. Switching the LED fully on and off at a duty cycle avoids all of it.
- Leaving a series string without thinking about failure — one open LED takes out the whole string, which may or may not be acceptable but should never be a surprise.
Frequently asked questions
How do I calculate the resistor for an LED?
Subtract the LED's forward voltage from the supply and divide by the current you want. For a 2.05 V LED at 12 mA from 12 V that is 829 Ω, so an 820 Ω part is chosen and the actual current becomes 12.1 mA. Then check the resistor's dissipation and choose a rating for it.
Can I put two LEDs in parallel with one resistor?
Not reliably. Their forward voltages differ by a couple of hundred millivolts and the current depends exponentially on that, so one takes almost all of it. Either put them in series with one resistor, or give each its own resistor.
Why does the same LED circuit behave differently on 3.3 V and on 12 V?
Because the resistor's share of the supply is what makes the current insensitive to the LED. On 12 V the resistor drops about ten volts, so a 0.2 V change in the LED barely matters. On 3.3 V it drops just over a volt, and the same 0.2 V is a large fraction of it.
When do I need an LED driver instead of a resistor?
When the wasted power matters, when the supply voltage varies too much for a resistor to hold the current, or when the LED's forward voltage is close enough to the supply that there is no headroom left. Below about a tenth of a watt of waste a resistor is almost always the right answer.
What is the best way to dim an LED?
Switch it fully on and fully off at a duty cycle, rather than reducing its current. The LED keeps running at the current it was designed for whenever it is on, so its colour and efficiency do not shift, and the average is set entirely by the duty. A kilohertz or more is comfortably above the eye's response.