Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

LED resistor calculator

Supply voltage, LED colour and current in — the standard resistor to buy and its power rating out.

Presets
V
mA
Round up to a standard E12 value
220 Ω

How it works

The resistor drops whatever voltage the LED doesn't need, and that drop sets the current (Ohm's law):

R = (Vsupply − Vf) ÷ ILED    P = (Vsupply − Vf) × I

We round up to the next E12 value (10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82 × 10ⁿ), so the real current is a little lower than you asked for — never higher. The result shows that real current.

Caveats

  • Forward voltage varies by maker and current; check the LED's datasheet if you need accuracy.
  • On a 3.3 V pin, blue and white LEDs (≈3.1 V) leave almost no headroom — they'll be dim and uneven. Use a red/green LED, or drive them from 5 V through a transistor.
  • ESP32 GPIOs are rated 40 mA absolute maximum, with about 20 mA recommended; the whole chip has a total limit too. Treat 8–15 mA per LED as comfortable.

↑↓ to move · Enter to open