

A Light Emitting Diode (LED) is a semiconductor device that emits light when an electric current passes through it. LEDs are energy-efficient, have a long lifespan, and are widely used in various applications. They are available in different colors, sizes, and brightness levels, making them versatile for numerous use cases.








An LED typically has two pins:
| Pin Name | Description | Identification Method |
|---|---|---|
| Anode | Positive terminal (connect to +V) | Longer leg |
| Cathode | Negative terminal (connect to GND) | Shorter leg or flat edge on casing |
Below is an example of connecting an LED to an Arduino UNO:
// Simple LED Blink Example
// This code blinks an LED connected to pin 13 of the Arduino UNO.
void setup() {
pinMode(13, OUTPUT); // Set pin 13 as an output
}
void loop() {
digitalWrite(13, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(13, LOW); // Turn the LED off
delay(1000); // Wait for 1 second
}
LED Does Not Light Up:
LED is Dim:
LED Burns Out Quickly:
LED Flickers:
Q: Can I connect an LED directly to a 5V power supply?
A: No, you must use a current-limiting resistor to prevent excessive current from damaging the LED.
Q: How do I choose the right resistor for my LED?
A: Use the formula (R = \frac{V_{supply} - V_f}{I_f}), where (V_{supply}) is the supply voltage, (V_f) is the LED's forward voltage, and (I_f) is the desired current.
Q: Can I use an LED with an AC power source?
A: LEDs are designed for DC operation. To use them with AC, you need a rectifier circuit and a current-limiting resistor.
Q: What happens if I reverse the polarity of an LED?
A: The LED will not light up. In some cases, applying a high reverse voltage can damage the LED.
This documentation provides a comprehensive guide to understanding and using LEDs effectively in your projects.