TechForLive

LED Resistor & Ohm's Law Calculator

Find the resistor an LED needs on 3.3 V or 5 V boards, with the nearest standard E12 value and the power it will dissipate.

Arduino Uno pins: 5 V · Raspberry Pi GPIO: 3.3 V
Most 5 mm LEDs: 10–20 mA. Check the datasheet.
Use a resistor of at least–
–Exact value
–Power in resistor
–Actual current with E12 part

Ohm's law in one line

The resistor drops whatever voltage the LEDs do not use: R = (Vsupply − Vled × count) ÷ I. With 5 V, a red LED (2 V) and 15 mA, that is 3 V ÷ 0.015 A = 200 Ω. Standard resistors come in fixed steps, so we round up to the next E12 value, which keeps the current slightly lower and safer.

Power in the resistor is V × I. Ordinary 1/4 W (0.25 W) through-hole resistors are fine for single LEDs; if the result gets close to 0.25 W, use a 1/2 W part.

Raspberry Pi GPIO pins are 3.3 V and not designed for heavy loads; keep LED current modest there and drive anything bigger through a transistor.