Sensors and analog
LED series resistor
Find the series resistor for an LED or a series string, the nearest standard value you can actually buy, and the current you end up with once that part is fitted.
Per LED. Use the datasheet figure if you have it.
10 mA is bright enough for an indicator. 20 mA is a typical maximum.
One resistor sets the current for the whole string.
Typical forward voltages
Blue and white sit at the same voltage because a white LED is a blue die with a phosphor over it.
Use this resistor
300 Ω
The exact value is 300 Ω, which is not a part you can buy. The nearest E24 value above it gives 10 mA.
Actual current
10mA
Exact value
300 Ω
Across the resistor
3V
Resistor dissipates
30 mW
Package rating
1/16 W
Max in series
2
Why this matters
An LED is a diode, not a resistor: past its forward voltage the current climbs almost vertically for a tiny change in voltage, so nothing but the series resistor is limiting it. Fitting an LED with no resistor works for a few seconds and then does not. The subtler failure is driving one straight from a microcontroller pin at a current the pin is not built to source, which does not kill the LED, it slowly damages the output driver in the chip and produces a board that develops a dead pin weeks later.
Assumptions and sources
- Forward voltage is a typical figure for the colour and rises with current and falls with temperature. The datasheet figure for the part you have is better than the preset.
- The supply is stiff and holds its voltage under the LED current.
- The nearest standard value is rounded up to the next E24 value, never down. Rounding down raises the current past the figure you asked for.
- The suggested resistor package runs at half its rating or better, which is the usual derating margin for a part that will sit at temperature indefinitely.
- Per pin GPIO limits are the usual working figures: around 12 mA for RP2040 and RP2350, around 20 mA for ESP32. Both chips also have a total budget across all pins that is lower than the per pin figure times the pin count.