All Tools

LED Calculator

Logic & Formula

An LED needs a current-limiting resistor to prevent burnout. The resistor drops the excess voltage.

R = Vs − (Vf × n)If

Vs = source voltage, Vf = LED forward voltage, n = LEDs in series, If = desired current.

Quick Setup
LED Color
Source Voltage
?
Power supply voltage (5V for Arduino, 3.3V for ESP32, 9V/12V battery).
V
Forward Voltage
V
Forward Current
mA
LEDs in Series
255 (100%)
0 (OFF) 64 128 192 255 (MAX)
Calculated Resistance
150 Ω
Nearest E24: 150Ω
Power: 60mW
sketch.ino

          
RGB LED Basics

An RGB LED contains three separate dies (Red, Green, Blue) sharing a common pin. Each channel needs its own current-limiting resistor.

Common Cathode: shared GND pin, HIGH = ON.
Common Anode: shared V+ pin, LOW = ON (PWM inverted).

Typical Vf: Red ≈ 2.0V, Green ≈ 3.2V, Blue ≈ 3.2V

LED Type
Quick Setup
Source Voltage
V
Forward Current
mA
Color
Calculated Resistances
Red (Vf 2.0V)
150 Ω E24: 150Ω
Green (Vf 3.2V)
90 Ω E24: 91Ω
Blue (Vf 3.2V)
90 Ω E24: 91Ω
Total Power: 0mW
rgb_led.ino

          
#
R
G
B
Presets