Why does my LED glow dimly when it's supposed to be off?



Short Answer: Leakage current through a transistor or microcontroller pin, or floating input on a CMOS gate.

Detailed: When a microcontroller pin is set to LOW (0V), it should be 0V. But CMOS outputs have a tiny leakage current (usually <1 ยตA). With a high-efficiency LED, 1 ยตA can produce a visible dim glow.

Other causes:

  • Floating input on a logic gate (CMOS inputs float to half-supply)

  • Transistor leakage in a switched circuit

  • Inductive kickback from a relay coil (needs flyback diode)

  • Pull-up resistor left enabled on a pin (e.g., INPUT_PULLUP on Arduino)

Fixes:

CauseFix
MCU pin leakage (0V = not truly 0V)Add a 1k–10k resistor from pin to ground
CMOS floating inputAdd pull-down resistor (10kฮฉ to GND)
Transistor leakageUse a MOSFET instead of BJT for switching
Inductive loadAdd reverse diode across coil (1N4148 or 1N4007)
Internal pull-up enabledDisable it (pinMode(pin, OUTPUT) or INPUT without pull-up)

The real fix: A 1kฮฉ resistor from the LED's cathode to ground will shunt leakage current while drawing only 5 mA when ON — negligible.

Comments