ESP32 DevKit V1 (30-pin)
Espressif / generic · ESP32
- MHz
- 240
- GPIO
- 25
- Flash
- 4 MB
- RAM
- 520 KB
Calculator
Find the current-limiting resistor for any LED and supply voltage.
An LED will happily draw as much current as your supply can push through it — right up until it burns out. A series resistor limits that current. This calculator works out the resistor value from the supply voltage, the LED's forward voltage and the current you want, then rounds up to a standard E12 value you can actually buy.
Typical forward voltages are about 1.8–2.2 V for red, 2.0–2.2 V for yellow/green, and 3.0–3.4 V for blue, white and true-green LEDs. For microcontrollers, 5–10 mA is usually bright enough and keeps the pin well inside its limits (ESP32 and Pico pins are happiest at under 12 mA).
R = (Vs − n × Vf) / IP = I² × R (use at least 2× margin)Worked example. 5 V supply, red LED (Vf = 2.0 V), 20 mA: R = (5 − 2.0) / 0.020 = 150 Ω. The nearest standard value at or above is 150 Ω (E12: 150 Ω).
A slightly larger resistor gives slightly less current, which is the safe direction. Rounding down would push the LED above your target current.
Most standard 5 mm LEDs are rated for 20 mA continuous, but they are already bright at 5–10 mA. Choosing less extends life and is easier on microcontroller pins.
Yes — in series, as long as the supply voltage is higher than the sum of all forward voltages. Enter the number of LEDs in series. For parallel LEDs, give each its own resistor, because small differences in Vf make one LED hog the current.
No. Those LEDs have built-in constant-current drivers. A small series resistor (about 330 Ω) on the data line is good practice, though.
Free download
Logic levels, pins to avoid, I2C / SPI / UART basics and a quick-pick table of the best boards — on one printable PDF. Enter your email and it's yours.
Only used to send the sheet and the odd databit.me update. See the privacy policy.