DIY Electronics
— Building circuits, programming microcontrollers, and making things blinkHome automation dashboard using MQTT, Node-RED, and an ESP8266
Why Did My LED Burn Out?
Hi everyone, total beginner here. I connected an LED to pin 13 on my Arduino and it worked for about 30 seconds then stopped lighting up. Did I break my Arduino?
After reading some replies, I figured out I forgot to add a resistor. For other beginners: an LED needs a current-limiting resistor in series or it will draw as much current as the source can supply, which destroys the LED and can damage the GPIO pin. Ohm's law: R = (Vsupply - Vforward) / Imax. For a red LED on 5V with a 20mA rating, that's (5 - 2) / 0.02 = 150 ohms. I used a 220 ohm resistor (the next standard value up) and it works perfectly now.
The Arduino GPIO pin survived, probably because the protection diodes clamped the current spike before it did real damage. I got lucky. Lesson learned the cheap way.