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:
| Cause | Fix |
|---|---|
| MCU pin leakage (0V = not truly 0V) | Add a 1k–10k resistor from pin to ground |
| CMOS floating input | Add pull-down resistor (10kฮฉ to GND) |
| Transistor leakage | Use a MOSFET instead of BJT for switching |
| Inductive load | Add reverse diode across coil (1N4148 or 1N4007) |
| Internal pull-up enabled | Disable 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
Post a Comment