Skip to content
Simurq Labs

Learn

LED resistor calculator

By Semih Özbir, Electrical and Electronics Engineer

Published · Last reviewed

In this guide · 6

R = (Vs − Vf) / If: a red LED at 20 mA from 5 V needs 150 Ω. Its datasheet gives a 2.0 V forward voltage at 20 mA, which leaves 3.0 V for the resistor. It dissipates 60 mW, and Broadcom's LED application note rates it at twice that, 0.12 W.

V
mA

Typical at 20 mA, from Lite-On LTST-C191KRKT's datasheet.

V
Round up to

E12 for ±10 % parts, E24 for ±2 % and ±5 %, by Vishay's decade table.

Series resistor150 Ω60 mW at 20.0 mA
Next E12 value up150 Ω: 20.0 mA, 60 mWRate it for0.12 W or more, twice its powerSmallest chip for the rating0805, Vishay CRCW, rated 0.125 W at 70 °C

R = (Vs − n × Vf) / If, Broadcom's formula; standard values from Vishay's E12 and E24 table.

Series resistor: 150 Ω

This LED resistor calculator takes the supply voltage, the current you want in milliamperes, one LED's forward voltage at that current, read from its datasheet, and how many LEDs share it in series. For the forward voltage it also offers each colour's typical value at 20 mA from a named part's datasheet. It returns the resistor and what it dissipates, then the next E12 or E24 value up, with the current and power that value gives, the rating to buy it at, and the smallest chip size in Vishay's standard range rated for it.

Where does the LED resistor formula come from?

Lite-On's datasheet calls an LED a current-operated device, so something has to set its current. Broadcom's Application Note 1005, on LED lamps and displays, makes that a resistor in series with the LED, sized by its Equation 4:

R = (VCC − VSAT − VF) / IPEAK

  • VCC is the supply voltage.
  • VSAT is the saturation voltage of the transistor that switches the LED, where one does.
  • VF is the LED's forward voltage at IPEAK, read off its curve of forward current against forward voltage.
  • IPEAK is the current through the LED: for a steady current, that current.

LEDs in series carry one current, and their forward voltages add. With n of them, and any drop of the driver's taken off the supply first, the calculator works out R = (Vs − n × Vf) / If. The resistor dissipates the voltage across it times the current, P = (Vs − n × Vf) × If, which is the note's I² × R.

The note's own example drives a lamp at 42 mA from 5 V through a transistor that saturates at 0.1 V. It reads 1.95 V off the lamp's curve at 42 mA, so (5.0 − 0.1 − 1.95) / 0.042 = 70.2 Ω, which it writes as 70 Ω. A resistor's power rating should be twice what it dissipates, the note adds, so its 0.123 W takes a 1/4 W part.

A worked example: a red LED from 5 V

Take Lite-On's LTST-C191KRKT, a red 0603 chip LED. At 20 mA its datasheet gives a forward voltage of 2.0 V typical and 2.4 V at most, and no minimum. From 5 V at 20 mA, rounding to E12:

  1. The voltage left for the resistor: 5.0 − 2.0 = 3.0 V
  2. The resistor: 3.0 / 0.020 = 150 Ω
  3. The next E12 value up: 150 Ω is one, so it stays
  4. Its power: 3.0 × 0.020 = 0.060 W, 60 mW
  5. Its rating, twice that: 2 × 0.060 = 0.12 W
  6. At the 2.4 V maximum, the same 150 Ω passes (5.0 − 2.4) / 150 = 0.0173 A, 17.3 mA

From 3.3 V the LED needs 1.3 / 0.020 = 65 Ω. The next E12 value up is 68 Ω, which passes 19.1 mA and dissipates 24.9 mW. From 12 V it needs 500 Ω: E24's next value up, 510 Ω, passes 19.6 mA and dissipates 196 mW, and E12's, 560 Ω, passes 17.9 mA and dissipates 179 mW.

Which forward voltage should you use?

The forward voltage is not one number. Vishay's application note on its TELUX LEDs gives it as a function of the current and the junction temperature, and it also differs from one part to the next. Each of the three moves the current a resistor sets:

  • Your current. A datasheet's table gives the forward voltage at one test current, 20 mA for the LTST-C191KRKT. At another current, read it off the curve of forward current against forward voltage. Vishay's curve for its own red 0603 LED, the TLMS1100, passes about 1.74 V at 1 mA, 1.95 V at 10 mA and 2.41 V at 50 mA. Size a 1 mA indicator from 3.3 V with its table's typical 2.1 V at 20 mA, and its 1.2 kΩ passes about 1.3 mA: at 1 mA the LED takes only 1.74 V.
  • The spread. A resistor sized at the typical 2.0 V passes less with an LED at the 2.4 V maximum: 17.3 mA instead of 20 mA, from 5 V.
  • Heat. As the LED warms, its forward voltage falls. On Vishay's chart for the TLMS1100 at 20 mA, it is about 0.12 V lower at 85 °C than at 25 °C, some 2 mV for each °C. Through a fixed resistor the current rises: across the example's 3.0 V, 0.12 V more is 4 % more current.

The spread weighs most where little voltage is left for the resistor. For a resistor sized exactly for 20 mA at the typical 2.0 V, before any rounding, here is the current at the 2.4 V maximum, against the supply:

Chart of LED current against supply voltage from 2 to 12 V, the resistor sized for 20 mA at the typical 2.0 V forward voltage: at the 2.4 V maximum the current is 13.8 mA from 3.3 V, 17.3 mA from 5 V, the worked example, and 19.2 mA from 12 V.

LED current against supply voltage, the resistor sized for 20 mA at the typical 2.0 V, computed for that forward voltage and for the 2.4 V maximum from Lite-On's datasheet.

From 3.3 V the maximum leaves 13.8 mA, from 5 V 17.3 mA and from 12 V 19.2 mA. The more voltage the resistor drops, the less the LED's spread moves the current.

What value and power rating does an LED resistor need?

Resistors come in standard values. Vishay's decade table lists them: E12, twelve to a decade, for ±10 % parts, and E24, twenty-four, for ±2 % and ±5 %, each times a power of ten. E12 runs 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68 and 82; E24 adds 11, 13, 16, 20, 24, 30, 36, 43, 51, 62, 75 and 91.

Round up: a larger resistor passes a little less current, so the LED stays at or under the current you chose. Then rate it for its power:

  • Twice its power. That is Broadcom's margin: 0.12 W for the example's 60 mW.
  • Its package's rating. Vishay rates its CRCW0603 thick-film chip resistor at 0.10 W and its CRCW0805 at 0.125 W, up to 70 °C. Above that, its derating chart falls in a straight line to nothing at 155 °C, the hottest its film may run. By the note's margin, the example's resistor is an 0805, not an 0603.

A bill of materials can order such a resistor by its ratings alone: the BOM PCB Agent delivers writes one as "Resistor 1k, 1 %, 0.1 W", the format our PCB BOM template shows. A replacement keeps the value and matches or beats the tolerance and the power, as drop-in replacement parts explains.

What changes on a real board?

  • The driver. Whatever switches the LED drops some voltage too. Take it off the supply first, as Broadcom takes 0.1 V for its transistor at 42 mA.
  • The LED's own limit. Lite-On rates the LTST-C191KRKT at 30 mA DC and 75 mW at 25 °C, and takes 0.4 mA off the 30 mA for each °C as it warms. Its table starts that at 50 °C, its derating curve at 25 °C, which leaves 20 mA at 50 °C. Where the two differ, the curve is the lower limit.
  • Several LEDs. In series they carry one current, and their forward voltages add. Two from 5 V leave 1.0 V for a 50 Ω resistor, and at 2.4 V each only 4.0 mA flows. Three need more than 6.0 V, and the calculator says no resistor can set a current. In parallel, Lite-On recommends a resistor for each LED, since on a shared one their brightness may differ with their I-V curves.

Limits

The calculator holds the forward voltage you enter fixed, at one current and one temperature, and the sections above show how far it moves. It sizes for a steady current: Broadcom's note covers pulsed drive, where the peak current and the duty cycle set the resistor's power. And a resistor holds the current only as steady as the supply holds its voltage.

PCB Agent's code sizes no indicator's resistor for a board, and no check compares a resistor's power with its rating, or an LED's current with its derated maximum. The currents on this page are worked out from the makers' figures, not measured on a board.

Sources

  • Voltage divider calculator

    Vout = Vin × R2 / (R1 + R2): 30 kΩ over 10 kΩ turns 12 V into 3.000 V for a 3.3 V ADC. A calculator with the load, source resistance and E24 and E96 pairs.

  • What goes in a PCB BOM, and in what format?

    A PCB BOM needs one line per part: designators, quantity, maker and part number. The columns a machine reads, the traps, and a template to download.

  • When is a part a drop-in replacement?

    A drop-in replacement fits the same footprint, has the same function on each pin and matches or beats every rating. What makers mean, and what to check.

Have a board in mind?

PCB Agent is not open to the public yet. Leave your email, and we'll write when early access starts.