LEDs and Current Limiting: the short answer
LEDs must typically be current limited. A suitable series resistor is calculated from supply voltage minus LED forward voltage, divided by target current. Example: Use 220 to 330 Ω. The LED is bright and the pin stays well under its 20 mA comfort limit.
- Level
- Beginner
- Time
- About 5 min
- Topic
- Semiconductors
Size a series resistor so an LED gets a safe current, and wire it the right way round.
Before this: Voltage, Current & Resistance
LEDs must typically be current limited. A suitable series resistor is calculated from supply voltage minus LED forward voltage, divided by target current.
Start with the proposed supply, LED forward-voltage range and desired forward current. Compute R for a realistic supply and then calculate P = I²R. Choose the exact resistor after checking the LED and controller output limits.
A 5 V supply and approximate 2 V forward drop at 10 mA imply about 300 Ω ideal resistance. Component variation, brightness and temperature alter outcomes; a single resistor calculation does not validate a high-power LED design.
Why an LED needs a resistor at all
An LED is a diode. Below its forward voltage almost no current flows; just above it, the current rises very steeply. A tiny change in supply or temperature turns into a large change in current. Connect a red LED straight to 5 V and the current is limited only by the wiring and the pin, which means it burns out the LED, the pin or both.
The resistor turns that steep curve into a gentle one. Most of the extra voltage drops across the resistor, so the current is set by the resistor, not by the LED's mood.
Forward voltage depends on colour
Typical forward voltages at 10 to 20 mA: red and yellow about 1.8 to 2.2 V, green 2.0 to 3.2 V (older yellow-green is low, modern bright green is high), blue and white about 2.8 to 3.4 V. These are ranges, so use the listing or datasheet value when you have it, and the higher end when you don't, so the current comes out a little lower rather than higher.
On a 3.3 V board this matters. A white LED at 3.1 V leaves only 0.2 V for the resistor, so the current swings a lot as the supply varies. Drive it from 5 V through a transistor instead.
How much current is enough
Standard 5 mm indicator LEDs are rated about 20 mA, but modern LEDs are bright at 2 to 5 mA. Running lower saves battery, keeps pins well inside their limits and avoids glare. 10 mA is a sensible default for a status light; drop to 2 mA for something that sits next to your bed.
Brightness is roughly proportional to current, but your eye is not linear, so halving the current looks only a little dimmer.
Several LEDs
Give each LED its own resistor when they are in parallel. LEDs from the same bag still have slightly different forward voltages, so if they share one resistor the lowest one hogs the current and fails first, then the next.
In series, the forward voltages add: three red LEDs need about 6 V before any current flows, so they cannot run from 5 V. From 12 V, three in series with one resistor is efficient: (12 − 3 × 2) ÷ 0.01 = 600 Ω, so use 620 Ω.
Polarity
The longer leg is the anode (+). The flat edge on the rim and the larger piece inside the bulb mark the cathode (−). Backwards, an LED simply stays dark, but its reverse voltage limit is only about 5 V, so do not leave it backwards on a higher-voltage supply.
- Sharing one resistor between LEDs wired in parallel.
- Using 20 mA by habit when 5 mA would do, then running out of pin current budget on a board with many LEDs.
- Driving a high-power LED (1 W and up) with only a resistor. These need a constant-current driver and a heatsink.
- R = (Vs − Vf) ÷ I
- series resistor
- P = (Vs − Vf) × I
- heat in the resistor
LED current against supply voltage
Work it with your own numbers: LED resistor
Pick a resistor for a red LED on a 5 V Arduino pin
- Supply 5 V, red LED drop about 2.0 V, target 10 mA.
- Voltage across the resistor: 5 − 2 = 3 V.
- R = 3 V ÷ 0.010 A = 300 Ω.
- Next standard value up: 330 Ω (220 Ω gives about 14 mA, also fine).
Result. Use 220 to 330 Ω. The LED is bright and the pin stays well under its 20 mA comfort limit.
Try the LED resistor calculator for a 5 V source, 2 V LED and 10 mA current.
3 quick questions
5 V supply, red LED with about 2 V forward voltage, target 10 mA. Which resistor?
Why does an LED need a series resistor?
On a new 5 mm LED, the longer leg is usually the…
