

The 5 mm RGB LED, Common Anode, is a versatile light-emitting diode that combines red, blue, and green LEDs into a single package. This component allows users to create a wide range of colors by adjusting the intensity of each LED. The "common anode" configuration means that all three LEDs share a single positive terminal, while the negative terminals for each color are controlled individually.








| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | Common Anode | Shared positive terminal for all three LEDs |
| 2 | Red Cathode | Negative terminal for the red LED |
| 3 | Blue Cathode | Negative terminal for the blue LED |
| 4 | Green Cathode | Negative terminal for the green LED |
Below is an example of how to connect and control the 5 mm RGB LED using an Arduino UNO.
// Define the pins for the RGB LED
const int redPin = 9; // Red cathode connected to pin 9
const int bluePin = 10; // Blue cathode connected to pin 10
const int greenPin = 11; // Green cathode connected to pin 11
void setup() {
// Set the RGB LED pins as outputs
pinMode(redPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(greenPin, OUTPUT);
}
void loop() {
// Example: Display red color
analogWrite(redPin, 255); // Full brightness for red
analogWrite(bluePin, 0); // Turn off blue
analogWrite(greenPin, 0); // Turn off green
delay(1000); // Wait for 1 second
// Example: Display green color
analogWrite(redPin, 0); // Turn off red
analogWrite(bluePin, 0); // Turn off blue
analogWrite(greenPin, 255); // Full brightness for green
delay(1000); // Wait for 1 second
// Example: Display blue color
analogWrite(redPin, 0); // Turn off red
analogWrite(bluePin, 255); // Full brightness for blue
analogWrite(greenPin, 0); // Turn off green
delay(1000); // Wait for 1 second
// Example: Display white color (all LEDs on)
analogWrite(redPin, 255); // Full brightness for red
analogWrite(bluePin, 255); // Full brightness for blue
analogWrite(greenPin, 255); // Full brightness for green
delay(1000); // Wait for 1 second
}
LED Does Not Light Up:
LED Flickers or is Dim:
Colors Appear Incorrect:
Overheating:
Can I use this LED with a 3.3V power supply?
Yes, but you may need to adjust the resistor values to ensure proper current limiting.
How do I create custom colors?
Use PWM to adjust the brightness of each LED. By mixing different intensities of red, blue, and green, you can create a wide range of colors.
What happens if I connect the common anode to ground?
The LED will not function correctly, as the common anode must be connected to a positive voltage source.
This concludes the documentation for the 5 mm RGB LED, Common Anode.