A red LED and a 5 V supply
You want 20 mA and assume a 2 V LED drop. That leaves 3 V across the resistor. Dividing 3 V by 0.020 A gives 150 Ω. This is already an E12 value, so no rounding is needed.
The resistor dissipates 0.060 W. A 0.125 W rating is more than twice that dissipation in this example; also check the manufacturer’s temperature-derating requirements.
From the remaining voltage to resistance
Pr = I² × R = (Vs − Vf) × I
Ireal = (Vs − Vf) / Rcomercial
The tool selects the first E12 value equal to or above the calculated resistance, avoiding a nominal current increase caused by rounding down. E12 uses 1, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8 and 8.2 times a power of ten.
What this model represents
One LED, one series resistor and an ideal DC supply. Vf is held constant, though a real LED’s forward voltage varies with current and temperature. Tolerances, heating and the driving pin’s limits are not modeled.
The suggested commercial value does not guarantee a real maximum current. Check the LED data sheet and supply range. Do not extend this circuit to power LEDs without analyzing current control and heat dissipation. Diagram color identifies the component; it does not measure brightness.
Common mistakes
- Entering 20 A instead of 20 mA: a thousand times more current.
- Using Vs instead of Vs − Vf: the resistor does not receive the entire supply voltage.
- Connecting parallel LEDs through one shared resistor does not guarantee equal currents.
- Choosing a power rating below the calculated dissipation.
Try it yourself
3.3 V, Vf = 2 V and 10 mA: which E12 value would you use?
R = 1.3 / 0.010 = 130 Ω. The next E12 value is 150 Ω, giving 8.667 mA and about 11.27 mW dissipation.
What happens if Vs = Vf?
No voltage remains across a positive current-limiting resistor. This model cannot set the requested current; increase Vs or review Vf.