100nF

LED series resistor

The resistor that sets an LED string's current, the standard value to fit, what it dissipates, and how far the current wanders once the supply, the LED and the resistor are all at the wrong end of their tolerances.

5 V150 Ω20.0 mA →1 × 2 V
Fig 1 — 1 LED at 2 V, 20.0 mA through 150 Ω.
Exact resistor
150 Ω
E24 value at or above
150 Ω
Current with 150 Ω
20.0 mA
Headroom across R
3.00 V
Resistor power
60.0 mW → any 0603 or larger
LED power / efficiency
40.0 mW · 40 %
Worst case, ±5 % supply, ±0.2 V Vf, ±1 % R
16.8 to 23.2 mA

What it computes

A resistor in series with one or more LEDs on a fixed supply. The LED drops roughly Vf regardless of current, so the rest of the supply sits across the resistor, and that sets the current.

R  = (Vs − n · Vf) / If         n LEDs in series, If the design current
I  = (Vs − n · Vf) / R_fitted   current once you pick a stock value
P_R   = I² · R                  resistor dissipation
P_LED = I · n · Vf              light plus heat in the diodes
η     = P_LED / (P_R + P_LED)   share of the power that reaches the LEDs

The quantity to watch is the headroom, Vs − n·Vf. With 3 V of headroom a 0.3 V shift in Vf moves the current 10 %; with 0.5 V it moves it 60 %. So the tool also stacks supply, Vf and resistor tolerances the wrong way and reports the current range you will see across a batch of boards.

Vf depends on the chemistry, not the package. Typical values at 20 mA:

ColourVf
Infrared1.2 to 1.6 V
Red, orange, yellow1.8 to 2.2 V
Green (GaP, yellowish)2.0 to 2.4 V
Green (InGaN, pure), blue, white2.8 to 3.4 V
UV3.2 to 3.8 V

Datasheets give Vf as min, typ and max at the test current, and vendors sell by Vf bin, so two reels of the same part number can differ by 0.4 V. Vf also drops about 2 mV/°C, so a warm LED pulls more current; not runaway with a resistor, but a visible drift when the headroom is small.

Worked example

A red indicator on a 5 V rail, Vf 2.0 V, 20 mA.

headroom = 5.0 − 1 × 2.0        = 3.0 V
R        = 3.0 / 0.020          = 150 Ω        E24 value, fit it as is
I        = 3.0 / 150            = 20.0 mA
P_R      = 0.020² × 150         = 60 mW        a 0603 (100 mW) is fine, 0402 (63 mW) is marginal
P_LED    = 0.020 × 2.0          = 40 mW
η        = 40 / (60 + 40)       = 40 %

Now the tolerances: a 5 % regulator, ±0.2 V of Vf spread from the bin, a 1 % resistor.

min:  Vs = 4.75 V, Vf = 2.2 V, R = 151.5 Ω
      I = (4.75 − 2.2) / 151.5 = 2.55 / 151.5 = 16.8 mA

max:  Vs = 5.25 V, Vf = 1.8 V, R = 148.5 Ω
      I = (5.25 − 1.8) / 148.5 = 3.45 / 148.5 = 23.2 mA

A 20 mA design lands between 16.8 and 23.2 mA, about ±16 %. Fine for an indicator. Put the same LED on 3.3 V and the headroom is 1.3 V: fit 68 Ω and the same tolerances give 13.6 to 24.7 mA, a 1.8:1 spread. The 1 % resistor is not the problem; 0.4 V of Vf spread against 1.3 V of headroom is.

Where it stops being valid

The model. An LED is a diode with an exponential I-V curve, not a fixed drop. Constant Vf is accurate near the datasheet test current and worse away from it: a red LED at 2 mA reads 1.7 V, a power white at 100 mA may be 3.6 V. Take Vf from the curve at your current.

Driving from a GPIO. A microcontroller pin has tens of ohms of output resistance and a rated drive, typically 4 to 20 mA per pin with a budget per port and per device (STM32: 8 mA typ, 25 mA abs max, 120 mA for the chip; AVR: 20 mA per pin, 200 mA total). At 20 mA the pin has sagged a few hundred millivolts, so the headroom and the current are less than the calculator says. Use 2 to 5 mA for indicators, or a transistor.

PWM. The resistor sets the peak current; the duty cycle sets the average. 20 mA peak at 25 % duty is 5 mA average and the resistor power scales the same way. Keep the peak under the pulsed rating and the frequency above a few hundred hertz.

Parallel LEDs on one resistor. The one with the lowest Vf takes the most current, gets hottest, drops further, takes more. Two identical LEDs can split 40 mA as 25 and 15, and if one fails open the other gets the lot. One resistor per LED.

12 V strings. Three white LEDs at 3.2 V leave 2.4 V of headroom, which is why LED strip runs three per segment. Four leave nothing. The tool refuses when n·Vf reaches the supply; treat under 1 V of headroom as a warning.

When to stop using a resistor. Above about 100 mA the resistor burns as much as the LED, and brightness matching across channels or temperature is at the mercy of Vf. A constant-current driver (a linear sink like the CAT4101, a buck like the AL8860) regulates current directly and, switching, runs above 90 %.

Common mistakes

Further reading