← Block library

LED Indicator

@electrace/led-indicator@1.0.0 · CC-BY-4.0
vf 2 Vi_led 10 mAr_series 330 Ohm

LED Indicator

The simplest useful block: an LED with a current-limiting resistor. Drive vin high and the LED lights. The resistor is not optional — an LED is a diode, so without it the current is limited only by the supply and the LED burns out.

  • R1 — sets the brightness/current. Sized from the supply and the LED's forward voltage: I = (Vin − Vf) / R. With 5 V in, a 2 V green LED, and 330 Ω → about 9 mA.
  • D1 — the LED. Anode toward the resistor, cathode to ground.

Exposes: vin (the drive, 3–5.5 V) and gnd.

Change R to change brightness: smaller R = more current = brighter (until you exceed the LED's rating). The declared 15 mA cap on vin keeps it in safe territory.

Exposed nets

vinin · signal · 3–5.5 V
gndin · gnd

Inside this block

R1
330
sets the LED current: (Vin − Vf) / R ≈ 10 mA at 5 V
D1
led-green
lights when the input is driven high
This page is generated from the block's source — the same content powers the editor's explanations and live checks.