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.
The rail feeding the string. Use the value it really sits at under load — a USB port is specified down to 4.4 V, not 5 V.
Forward voltage at the current below, from the datasheet curve rather than the headline number. Roughly 1.8–2.2 V for red, 3.0–3.4 V for blue, green and white.
Design current. 2–5 mA is plenty for a modern indicator; 20 mA is the old default and mostly wastes power and dazzles people.
LEDs in series share one current and add their forward voltages. Never put them in parallel on one resistor — the lowest-Vf part hogs the current.
Leave at 0 to get the nearest E24 value picked for you, or enter a resistor you already have to see what current it actually gives.
How far the rail can drift. The resistor drops the difference, so a small tolerance on a supply that barely exceeds Vf turns into a large swing in current.
Part-to-part spread in forward voltage, ±0.1–0.3 V for one bin. It is the main reason two LEDs from the same reel look different brightnesses.
Resistor tolerance, 1 % or 5 % for ordinary chip parts. It matters least of the three — the headroom across the resistor dominates.
- 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 LEDsThe 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:
| Colour | Vf |
|---|---|
| Infrared | 1.2 to 1.6 V |
| Red, orange, yellow | 1.8 to 2.2 V |
| Green (GaP, yellowish) | 2.0 to 2.4 V |
| Green (InGaN, pure), blue, white | 2.8 to 3.4 V |
| UV | 3.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 mAA 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
- Using typ Vf and no tolerance, then wondering why three boards from one batch have three brightnesses.
- Forgetting P = I²R. 60 mW in a 63 mW 0402 at 85 °C is over its derating curve.
- Taking 20 mA from an MCU pin because the LED is rated for it. The pin sags, the total port budget goes, and the LED is far brighter than an indicator needs to be.
- Running blue or white LEDs from 3.3 V with a small resistor. The headroom is 0 to 0.5 V, the current is whatever the Vf bin happens to be, and a low-bin part may not light at all.
- Sharing one resistor between parallel LEDs to save a part.
Further reading
- ams-OSRAM application notes — Vf vs temperature and current curves, and the binning scheme that produces the spread.
- TI SLVA451A, Step-down LED driver with dimming — a switching constant-current driver, and the efficiency and dimming arguments that push you off a series resistor.
- STM32F103 datasheet, absolute maximum ratings — the per-pin and per-device current limits that a GPIO-driven LED has to live inside.