LED resistor

Resistance, standard value and resistor power.

Resistor from the E12 series

Ω150 Ω

Exact from the formula
150 Ω
Current with this resistor
20 mA
Power in the resistor
0.06 W
Which one to take
0.125 W: SMD 0805 or a small through-hole

The next higher standard value is used: the current comes out slightly below the target, which is easier on the LED.

+5 Vsupply150 Ωacross it 3 V, 0.06 W2 VLED20 mA

Bands 150 Ω: brown,green,brown,gold

How the resistor is calculated

The resistor drops the difference between the supply voltage and the LEDs' forward voltage: R = (Vsupply − Vled × n) / I, where n is the number of LEDs in series and I is the current in amps. The forward voltage by color in the list is typical for 5 mm LEDs at 20 mA; the exact value is in the LED's datasheet.

The calculator takes the nearest value from the E12 or E24 series that is not below the calculated one, so the current comes out slightly below the one you set. Power P = I² × R is calculated for that value, and you pick a resistor with a 2x power margin.

Examples

  • A red LED from 12 V at 20 mA: (12 − 2.0) / 0.02 = 500 Ω, which gives 560 Ω from the E12 series. The current with it is 17.9 mA, the resistor dissipates 0.18 W, so you need a 0.5 W resistor.
  • Three white LEDs in a car: the sum of the forward voltages is 3 × 3.1 = 9.3 V. At 14.4 V and 20 mA you need 255 Ω, and from E12 you take 270 Ω. With the engine off and 12 V, the current with it drops to 10 mA.

Common mistakes

  • People use one resistor for several LEDs connected in parallel. Forward voltage differs from LED to LED even within one batch, and the LED with the lower voltage gets the larger current.
  • People run a blue or white LED from 3.3 V through a resistor. With a forward voltage of 3.1 V, only 0.2 V is left across the resistor, and the current depends on the spread of the forward voltage more than on the resistor value.

FAQ

What resistor does an LED need on 12 V and in a car?
For a red LED at 20 mA from 12 V you need a 560 Ω resistor rated 0.5 W. In a car with the engine running the on-board voltage is usually 13.8-14.2 V, and you calculate the resistor for 14.4 V: 680 Ω, with a current of 18.2 mA at 14.4 V and 14.7 mA at 12 V.
What resistor should I put on an LED driven from an Arduino or ESP32 pin?
According to the ATmega328P datasheet (Arduino Uno and Nano) the absolute maximum current per pin is 40 mA, and the output voltage is specified at 20 mA: not below 4.2 V with a 5 V supply. For a red LED at 10 mA from 5 V, 330 Ω works; with a 220 Ω resistor the current is about 13.6 mA. On an ESP32 the datasheet says a pin sources 40 mA only at maximum drive strength; for a red LED at 10 mA from 3.3 V you get 150 Ω.
Can I connect an LED without a resistor?
No. An LED's current rises sharply with a small increase in forward voltage, and without a resistor it is limited only by the resistance of the source and the wires. From 5 V or from a microcontroller pin, that current exceeds what the LED or the pin can take. Without an external resistor, use LEDs with a built-in resistor or a current driver.
What power rating should the resistor have?
P = I² × R for the chosen value, and you take a resistor with a 2x margin. For 560 Ω at 17.9 mA that is 0.18 W, so a 0.5 W resistor.
Can I connect an LED to 220 V through a resistor?
No, it's dangerous even with a resistor. The resistor dissipates several watts and gets very hot, and the whole circuit is at mains voltage, which you must not touch. On the reverse half-cycle the LED sees the mains peak of about 325 V, while the reverse voltage of indicator LEDs in datasheets is 5 V. For mains, use a ready-made LED driver or a 230 V lamp.
How do I calculate several LEDs in series?
Add up the LEDs' forward voltages and enter the sum in the "Forward voltage" field; there is no separate field for their number. The less voltage is left across the resistor, the more the current depends on the spread between LEDs and on the supply.

You might also need