

The 5 mm RGB LED, Common Cathode, 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 varying the intensity of each LED. The "common cathode" configuration means that all three LEDs share a single cathode (negative) pin, while the anodes (positive pins) are separate for each color.








| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | Red (R) | Positive terminal for the red LED |
| 2 | Cathode | Common negative terminal for all LEDs |
| 3 | Blue (B) | Positive terminal for the blue LED |
| 4 | Green (G) | Positive 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 RGB LED pins
const int redPin = 9; // Red LED connected to pin 9
const int bluePin = 10; // Blue LED connected to pin 10
const int greenPin = 11; // Green LED connected to pin 11
void setup() {
// Set the RGB LED pins as outputs
pinMode(redPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(greenPin, OUTPUT);
}
void loop() {
// Turn on the red LED
analogWrite(redPin, 255); // Full brightness for red
analogWrite(bluePin, 0); // Blue off
analogWrite(greenPin, 0); // Green off
delay(1000); // Wait for 1 second
// Turn on the green LED
analogWrite(redPin, 0); // Red off
analogWrite(bluePin, 0); // Blue off
analogWrite(greenPin, 255); // Full brightness for green
delay(1000); // Wait for 1 second
// Turn on the blue LED
analogWrite(redPin, 0); // Red off
analogWrite(bluePin, 255); // Full brightness for blue
analogWrite(greenPin, 0); // Green off
delay(1000); // Wait for 1 second
// Mix colors (e.g., purple)
analogWrite(redPin, 128); // Half brightness for red
analogWrite(bluePin, 128); // Half brightness for blue
analogWrite(greenPin, 0); // Green off
delay(1000); // Wait for 1 second
}
One or More LEDs Not Lighting Up:
LEDs Are Dim:
Incorrect Colors Displayed:
LEDs Flicker:
Q: Can I use the RGB LED without a microcontroller?
A: Yes, you can use simple switches or potentiometers to control the voltage applied to each pin, allowing manual color mixing.
Q: What happens if I connect the LED without resistors?
A: Without resistors, the LEDs may draw excessive current, leading to overheating and permanent damage.
Q: Can I use this LED with a 3.3V microcontroller?
A: Yes, but ensure the forward voltage of each LED is compatible with the 3.3V logic level, and use appropriate resistors to limit current.
This concludes the documentation for the 5 mm RGB LED, Common Cathode.