LEDs and Current Limiting

ReviewedBeginnerFreeAbout 5 min
In short

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
You will learn to

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.

Common mistakes
  • 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.
Key formulas
R = (Vs − Vf) ÷ I
series resistor
P = (Vs − Vf) × I
heat in the resistor
Try it: LED current against supply

LED current against supply voltage

0 A10 mA20 mA30 mA0 V5 V10 VSupply9.09 mA

Once the supply passes the LED's forward voltage, the resistor sets the current.

I = (Vs − Vf) ÷ R = 9.09 mA

Current against supply. Below Vf almost no current flows; above it each extra volt adds 1 ÷ R amps.

Work it with your own numbers: LED resistor

Worked example

Pick a resistor for a red LED on a 5 V Arduino pin

  1. Supply 5 V, red LED drop about 2.0 V, target 10 mA.
  2. Voltage across the resistor: 5 − 2 = 3 V.
  3. R = 3 V ÷ 0.010 A = 300 Ω.
  4. 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 it

Try the LED resistor calculator for a 5 V source, 2 V LED and 10 mA current.

Check yourself

3 quick questions

  1. 5 V supply, red LED with about 2 V forward voltage, target 10 mA. Which resistor?

  2. Why does an LED need a series resistor?

  3. On a new 5 mm LED, the longer leg is usually the…

Common questions

What will I learn in "LEDs and Current Limiting"?

Size a series resistor so an LED gets a safe current, and wire it the right way round.

How do I 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). Use 220 to 330 Ω. The LED is bright and the pin stays well under its 20 mA comfort limit.

5 V supply, red LED with about 2 V forward voltage, target 10 mA. Which resistor?

300 Ω (use 330 Ω). R = (5 − 2) ÷ 0.010 = 300 Ω. The nearest common value above it is 330 Ω.

Why does an LED need a series resistor?

To limit its current. An LED's current rises very steeply above its forward voltage. The resistor sets the current.

On a new 5 mm LED, the longer leg is usually the…

Anode (+). The longer leg is the anode. The cathode side often has a flat edge on the rim.