The formula
R = (V_supply − V_forward) / I_forward
- V_supply
- supply rail voltage (volts)
- V_forward
- LED forward voltage drop, typically 1.8–3.4 V by colour
- I_forward
- desired LED current (amperes; usually 5–20 mA)
- R
- series resistor (ohms)
Worked example
A red LED (V_f = 2 V) at 20 mA on a 5 V supply.
- Voltage left for the resistor: 5 − 2 = 3 V
- R = 3 / 0.02 = 150 Ω
- Resistor power: P = 3 × 0.02 = 0.06 W — any ⅛ W part is fine
150 Ω, which is itself a standard E12 value.
Where you'll use it
The first circuit anyone builds, and still the one most often got wrong. The calculator refuses supply voltages at or below the forward voltage, because no resistor can fix that — you need a boost converter or fewer LEDs in series.