RGB LED
Atoms

RGB LED

Overview

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.

Specifications

ParameterValue
TypeRGB LED (Red + Green + Blue)
Package5mm Through-hole
ConfigurationCommon 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 Current20mA per channel (max)
Luminous Intensity (Red)800 – 1500mcd
Luminous Intensity (Green)1000 – 2000mcd
Luminous Intensity (Blue)800 – 1500mcd
Viewing Angle30°
Operating Temperature-40°C to +85°C
Lead Spacing2.54mm (breadboard compatible)

Pin Configuration

Common Cathode (Most Common)

PinPositionDescription
RPin 1 (left)Red anode
GNDPin 2 (longest)Common cathode (GND)
GPin 3Green anode
BPin 4 (right)Blue anode

Common Anode

PinPositionDescription
RPin 1 (left)Red cathode
VCCPin 2 (longest)Common anode (VCC)
GPin 3Green cathode
BPin 4 (right)Blue cathode

Features

  • 3-in-1 package — Red, Green, Blue in single 5mm LED
  • Full color mixing — 16 million+ colors via PWM
  • Common cathode and anode variants available
  • Breadboard friendly — 2.54mm standard pitch
  • 5mm standard package — fits all standard LED holders
  • Low power — 20mA max per channel
  • Wide viewing angle — 30° viewing cone
  • PWM compatible — smooth color transitions with microcontrollers
  • Easy to use — simple resistor + GPIO wiring

Required Resistors

Always use current limiting resistors to protect LED and microcontroller!

ColorSupply 5VSupply 3.3V
Red150Ω56Ω
Green100Ω33Ω
Blue100Ω33Ω

Formula: R = (VSupply - VForward) / IForward Example Red @ 5V: R = (5V - 2V) / 0.02A = 150Ω

Wiring (Common Cathode — Arduino)

RGB LEDArduino
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)

Wiring (Common Cathode — ESP32)

RGB LEDESP32
R (Pin 1)56Ω → GPIO25
GND (Pin 2)GND
G (Pin 3)33Ω → GPIO26
B (Pin 4)33Ω → GPIO27

Arduino Code — Basic Colors

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);
}

Arduino Code — Rainbow Fade

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);
  }
}

ESP32 Code (LEDC PWM)

#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
}

Common Color Mixing Reference

ColorRedGreenBlue
Red25500
Green02550
Blue00255
Yellow2552550
Cyan0255255
Magenta2550255
White255255255
Orange2551650
Pink25520147
Purple1280128
Off000

Common Cathode vs Common Anode

FeatureCommon CathodeCommon Anode
Common pinGNDVCC
Turn ONHIGH signalLOW signal
Arduino default✅ EasierInverted logic
IdentificationLongest pin → GNDLongest pin → VCC

⚠️ Important Notes

  • ALWAYS use resistors — never connect LED directly to GPIO or 5V
  • Identify type first — Common Cathode vs Common Anode before wiring
  • Max 20mA per channel — exceeding damages LED and microcontroller
  • PWM for color mixing — digitalWrite only gives ON/OFF, use analogWrite
  • Longest lead — always the common pin (cathode or anode)
  • 3.3V systems — use smaller resistors (56Ω red, 33Ω green/blue)
  • Do not exceed total 40mA from any Arduino/ESP32 GPIO pin

Applications

  • Status indicator lights
  • Color-coded alerts and notifications
  • Mood and ambient lighting
  • RGB display backlight
  • Color mixing experiments
  • Traffic light simulation
  • Arduino and ESP32 learning projects
  • Interactive art and displays
  • Smart home color indicators
  • Robot eye and expression displays
  • Decorative electronics projects
$0.08$0.05Save $0.03

៛200

1000 in stock
Quantity
1
Buy Now
🚚

Fast Shipping

Phnom Penh & provinces

↩️

7 Day Returns

Hassle-free returns