What the calculator does
An LED sets its own voltage and needs something else to set its current; a resistor in series is the something else. The calculator subtracts the LED string's forward voltage from the supply, divides the rest by the current you want, and gives the exact resistance. Because you cannot buy 500 Ω, it then chooses a value from the E24 or E12 series, recalculates the current that value actually gives, works out the power the resistor must dissipate and recommends a rating with a safety factor of two.
Formula
Presistor = (Vsupply − n × Vf) × If = If² × R
Iactual = (Vsupply − n × Vf) ÷ Rstandard
PLEDs = n × Vf × Iactual
where n is the number of LEDs in series, Vf the forward voltage of each at the working current and If the current you want. The voltage left over after the LEDs, Vsupply − n × Vf, is the headroom: the more of it there is, the less the current changes when Vf or the supply varies.
Worked example
A red indicator LED (Vf 2.0 V) at 20 mA from a 12 V supply.
- R = (12 − 2.0) ÷ 0.020 = 500 Ω.
- The next E24 value up is 510 Ω, which gives (12 − 2.0) ÷ 510 = 19.6 mA, close enough and on the safe side. (Nearest would also be 510 Ω; 470 Ω would give 21.3 mA.)
- The resistor dissipates 10 V × 19.6 mA = 0.196 W. A ¼ W resistor would run at 78 % of its rating and get hot; the calculator recommends ½ W.
- The LED itself uses only 2.0 × 19.6 mA = 39 mW: five sixths of the power is burnt in the resistor, which is why a 12 V supply is a poor way to run one 2 V LED. Three white LEDs in series (3 × 3.2 V) from the same 12 V need only 120 Ω and waste far less.
Standard resistor values (decade multipliers apply)
| Series | Values |
|---|---|
| E12 (10 %) | 1.0 1.2 1.5 1.8 2.2 2.7 3.3 3.9 4.7 5.6 6.8 8.2 |
| E24 (5 %) | 1.0 1.1 1.2 1.3 1.5 1.6 1.8 2.0 2.2 2.4 2.7 3.0 3.3 3.6 3.9 4.3 4.7 5.1 5.6 6.2 6.8 7.5 8.2 9.1 |
Assumptions and limitations
- Forward voltage is a datasheet figure, not a constant. It varies between LEDs of the same part number by ±0.1–0.3 V, rises with current and falls with temperature. With little headroom the current swings a lot; the calculator warns when the headroom is under 20 % of the supply or under 1 V.
- Strings in parallel are not covered. Never put LEDs or strings in parallel behind one resistor; the one with the lowest Vf takes most of the current. Give each string its own resistor.
- Power rating uses a factor of two. Resistors are rated at 25 °C in free air; on a crowded board or in an enclosure derate further. For more than about 0.5 W consider a switching constant-current driver instead.
- Supply voltage is taken as exact. A "12 V" adapter may deliver 12.5 V unloaded and 11.5 V loaded; a lithium cell moves from 4.2 V to 3.0 V. Check the current at both extremes.
- Indicator and small signal LEDs only. Power LEDs above about 100 mA belong on a constant-current driver, not a resistor.
Frequently asked questions
Can I leave the resistor out if the supply voltage equals the LED voltage?
No. An LED's current rises exponentially with voltage, so a tiny excess destroys it and a tiny shortfall leaves it dark. Something must set the current: a resistor with adequate headroom, or a constant-current driver.
What forward voltage should I use for a white or blue LED?
3.0–3.4 V at 20 mA for most indicator types; 2.8–3.2 V for high-efficiency parts at a few milliamps. Read the datasheet's Vf at your current; the "typical" figure is for the stated test current only.
Why does the calculator recommend a bigger resistor wattage than the dissipation?
A resistor at its full rating runs very hot (film resistors are rated for a surface temperature rise of well over 100 °C). Choosing a rating of at least twice the dissipation keeps it cool, reliable and out of the way of neighbouring parts.
Can I dim the LED by changing the resistor?
Yes, a larger resistor gives less current and less light, but the relationship is not linear to the eye. For adjustable brightness use PWM from a microcontroller with the resistor sized for full current.
References
- IEC 60063:2015, Preferred number series for resistors and capacitors — E-series values
- IEC 60115-1:2020, Fixed resistors for use in electronic equipment — Generic specification — rated dissipation and derating
- Horowitz, P. and Hill, W., The Art of Electronics, 3rd ed., Cambridge University Press, 2015 — diode and LED behaviour, current limiting