November 27, 2016
Light Emitting Diodes (LED)
A light emitting diode is a simple electronics component which lights up when electricity flows through it. As the word diode suggests, electricity can only flow one way through it. To identify power and ground the ground side of the LED is flattened while the power side is round. Also the “leg” on the ground side of the LED is a bit shorter than the leg on the power side (see picture above).
Please also note that LEDs can easily be damaged by too much power. That’s why you always want use them in series with a resistor such that power flows as follows:
3V -> long LED leg -> short LED leg -> resistor in -> resistor out -> GND
Evil Mad Scientist describes in detail how to select an appropriate resistor for a LED. Throughout this blog we will always use 3.3V forward Voltage LEDs connected in series with a 330Ω resistor unless explicitly stated otherwise. Like this we never have to worry about damaging the LED, even no matter if we use Raspberry’s 3V or 5V power supply. amaging the LED, even no matter if we use Raspberry’s 3V or 5V power supply.