
RGB LED (Red Green Blue Light Emitting Diode) — a single LED package containing three individual LED elements (Red, Green, Blue) that can be mixed to produce virtually any color in the visible spectrum. Available in Common Cathode and Common Anode configurations. Widely used in color indicators, mood lighting, status displays, decorative lighting, Arduino/ESP32 color projects, and visual feedback systems. Available in 5mm through-hole package.
| Parameter | Value |
|---|---|
| Type | RGB LED (Red + Green + Blue) |
| Package | 5mm Through-hole |
| Configuration | Common Cathode (or Common Anode) |
| Forward Voltage (Red) | 1.8V – 2.2V |
| Forward Voltage (Green) | 2.8V – 3.4V |
| Forward Voltage (Blue) | 2.8V – 3.4V |
| Forward Current | 20mA per channel (max) |
| Luminous Intensity (Red) | 800 – 1500mcd |
| Luminous Intensity (Green) | 1000 – 2000mcd |
| Luminous Intensity (Blue) | 800 – 1500mcd |
| Viewing Angle | 30° |
| Operating Temperature | -40°C to +85°C |
| Lead Spacing | 2.54mm (breadboard compatible) |
| Pin | Position | Description |
|---|---|---|
| R | Pin 1 (left) | Red anode |
| GND | Pin 2 (longest) | Common cathode (GND) |
| G | Pin 3 | Green anode |
| B | Pin 4 (right) | Blue anode |
| Pin | Position | Description |
|---|---|---|
| R | Pin 1 (left) | Red cathode |
| VCC | Pin 2 (longest) | Common anode (VCC) |
| G | Pin 3 | Green cathode |
| B | Pin 4 (right) | Blue cathode |
Always use current limiting resistors to protect LED and microcontroller!
| Color | Supply 5V | Supply 3.3V |
|---|---|---|
| Red | 150Ω | 56Ω |
| Green | 100Ω | 33Ω |
| Blue | 100Ω | 33Ω |
Formula: R = (VSupply - VForward) / IForward Example Red @ 5V: R = (5V - 2V) / 0.02A = 150Ω
| RGB LED | Arduino |
|---|---|
| R (Pin 1) | 150Ω → Pin 9 (PWM) |
| GND (Pin 2) | GND |
| G (Pin 3) | 100Ω → Pin 10 (PWM) |
| B (Pin 4) | 100Ω → Pin 11 (PWM) |
| RGB LED | ESP32 |
|---|---|
| R (Pin 1) | 56Ω → GPIO25 |
| GND (Pin 2) | GND |
| G (Pin 3) | 33Ω → GPIO26 |
| B (Pin 4) | 33Ω → GPIO27 |
int redPin = 9;
int greenPin = 10;
int bluePin = 11;
void setColor(int r, int g, int b) {
analogWrite(redPin, r);
analogWrite(greenPin, g);
analogWrite(bluePin, b);
}
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
setColor(255, 0, 0); // Red
delay(1000);
setColor(0, 255, 0); // Green
delay(1000);
setColor(0, 0, 255); // Blue
delay(1000);
setColor(255, 255, 0); // Yellow
delay(1000);
setColor(0, 255, 255); // Cyan
delay(1000);
setColor(255, 0, 255); // Magenta
delay(1000);
setColor(255, 255, 255); // White
delay(1000);
setColor(0, 0, 0); // Off
delay(1000);
}
int redPin = 9;
int greenPin = 10;
int bluePin = 11;
void setColor(int r, int g, int b) {
analogWrite(redPin, r);
analogWrite(greenPin, g);
analogWrite(bluePin, b);
}
void wheel(int pos) {
if (pos < 85) {
setColor(pos * 3, 255 - pos * 3, 0);
} else if (pos < 170) {
pos -= 85;
setColor(255 - pos * 3, 0, pos * 3);
} else {
pos -= 170;
setColor(0, pos * 3, 255 - pos * 3);
}
}
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
for (int i = 0; i < 256; i++) {
wheel(i);
delay(10);
}
}
#define RED_PIN 25
#define GREEN_PIN 26
#define BLUE_PIN 27
void setColor(int r, int g, int b) {
ledcWrite(0, r);
ledcWrite(1, g);
ledcWrite(2, b);
}
void setup() {
ledcSetup(0, 5000, 8); ledcAttachPin(RED_PIN, 0);
ledcSetup(1, 5000, 8); ledcAttachPin(GREEN_PIN, 1);
ledcSetup(2, 5000, 8); ledcAttachPin(BLUE_PIN, 2);
}
void loop() {
setColor(255, 0, 0); delay(500); // Red
setColor(0, 255, 0); delay(500); // Green
setColor(0, 0, 255); delay(500); // Blue
setColor(255, 255, 255); delay(500); // White
}
| Color | Red | Green | Blue |
|---|---|---|---|
| Red | 255 | 0 | 0 |
| Green | 0 | 255 | 0 |
| Blue | 0 | 0 | 255 |
| Yellow | 255 | 255 | 0 |
| Cyan | 0 | 255 | 255 |
| Magenta | 255 | 0 | 255 |
| White | 255 | 255 | 255 |
| Orange | 255 | 165 | 0 |
| Pink | 255 | 20 | 147 |
| Purple | 128 | 0 | 128 |
| Off | 0 | 0 | 0 |
| Feature | Common Cathode | Common Anode |
|---|---|---|
| Common pin | GND | VCC |
| Turn ON | HIGH signal | LOW signal |
| Arduino default | ✅ Easier | Inverted logic |
| Identification | Longest pin → GND | Longest pin → VCC |
៛200
Fast Shipping
Phnom Penh & provinces
7 Day Returns
Hassle-free returns