Calculator of Alexandria

LED resistor calculator

Find the series resistor value and power rating for one or more LEDs, rounded up to a standard E12 resistor.

Roughly 2 V for red, yellow and green, 3 V for blue and white. Check the datasheet.

Most standard 5 mm LEDs are rated for 20 mA.

Resistor (Ω)RR
Nearest standard value above (Ω)
Resistor power (W)PP
Current with standard resistor (mA)

Formula

R=Vs−k VfIR = \frac{V_s - k\,V_f}{I}
How it's derived

The formula

R=Vs−k VfIR = \frac{V_s - k\,V_f}{I} P=I2RP = I^2 R

VsV_s is the supply voltage, VfV_f the LED’s forward voltage, kk the number of LEDs in series, II the LED current and PP the power the resistor turns into heat.

Where it comes from

An LED isn’t like a light bulb. Once the voltage across it reaches its forward voltage, its current shoots up with almost no extra voltage. Connected straight to a battery, it would draw as much current as the battery can supply and burn out. A series resistor sets the current.

In a series circuit the supply voltage is shared. Each LED takes its forward voltage VfV_f, and the resistor takes the rest:

VR=Vs−k VfV_R = V_s - k\,V_f

The resistor and the LEDs carry the same current, so Ohm’s law, V=IRV = IR, gives the resistance that allows exactly current II:

R=VRI=Vs−k VfIR = \frac{V_R}{I} = \frac{V_s - k\,V_f}{I}

Resistors come in standard values, so the calculator rounds up to the next E12 value. A slightly larger resistor gives slightly less current, which is the safe direction.

Worked example

A red LED (Vf=2V_f = 2 V) at 15 mA from a 5 V supply:

R=5−20.015=200 ΩR = \frac{5 - 2}{0.015} = 200\ \Omega

The next standard value is 220 Ω, which gives 3/220=13.63/220 = 13.6 mA. The resistor dissipates 0.01362×220=0.0410.0136^2 \times 220 = 0.041 W, well within a common ¼ W resistor.

Watch out for

  • Forward voltage varies. It depends on color and on the specific part, from about 1.8 V (red) to 3.3 V (blue, white). Check the datasheet.
  • Don’t share one resistor between parallel LEDs. Small differences in VfV_f let one LED hog the current. Give each parallel branch its own resistor.
  • Power rating. Pick a resistor rated at about twice the calculated power.

Sources

  • IEC 60063, Preferred number series for resistors and capacitors (E series)

Last checked