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.
SI prefixes accepted (4k7 / 1M / 10m / 220). Upper-case M = mega, lower-case m = milli
Advanced — Supply voltage max, Supply voltage min, Vf max and 2 more
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
Formula
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, yellow-green ≈ 2.1 V, true green, 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.
How to compare and check the example
Illustrative assumptions: 3mA nominal, approximately 2.43–3.63mA. Check the selected LED current rating.
Load the example above and save the current case as a baseline. Change one input, then save another case to compare inputs and outputs side by side. Share links contain input values; share only conditions you can disclose.
This simplified model reports 0mA forward current when supply voltage is at or below the specified Vf. It does not model nonlinear I–V behavior, reverse voltage or temperature-dependent Vf.
This worked example has been checked in both language versions. This is not a hardware measurement or a guarantee over all input ranges.
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
| Colour | Vf (typical) | Vf spread | Rated current | Commonly used |
|---|---|---|---|---|
| Red | 1.9 – 2.1 V | ±0.2 V | 20 mA | 2 – 10 mA |
| Yellow / amber | 2.0 – 2.2 V | ±0.2 V | 20 mA | 2 – 10 mA |
| Green (yellow-green) | 2.0 – 2.2 V | ±0.2 V | 20 mA | 2 – 10 mA |
| Green (pure green) | 3.0 – 3.4 V | ±0.3 V | 20 mA | 5 – 20 mA |
| Blue | 3.0 – 3.4 V | ±0.3 V | 20 mA | 5 – 20 mA |
| White | 3.0 – 3.5 V | ±0.3 V | 20 – 30 mA | 5 – 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
- Vcc = 5V, white LED Vf (typical) = 3.1V, target 12mA.
- The target resistance is 158.3 Ω. The nearest E24 value is 160 Ω. Suppose you have a 150 Ω part available and want to check it.
- Entering Vcc = 5, Vf = 3.1, R = 150 gives 12.67mA nominal.
- 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.
- 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.
- Maximum resistor dissipation is (5.25 − 2.9)² / 142.5 ≈ 38.8 mW. Compare it with the power rating at operating temperature.
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?
Can I drive a white LED from 3.3V?
How do I calculate for LEDs in series?
Does lower current extend life?
How do I choose the resistor power rating?
Standards and references
- IEC 62031 — Safety specification for LED modules.
- IEC 60810 — Performance requirements for LED light sources.
Last updated: 2026-11-16
Apply this calculation to your design
-
Setting an LED's current-limiting resistor with variation included
Select an LED resistor from both minimum required and maximum permitted current. A single calculation with typical forward voltage is insufficient.