Understanding the LED resistor calculator — concept and principle
An LED must not be connected straight to a voltage source: its current rises steeply with a small increase in voltage and it can burn out in an instant. This calculator finds the series resistor that sets the LED current, rounds it up to the next standard E12 value, and shows how much power the resistor dissipates. It covers one LED or a string of identical LEDs in series.
How it is calculated
- Resistor: R = (V_s − n · V_f) / I_f, with I_f converted from mA to A.
- Nearest E12 above: the next value in the series 1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2 (times a power of ten).
- Resistor power: P = (V_s − n · V_f) × I_f, in mW when I_f is in mA.
V_s is the supply voltage, V_f the forward voltage of one LED, n the number of LEDs in series. If the supply is not higher than n · V_f, no resistor can work and the calculator reports that the supply is too low.
The principle
An LED behaves roughly like a fixed voltage drop once it conducts. Kirchhoff's voltage law says the supply voltage is shared between the LEDs and the resistor, so the resistor takes whatever is left: V_s − n·V_f. Ohm's law then sets the current through that leftover voltage. Rounding up to the next standard value slightly lowers the current, which is the safe direction. A larger headroom voltage also makes the current less sensitive to V_f variation.
Worked example
- Voltage across the resistor: 5 − 1 × 2.0 = 3.0 V.
- Current: 20 mA = 0.020 A.
- R = 3.0 / 0.020 = 150 Ω.
- 150 Ω is itself an E12 value, so the nearest E12 above is 150 Ω.
- Power: 3.0 V × 20 mA = 60 mW; a 1/8 W (125 mW) or 1/4 W resistor is suitable.
| LED current (mA) | Resistor (Ω) |
|---|---|
| 5 | 600 |
| 10 | 300 |
| 15 | 200 |
| 20 | 150 |
| 25 | 120 |
| 30 | 100 |
| 40 | 75 |
How to read the result
Typical forward voltages are about 1.8 to 2.2 V for red, yellow and orange LEDs and about 2.8 to 3.4 V for blue, white and true-green LEDs, but always check the datasheet. Many small indicator LEDs are rated for 20 mA, yet they are often bright enough at 2 to 10 mA. Choose a resistor rated for at least twice the calculated power so it runs cool.
Common mistakes
- Using one resistor for several LEDs in parallel; small V_f differences let one LED hog the current.
- Putting too many LEDs in series so headroom is tiny; the current then varies widely with supply and temperature.
- Rounding the resistor down, which raises the current above the target.
- Forgetting that a USB or battery supply voltage varies with load and charge level.
Frequently asked questions
What resistor do I need for an LED on 12 V?
For one 2 V LED at 20 mA: (12 − 2) / 0.02 = 500 Ω, so 560 Ω from the E12 series; the current becomes about 17.9 mA and the resistor dissipates about 0.18 W.
Can I connect an LED to 3.3 V without a resistor?
It is not recommended; even small supply differences above V_f cause large current changes.
Sources: Horowitz and Hill, The Art of Electronics, 3rd edition, Cambridge University Press · IEC 60063, Preferred number series for resistors and capacitors