← Block library

LED Current Sink

@electrace/led-current-sink@1.0.0 · CC-BY-4.0
i_set 0.18 Avin 3–24 V
The actual schematic inside this block — every part is explained below.

LED Current Sink

LEDs are current-mode creatures: their brightness tracks current, and their forward voltage is a moving target (it shifts with temperature and part lot). A series resistor approximates a current; this two-transistor circuit regulates one — same brightness at 3 V or 24 V, summer or winter.

How the feedback works (wire the LED string between supply and sink):

  1. Current through the string flows Q1 → R2, the sense resistor.
  2. R2's voltage grows with the current. At ~0.6 V it switches Q2 on.
  3. Q2's collector then steals Q1's base drive — throttling Q1 until the current settles exactly where R2 reads 0.6 V.

That's the whole regulator: I ≈ 0.6 V / R2. Want 20 mA? R2 = 33 Ω. 350 mA power LED? R2 = 1.8 Ω (watch its wattage: I²R).

This is also your first taste of how every linear current regulator works inside — a sense element, a reference (here Q2's own Vbe), and a pass element being throttled. The LM317 in current mode is this exact idea with better manners.

Exposes: vin (bias feed for the base), sink (LED string's cathode end), gnd.

⚠ The headroom rule: whatever voltage your LED string doesn't drop, Q1 drops as heat. Match the string voltage to the supply so Q1 keeps only 1–2 V. The checks compare declared voltages and flag the dissipation when you give them the numbers.

Exposed nets

vinin · power · 3–24 V
sinkin · signal
gndin · gnd

Inside this block

Q1
npn-pass
the pass transistor — the LED string's current flows through it into R2
Q2
npn-sense
the regulator — when R2's voltage hits ~0.6 V it steals Q1's base drive, capping the current right there
R1
10k
feeds Q1's base from the supply — Q2 throttles this
R2
3.3
the sense resistor — the current programmer: I ≈ 0.6 V / R2

Limits & gotchas

iset.formula 0I ≈ 0.6 V / R2. The 3.3 Ω here sets ~180 mA. It holds that current regardless of supply voltage or how many LEDs are in the string — that's the point.
power.note 0Q1 burns (V_sink − ~1 V) × I as heat. Keep the LED string's total forward voltage close to the supply so Q1 only drops a volt or two — a 5 V supply with one 2 V LED leaves Q1 eating 2 W at 180 mA. SOT-23 cannot do that; size the string, not the transistor.
Use this block in a real design
Drop it on a canvas, wire it up, and watch the live checks — free, no card.
Start designing →
This page is generated from the block's source — the same content powers the editor's explanations and live checks.