Chris Collins

Tools · electronics

LED drivers

Arrange LEDs in series strings with ballast resistors and compare every arrangement, weigh resistors against LM317, two-transistor, and switching constant-current drivers, and plan PWM dimming with gamma-corrected brightness tables for your code.

Added

How to use it
  • Strings & resistors — n LEDs as strings of s in series, each string with its own resistor R = (Vs − s·Vf) ÷ I, rounded up to E24 so the current errs low. Longer strings waste less in the resistor (efficiency = s·Vf/Vs) but are more sensitive to the supply: the current changes by 1/(Vs − s·Vf) per volt. The table lists every arrangement that fits, with the resistor’s power and the rating to buy (2× margin).

  • Constant current — for one string, the loss and minimum supply of a plain resistor, an LM317 as a current source (R = 1.25 V ÷ I, needing the string voltage + 1.25 V + dropout), a two-transistor current source (R ≈ 0.65 V ÷ I), and a switching (buck) driver at the efficiency you enter.

  • PWM dimming — the duty cycle for a perceived brightness, using duty = brightness^γ (γ ≈ 2.2, close to the CIE L* curve), the average current, the smallest step at your PWM resolution, and the highest PWM frequency your timer clock allows (clock ÷ 2^bits). Below 200 Hz the flicker is visible; cameras can show bands up to a few kHz. The tool writes a gamma table as a C array.

Forward voltages vary with colour, current, temperature, and batch: measure yours. For a single LED and resistor, the circuit tool has an LED-resistor calculator.

Sharing

Share link copies a URL that opens this tool with your current settings — every value it remembers between visits, packed into ?s=. Opening a link replaces your saved settings for this tool.

Runs entirely in your browser; nothing you type leaves this page.