How to calculate an LED resistor
An LED's voltage stays close to its forward voltage whatever the current, so something else has to set the current. A series resistor drops the rest of the supply voltage at the target current.
- Resistor:
R = (Vs − n·Vf) / I - Resistor power:
P = I²·R - Efficiency:
η = n·Vf / Vs
Worked example: indicator LED on 5 V
A red LED with a 2.0 V forward voltage at 10 mA from 5 V needs exactly 300 Ω. Rounding up to the standard 330 Ω gives 9.1 mA, and the resistor dissipates 27 mW, so even a 1/16 W part is fine.
Good to know
- Round the resistor up, not to the nearest value, so the current never exceeds the target.
- Give each string its own resistor. LEDs in parallel on one resistor don't share current evenly, and the brightest one overheats.
- Blue and white LEDs need about 3 V, which leaves almost no headroom on a 3.3 V supply. Small changes in forward voltage then change the brightness a lot.
- Pro adds the current range across supply tolerance and lays out strings for a whole array.