Source code coming soon. The GitHub repository is private for now and opens to everyone very soon.
BetterSPICE Beta 0.8.1 Join the beta Download soon
Part VII  Design calculatorsReferenceContentsIndex
55

LED resistor and LED driver

The current an LED string draws and the part that sets it. The Simple view sizes the series resistor from the supply, the LED’s datasheet forward voltage and the current you want. The Advanced view designs the driver over the supply range, the Vf bin and the ambient: a resistor, a current sink (op-amp, MOSFET and sense resistor) or a constant-current regulator, with parallel strings, self-heating, PWM and the light it gives. Group Parts. Search words include led, resistor, series, forward voltage, current limit and indicator.

The window, the Simple and Advanced views, full screen and the place buttons are in The calculator window.

55.1Simple: the series resistor

Simple: the series resistor
ChoiceOptionsWhat it does
LED colourred, orange, yellow, green, blue, white, uv, irSets the LED model’s emission coefficient N and series resistance Rs, as the LED part does: red, orange and yellow N 1.9 and 2 Ω, green 2.0 and 2 Ω, blue, white and UV 2.6 and 2 Ω, infrared 1.6 and 1 Ω.
Resistor seriesE12, E24, E96
Simple: the series resistor
FieldUnitDefaultWhat it does
Supply voltageV5Across the resistor and the LEDs together.
LED forward voltageV2.0At the test current below (red about 2, green 2.1, blue and white 3.2). Reads a selected LED’s vf.
LED test currentmA, A20 mAThe current the datasheet gives the forward voltage at. Reads a selected LED’s if_test.
LEDs in series11 to 20 (at most 50 are worked out).
LED currentmA, A10 mASOLVE. The current you want, or the current a given resistor gives.
ResistorΩ, kΩ330 Ω (solved)SOLVE, solved when the calculator opens: the nearest standard value, or the resistor you have when the current is solved.

The LED is the simulator’s own: IS is fitted so the Shockley law gives the datasheet Vf at the test current, and Vf(I) = n Vt ln(I/IS + 1) + I Rs. So Vf is taken at the working current, not at the test current. R = (Vs − N·Vf) / I. Solving the current finds the current where N·Vf(I) + I·R = Vs.

Simple: the series resistor
ResultWhat it is
Standard valueThe nearest value of the series, nearest in ratio (orange).
Exact value, Neighbours in E24The exact resistor and the two standard values around it.
Current with itThe current the standard value really gives.
LED currentWhen the current is solved (replaces the four above).
Vf per LEDAt the working current.
Resistor power, Resistor ratingI²R, and the first of 0.1, 0.125, 0.25, 0.5, 1, 2, 3 and 5 W that is at least twice it.
LED power, Supply powerN·Vf·I and Vs·I.

The plot LED current against voltage draws the LED curve and the resistor’s load line, with the working point marked.

Simple: the series resistor
MessageWhen it shows
"Supply 1.5 V is below the string voltage 1.95 V at 10 mA. Raise the supply or use fewer LEDs in series."The string needs more than the supply. The tiles read 0.
"Resistor 301 mW is above the 0.25 W of a quarter-watt part. Use a 1 W resistor or lower the supply."Over 0.25 W.
"Resistor … A 1/8 W part runs hot, use 1/4 W or larger."Over 0.125 W.
"Current 30.2 mA is above the 20 to 30 mA of an indicator LED. Check the LED’s absolute maximum current."Over 30 mA.
"Nearest E24 value gives …, … % off target. Use E96 or two resistors in series."The standard value is more than 10 % off.
"The LEDs drop over 90 % of the supply, so the current follows the supply and Vf closely. A current source holds it steadier."Little headroom.
"At most 50 LEDs in one string."More than 50.
Simple: the series resistor
ButtonWhat it does
Place as circuitV_LED, R_LED and the LEDs (with the colour, vf and if_test), a probe I LED, in the live view.
Apply to the selected resistorThe resistor used, into the selected resistors.
Try it
A red LED on 5 V
  1. Open the LED resistor (type led): 5 V, red, 2.0 V at 20 mA, one LED, 10 mA, E24.
  2. Press SOLVE on LED current and type Resistor 330.

You should seeStandard value 300 Ω (exact 305 Ω, neighbours 300 Ω and 330 Ω), 10.2 mA with it, Vf 1.95 V at that current, 31.1 mW in the resistor (rating at least 100 mW). With 330 Ω the current is 9.27 mA.

55.2Advanced: the LED driver

The LED driver’s Advanced view in full screen: a red LED from 4.5 to 5.5 V over 0 to 60 °C, with the three corners, the operating points, the parts, the ch
Figure 55.1The LED driver’s Advanced view in full screen: a red LED from 4.5 to 5.5 V over 0 to 60 °C, with the three corners, the operating points, the parts, the checks, the current against supply, the Monte Carlo, the strings, the derating and the light.
Advanced: the LED driver
ChoiceOptionsWhat it does
DriverResistor, Current sink, CC regulatorCurrent sink: an op-amp holds a MOSFET’s source at Vref across a sense resistor, I = Vref / Rs. CC regulator: a constant-current regulator with its accuracy and headroom.
Advanced: the LED driver
TabIts dotCards
DesignThe worst check.Result, Operating points, Parts, Checks.
Corners and spreadRed when the current spread is over 50 %, amber over 30 %.Corners, Checks, I(LED) vs supply, Monte Carlo spread.
StringsWith two strings or more: red over 20 % imbalance, amber over 10 %.Parallel strings.
Driver and partsResistor: red over its usable rating. Sink or regulator: red when it drops out at Vs min.Parts, Resistor derating (or Driver loss vs supply), Checks.
PWM and lightAmber with PWM under 1250 Hz.PWM and light.
Verify in simulationNone.Calculator vs simulation.
Advanced: the LED driver
FieldUnitDefaultWhat it does
Supply Min / Nominal / MaxV4.5 / 5 / 5.5Group Supply and target. Min and max follow at ±10 % of the nominal until you type them.
Ambient Min / Nominal / Max°C0 / 25 / 60
Target currentmA10
Resistor, or Sense resistorΩSOLVEDThe resistor driver’s resistor, or the sink’s sense resistor (nearest E96 to Vref / I).
Resistor sizingTyp = target, Max ≤ targetMax ≤ target takes the next value up so the highest corner stays at or under the target.
ColourRed … IRGroup LED (datasheet). A colour loads typical datasheet figures: red, orange, yellow Vf 1.8 / 2.0 / 2.4 V and −2 mV/°C, green 2.8 / 3.1 / 3.5 V and −3 mV/°C, blue 2.8 / 3.0 / 3.4 V, white 2.8 / 3.0 / 3.3 V and −2.5 mV/°C.
Vf min / typ / maxV1.8 / 2.0 / 2.4The Vf bin of the datasheet.
At test currentmA20
Vf tempcomV/°C−2
If abs. max, Tj maxmA, °C30, 115
Rth j-a (board)°C/W250For self-heating: Tj = Ta + Rth × I × Vf.
LEDs per string, Strings in parallel1, 1Group Strings (badge 2 × 3). Up to 8 strings.
BallastResistor per string, Shared resistor (Driver per string, Shared driver)
Series, Tolerance, Tempco, ±%, ppmE24, 1, 100Group Resistor.
Use at most%50Of the derated package rating.
Package (thick film, rating at 70 °C)0402 … 2512, 08050402 62.5 mW, 0603 0.1 W, 0805 0.125 W, 1206 0.25 W, 1210 0.5 W, 2010 0.75 W, 2512 1 W. The rating falls to 0 at 155 °C.
Reference, Reference tol., Sense R tol., Min Vds, FET θJAV, ±%, ±%, V, °C/W0.5, 1, 1, 0.2, 250Current sink.
Accuracy, Headroom, θJA±%, V, °C/W10, 1.8, 200CC regulator.
DC or PWM, Duty, Frequency, %, HzDC, 50, 1000Group PWM and light.
Flux at test I, Flux exponent, Flux tempcolm, , %/°C7, 1.0, −0.6Light = flux × (I / Itest)exponent × (1 + tempco (Tj − 25)).

The corners. Each corner puts every limit the same way: Lowest current is Vs min, the Vf max bin, cold and the resistor at +tolerance. Typical is nominal. Highest current is Vs max, the Vf min bin, hot and the resistor at −tolerance. The LED is the simulator’s own with the datasheet tempco added, and its junction temperature is found together with the current. A sink regulates while its headroom is at least Min Vds, else the string is limited by what is left. A regulator scales down in proportion when it lacks headroom. The Monte Carlo draws 700 builds: supply and ambient uniform over their ranges, Vf normal inside the bin (the bin is ±3σ), the tolerances ±3σ.

Advanced: the LED driver
ResultWhat it is
Resistor, Sense resistor or CC regulatorThe part that sets the current.
CurrentTypical, and the target.
RangeLowest to highest corner, and the spread as % of typical. Amber over 30 %, red over 50 %.
R power or Driver lossAt the worst corner (with the duty in PWM).
R package or HeadroomThe smallest package whose rating covers the power and voltage, or the sink’s headroom at the lowest corner.
LED TjAt the hot corner.
EfficiencyLED power over supply power, typical.
LightFrom the lowest-current corner to the highest, as % of typical, with Tj. The first number belongs to the lowest-current corner, so a hot corner can read like 96–72 %.

The Corners table gives supply, Vf bin, ambient, resistor, Vf at the current and Tj, current, Tj, power and brightness for each corner. I(LED) vs supply draws the three corners over the supply range with the other driver dashed. Parallel strings compares a resistor per string with a shared one for each Vf bin, and the hottest string. Parts gives what to order (resistor, its rating at 70 °C, working voltage, how many, the LED’s If max and Tj, and the Vf bin for at least 70 % light), the table Driver options comparing the three drivers, and Copy, Copy BOM line and Find resistors (which closes the calculator and searches the library for the resistor’s value).

Advanced: the LED driver
CheckValue and limitPassesMarginalFails
Highest current vs LED ratingI · If maxIf max ≥ 1.1 × IUp to If maxOver
Lowest current vs targetI · target80 % of target or more60 % or moreLess
Current spread% min to max30 % or less50 % or lessMore
Headroom across the resistor% of Vs min20 % or more10 % or moreLess
Resistor power vs derated ratingW · usable ratingWithin itUp to 1.25 × itMore
Resistor voltageV · package maximum1.5 × marginWithin itOver
Nearest E24 valueR · % off targetWithin 5 %Within 10 %More
Regulates at Vs min (sink, regulator)V · Vsat or headroom1.5 × what it needsWhat it needsDrops out
Driver junction°C · P × θUnder 125 °CUnder 150 °CMore
LED junction°C · Tj max10 °C under it or moreUnder itOver
String current sharing% · ballast10 % or less20 % or lessMore
PWM flicker (IEEE 1789)frequency1.25 kHz or more90 Hz or moreLess
Advanced: the LED driver
MessageWhen it shows
"Current spread −31 % / +25 %: the resistor drops 3.06 V of 5 V. Use fewer LEDs per string, a higher supply or a current sink (4 % spread)."A resistor driver with a spread over 50 %.
"Highest-corner current … is above the 30 mA rating. Use R ≥ … (10 % margin) or a current sink."Over the LED’s rating.
"LED Tj … (Rth … °C/W × …) is above the 115 °C limit. Add copper under the LED or lower the current."LED too hot.
"3 LEDs need …, the supply is …. Use fewer LEDs per string or a boost driver."The string needs more than the supply.
"Resistor 72.3 mW at 60 °C. A 0805 allows 62.5 mW at 50 % of its derated rating. Use a 1206 or two resistors in series."Resistor over its usable rating.
"Regulator drops out at 10.8 V with the Vf max bin: current 8.96 mA. Use one LED fewer per string or a lower reference."Sink or regulator drops out.
"Shared resistor: string currents differ by … % and the hot string runs away. Use one resistor per string."Shared ballast over 20 % imbalance.
"PWM 1 kHz at 100 % modulation is above the IEEE 1789 low-risk line. Use ≥ 1.25 kHz (low risk) or ≥ 3 kHz (no observable effect)."PWM under 1250 Hz.
"Nominal supply … is outside the … to … range. Set min and max around it."Typed range does not hold the nominal.

Verify in simulation places the driver at a chosen Corner (Lowest current, Typical, Highest current) and compares: LED current (op) within 3 %, Vf each within 30 mV, LED junction (rth_ja) within 3 °C, Resistor power or Driver power within 6 %, and Current from Vs min to max (a DC sweep) within 4 %. Light output is not simulated: the engine has no photometric model. The placed LED carries the band gap eg for the datasheet tempco. From 0.8.1 the engine sets it by itself (LED), and the written value keeps older engines right.

Advanced: the LED driver
ButtonWhat it does
Place and runThe chosen driver at the chosen corner: V_LED, R_LED and the LEDs with colour, vf, if_test, vf_tol, rth_ja, tamb and eg, or the sink (Q_LED, R_SENSE, U_LED, V_REF), or an ideal current source for the regulator, in the split live view with a probe on the LED current.
Run cornersThree circuits side by side (_MIN, _TYP, _MAX), an operating point, and LED current, lowest current corner and the others within ±3 % of the calculator.
Sweep supplyA DC sweep of V_LED from 0.9 × Vs min to 1.15 × Vs max, typical corner.
Monte Carlo (200 runs)tol on the supply, the driver parts and the LED bin, a Monte Carlo of the operating point (seed 1). LED current within the 99.73 % limits.
Apply to RResistor driver with a resistor selected: its value.
Advanced: the LED driver
SimpleAdvanced
Supply voltageSupply Nominal
LED forward voltage, LED test currentVf typ, At test current
LEDs in seriesLEDs per string
LED currentTarget current
LED colour, Resistor seriesColour, Series
Try it
Why a resistor spreads, and a sink does not
  1. Open the LED resistor and press Advanced: 5 V ±10 %, red, 10 mA, 0 to 60 °C.
  2. Open Driver and parts and read the table Driver options.

You should seeThe resistor is 300 Ω. The current runs from 7.07 mA (4.5 V, Vf max bin, 0 °C) to 12.8 mA (5.5 V, Vf min, 60 °C, Tj 65 °C): a 56 % spread, so Current spread fails and the warning suggests a current sink. The table shows the sink at 9.8 to 10 mA (4 %) and the CC regulator at 9 to 11 mA (20 %). Run corners passes at all three corners.