Skip to main content

How to Choose the Right Resistor for Any LED Circuit

10 min read
Electricaltags.ledResistorsReferenceEngineering

How to Choose the Right Resistor for Any LED Circuit

A red LED rated at 20 mA and 2.0 V forward drop, connected to a 5 V Arduino pin with no resistor, draws over 200 mA in the first few milliseconds. The junction temperature spikes past 150 °C, the bond wire fuses, and the LED goes dark. Total elapsed time from power-on to failure: under one second. The fix costs less than a cent: a 150 ohm resistor in series.

The resistor works by absorbing the voltage difference between the supply and the LED's forward drop, converting it to heat. The current through the loop is set entirely by that resistor's value. Get it right once and the LED runs cool for 50,000 hours. Get it wrong and you replace parts.

The Formula

Every LED resistor calculation is one line of algebra from Kirchhoff's voltage law. The supply voltage equals the sum of voltage drops around the loop:

V_s = V_f + V_R

The resistor drop is I × R (Ohm's law), so:

R = (V_s − V_f) / I_f

Where:

  • V_s = supply voltage (volts)
  • V_f = LED forward voltage drop (volts, from the datasheet)
  • I_f = desired LED forward current (amps, from the datasheet)
  • R = resistance in ohms

The resistor dissipates power as heat:

P_R = (V_s − V_f) × I_f

Both formulas assume DC. For PWM dimming, peak current through the resistor stays at the full I_f value regardless of duty cycle; do not size the resistor based on average current.

Worked Example: Arduino Indicator LED

You want a standard 5 mm red LED on an Arduino digital pin. The LED datasheet says V_f = 2.0 V, I_f = 20 mA. Arduino digital output is 5 V.

Step 1. Calculate resistance.

R = (5.0 − 2.0) / 0.020 = 150 Ω

Step 2. Calculate resistor power dissipation.

P = (5.0 − 2.0) × 0.020 = 0.060 W = 60 mW

Step 3. Pick a standard value and power rating.

150 ohms is already an E24/E12 standard value (IEC 60063). At 60 mW dissipation, a standard 1/4 W (250 mW) carbon film resistor has a 4:1 safety margin. Done.

Verify this with the LED resistor calculator.

Worked Example: 12 V Automotive White LED

You're adding a white LED dome light to a 12 V automotive circuit. The LED datasheet lists V_f = 3.2 V, I_f = 20 mA. Automotive "12 V" actually sits around 13.8 V with the alternator running, so use 14 V as V_s to size for worst case.

R = (14.0 − 3.2) / 0.020 = 540 Ω
P = (14.0 − 3.2) × 0.020 = 0.216 W

The nearest E24 value above 540 is 560 ohms. At 560 ohms the actual current drops to (14.0 − 3.2) / 560 = 19.3 mA, still bright enough for an indicator. Power dissipation at this current: 10.8 × 0.0193 = 0.208 W.

A 1/4 W (250 mW) resistor would run at 83% of its rating, which is marginal. Step up to a 1/2 W resistor for thermal headroom, or use a 14 V supply figure and rate at 2× calculated: 0.216 × 2 = 0.432 W, confirming the 1/2 W choice.

Check your values with the LED resistor calculator.

Series LED Chains

When identical LEDs are wired in series, their forward voltages add. One resistor limits the current through the entire chain:

R = (V_s − n × V_f) / I_f

Where n is the number of LEDs. The supply must exceed the total LED voltage drop, or no current flows.

Example: Three red LEDs (V_f = 2.0 V each) on a 12 V supply at 20 mA.

R = (12 − 3 × 2.0) / 0.020 = 6.0 / 0.020 = 300 Ω
P = 6.0 × 0.020 = 0.120 W

The nearest E24 value above 300 is 330 ohms. Actual current: 6.0 / 330 = 18.2 mA. A standard 1/4 W resistor handles this comfortably.

Series chains are more efficient than individual resistors because the LEDs consume a larger share of the supply voltage. In this example, the three LEDs use 6.0 V and the resistor burns 6.0 V. Compare to three separate LEDs each with their own resistor on 12 V: each resistor burns 10.0 V, tripling total waste heat.

Watch the headroom. Three blue LEDs at 3.3 V each need 9.9 V just for the LEDs. A 12 V supply leaves only 2.1 V for the resistor (R = 105 ohms), which is workable. A 9 V battery cannot drive them at all since 9.0 < 9.9.

Parallel LEDs: One Resistor Per Branch

Never share a single resistor across parallel LEDs. The reason is physics, not convention.

Forward voltage varies between LEDs even from the same manufacturing reel, typically by 0.1 to 0.2 V. When two LEDs share a resistor in parallel, the one with the lower V_f conducts more current. More current heats the junction. A hotter junction drops V_f further (about 2 mV/°C for typical InGaN and AlGaInP devices). Lower V_f means even more current. This positive feedback loop, thermal runaway, kills the LED.

The fix: give every parallel LED its own resistor. Each resistor independently limits its branch current regardless of V_f mismatch.

Example: Four red LEDs in parallel, each with its own resistor, on a 5 V supply at 20 mA each.

Per-branch resistor: R = (5 − 2.0) / 0.020 = 150 ohms, same as the single-LED case. Total source current: 4 × 20 = 80 mA. Four 150 ohm resistors, each rated 1/4 W.

Power Rating: The 2× Rule

Calculate P = (V_s − V_f) × I_f. Then pick a resistor rated at least twice that value. This is an engineering rule of thumb from IEC 60115 reliability data: a resistor running at 50% of its rated power dissipation stays cool enough that its resistance drift stays under 1% over its service life.

Standard through-hole resistor ratings:

Rated PowerPackageTypical Use
1/8 W (125 mW)0805 SMDLow-current indicators at 2-5 mA
1/4 W (250 mW)Axial, 1206 SMDStandard 20 mA indicator LEDs
1/2 W (500 mW)Axial (larger body)Higher-voltage supplies, 12 V automotive
1 WWire-wound or thick filmMultiple high-brightness LEDs

If the 2× rule puts you between standard ratings, always round up. A resistor running hot fails early and can discolor the PCB around it.

What to Use When You Don't Have a Datasheet

Sorting through a bag of unmarked 5 mm indicator LEDs is common in hobby work. These defaults are conservative starting points:

LED ColorTypical V_fSafe Starting I_f
Infrared1.2 V20 mA
Red1.8 V10 mA
Orange2.0 V10 mA
Yellow2.1 V10 mA
Green2.2 V10 mA
Blue3.0 V10 mA
White3.0 V10 mA
UV3.3 V10 mA

Using 10 mA instead of 20 mA for unknown LEDs underdrives them slightly. Modern high-efficiency LEDs are still visibly bright at 10 mA, and the lower current gives thermal margin if V_f turns out higher than expected.

The V_f values above are approximate center-of-range figures from LED manufacturers' published specifications. Red through yellow LEDs use AlGaInP or GaAsP semiconductor materials with lower band gaps; blue, white, and UV LEDs use InGaN with higher band gaps, which is why their forward voltage is roughly 1 V higher.

When to Use a Constant-Current Driver Instead

A resistor is the right tool for indicator LEDs running at a few milliamps from a stable supply. It stops being the right tool in three situations:

High-power LEDs (350 mA and above). A 1 W white LED at 350 mA and 3.2 V on a 12 V supply dissipates (12 − 3.2) × 0.35 = 3.08 W in the resistor alone. That is more power wasted in the resistor than consumed by the LED. A switching buck LED driver (LM3414, AL8860, or CAT4201) runs at 85-95% efficiency and eliminates the heat problem. Avoid linear constant-current drivers like the CAT4101 at high voltage ratios; they use a pass transistor instead of an inductor and their efficiency is simply V_f / V_s (about 27% for a 3.2 V LED on 12 V).

Fluctuating supply voltage. In battery-powered devices, supply voltage drops as the battery discharges. A 9 V battery starts at 9.5 V and ends at 6.0 V. With a fixed resistor and a 3.0 V blue LED, current varies from (9.5 − 3.0) / R to (6.0 − 3.0) / R, a 2:1 brightness swing. A constant-current driver maintains fixed LED current regardless of input voltage.

Production runs. V_f binning across a reel of LEDs can vary by 0.2 V or more. For a hobby project with five LEDs, the variation is invisible. For a product shipping 10,000 units, resistor tolerance plus V_f variation creates noticeable brightness spread. A constant-current driver eliminates both variables.

For single indicator LEDs on a regulated 3.3 V or 5 V rail, a resistor remains the simplest, cheapest, and most reliable solution. The LED resistor calculator sizes it in seconds. For anything drawing more than 100 mA, consider a purpose-built LED driver IC.

Common Mistakes

Forgetting the return path. The factor of 1 in the single-LED formula (not 2, unlike voltage drop in wiring) assumes a single series loop. The "2×" factor in wire voltage drop formulas accounts for current traveling out and back through two conductors. In an LED circuit, the resistor and LED are in the same single loop, so there is no doubling.

Sizing for average current during PWM dimming. A 1 kHz PWM signal at 10% duty cycle on a 20 mA LED pushes 20 mA peak through the resistor during each on-pulse. The resistor must handle the peak current and instantaneous power, not the 2 mA time-averaged current.

Running LEDs from AC mains with a resistor. The peak voltage of 120 V RMS is 170 V; for 230 V RMS it is 325 V. A simple resistor would need to dissipate several watts, and the LED sees reverse voltage on the negative half-cycle that exceeds its V_R rating (typically 5 V). Use a proper AC LED driver module.

Connecting LEDs directly to a GPIO without checking source current limits. An Arduino Uno digital pin sources a maximum of 40 mA (with a recommended limit of 20 mA per ATmega328P datasheet). An ESP32 GPIO is limited to 12 mA per pin. Always check the microcontroller's maximum source current before connecting an LED, even with a proper resistor.

Use the Ohm's law calculator to double-check any resistance, current, or voltage relationship, and the resistor color code calculator to verify the bands on the part you pull from the drawer.