LED circuit design

Design a circuit made of a supply, an LED and a resistor. Real parts vary in resistance and in Vf, so the LED current varies with them.

Diagram: LED circuit design
V
V
Ω

SI prefixes accepted (4k7 / 1M / 10m / 220). Upper-case M = mega, lower-case m = milli

LED current
0.638mA
LED current max0.896 mA
LED current min0.304 mA
Advanced — Supply voltage max, Supply voltage min, Vf max and 2 more
V
V
V
V
%

Derived values

Resistor dissipation
1.91 mW
Worst case 3.77 mW
LED dissipation
1.28 mW
Vf × I
Total dissipation
3.19 mW
Vcc × I
Voltage across R
3 V
Vcc − Vf

Worst case 3.77 mW. With 50% derating you need a 7.55 mW rating or better, so a 1/16W (1005 / 0402) chip resistor is enough.

History
Press Enter in any field to keep a snapshot here.

Formula

LED current: I[mA] = (Vcc − Vf) × 1000 / R[Ω]
Resistor needed: R = (Vcc − Vf) / I_target × 1000 [Ω]

Design notes

An LED is a current-driven device. A series resistor R sets the current through it. Too small and the LED dies of overcurrent; too large and it is dim.

Design notes:
• Rated current: around 20 mA for a general-purpose LED, 20–30 mA for high-brightness and white parts
• Forward voltage: red ≈ 2.0 V, green ≈ 2.1 V, blue and white ≈ 3.0–3.5 V
• For production, budget for ±5% on the resistor, the spread in Vf and the supply tolerance together
• Check the worst case so peak current never exceeds the rating

When you need this

For choosing the current-limiting resistor on an indicator LED. Not just "what value" — the point is how far the current actually swings once supply variation, Vf spread and resistor tolerance are all included. Inconsistent brightness in production, or LEDs run past their rating, almost always trace back to skipping this.

LEDs are current-driven

An LED is not driven by voltage; brightness follows current. Worse, current rises very steeply once you pass the forward voltage Vf, so connecting one straight to a voltage source destroys it. A series resistor sets the current.

The resistor sees Vcc − Vf. The smaller that difference, the more the spread dominates. Driving a white LED with Vf = 3.1V from 5V leaves just 1.9V across the resistor, so a 0.2V shift in Vf changes the current by over 10%.

Vf and current rating by colour

Typical indicator LEDs. Always confirm against the datasheet.
ColourVf (typical)Vf spreadRated currentCommonly used
Red1.9 – 2.1 V±0.2 V20 mA2 – 10 mA
Yellow / amber2.0 – 2.2 V±0.2 V20 mA2 – 10 mA
Green (yellow-green)2.0 – 2.2 V±0.2 V20 mA2 – 10 mA
Green (pure green)3.0 – 3.4 V±0.3 V20 mA5 – 20 mA
Blue3.0 – 3.4 V±0.3 V20 mA5 – 20 mA
White3.0 – 3.5 V±0.3 V20 – 30 mA5 – 20 mA

Modern indicator LEDs are efficient enough that you rarely need the full 20mA. 1–5mA is usually bright enough, often too bright. Lower current also eases dissipation, heating and the resistor rating.

Worked example: a white LED at about 10mA from 5V

  1. Vcc = 5V, white LED Vf (typical) = 3.1V, target 12mA.
  2. R = (5 − 3.1) / 0.012 = 158Ω. The nearest E24 value is 150Ω.
  3. Entering Vcc = 5, Vf = 3.1, R = 150 gives 12.67mA nominal.
  4. Set Vcc to ±5% (4.75–5.25V), Vf to 2.9–3.4V and resistor tolerance to ±5%, and the current swings from 8.57mA to 16.49mA.
  5. The 16.5mA maximum is within the 20mA rating, so it is safe. But 8.6mA versus 16.5mA is nearly a factor of two in brightness. If several LEDs must match, use ±1% resistors or run at lower current.
  6. Resistor dissipation is 16.5mA² × 150Ω = 41mW, so a 1/10W 0603 part is sufficient.

What matters

  • Keep Vcc − Vf large. The bigger it is, the less Vf spread matters. Trying to drive a Vf = 3.1V white LED from 3.3V leaves only 0.2V and the current is uncontrollable. Boost the supply or use a constant-current driver.
  • Check port current limits when driving from a microcontroller. Even at 8mA per pin, there is almost always a separate limit per port group and per supply pin. Driving several LEDs directly exceeds it easily.
  • Never parallel LEDs on one resistor. Current concentrates in the lower-Vf device: one is brighter and dies sooner. Give each its own resistor, or put them in series.
  • With PWM dimming, watch peak current. The rating applies to the peak, not the average. Some LEDs specify a separate pulsed rating.

Frequently asked questions

Does the resistor go before or after the LED?
Electrically it makes no difference — it is a series circuit, so the same current flows. Choose based on layout, though placing it on the cathode side often fits a microcontroller sinking configuration more naturally.
Can I drive a white LED from 3.3V?
Only marginally. White Vf is 3.0–3.5V, so at 3.3V some devices will not light at all. Use a boost converter, or switch to a lower-Vf colour such as red or yellow-green. Binned parts with a guaranteed Vf ceiling exist but cost more.
How do I calculate for LEDs in series?
Add the forward voltages and enter the total as Vf — two red LEDs in series is Vf = 4.0V. Note that the spread adds too, so you need more headroom against Vcc.
Does lower current extend life?
Yes. LED degradation is driven mainly by junction temperature, so reducing current and therefore heating slows the loss of luminous flux. Running at half the rating or less is a common design guideline.
How do I choose the resistor power rating?
Take the worst-case current squared times the resistance, then allow at least a factor of two. The calculator's supplementary output shows the required rating and a suggested size. Note that chip resistor ratings are usually specified at 70°C ambient and derate inside a sealed enclosure.

Standards and references

  • IEC 62031 — Safety specification for LED modules.
  • IEC 60810 — Performance requirements for LED light sources.

Last updated: 2026-08-29