5mm RGB LED – Common Anode (4 Pin)
1. What Is a Common Anode RGB LED?
The Common Anode RGB LED is a multicolour light-emitting diode that combines three individual LED elements — red, green and blue — inside a single 5mm package.
In a common anode configuration, the positive terminals of all three LED elements share a common electrical connection, while the negative terminals are controlled independently.
By adjusting the brightness of each colour channel, you can produce different colours and lighting effects for electronics, robotics and interactive projects.
2. What Can You Build With a Common Anode RGB LED?
This 5mm RGB LED is suitable for applications such as:
- Colour-changing LED lights
- Electronic mood lighting
- Robotics status indicators
- Arduino RGB lighting projects
- ESP32-controlled lighting systems
- Sensor-based colour indicators
- Interactive electronic devices
- Decorative lighting circuits
- Custom PCB projects
- Educational electronics experiments
3. Who Is It For?
The Common Anode RGB LED is suitable for:
- Beginners learning electronics
- School and engineering students
- Arduino and ESP32 enthusiasts
- Robotics hobbyists
- PCB designers
- STEM educators
- DIY electronics makers
4. How Does a Common Anode RGB LED Work?
An RGB LED contains three individual light-emitting elements that produce red, green and blue light.
In a common anode RGB LED, all three LED elements share a positive terminal connected to a suitable positive power supply.
Each colour channel illuminates when its negative terminal is driven LOW through an appropriate current-limiting resistor.
When using a compatible microcontroller with matching supply and logic voltages:
- LOW signal: LED channel turns ON
- HIGH signal: LED channel turns OFF
PWM (Pulse Width Modulation) allows you to adjust the brightness of individual colour channels.
| Red | Green | Blue | Result |
|---|---|---|---|
| ON | OFF | OFF | Red |
| OFF | ON | OFF | Green |
| OFF | OFF | ON | Blue |
| ON | ON | OFF | Yellow |
| ON | OFF | ON | Magenta |
| OFF | ON | ON | Cyan |
| ON | ON | ON | Approximate white |
| OFF | OFF | OFF | No illumination |
The resulting colour depends on the relative brightness of each LED channel.
5. Technical Specifications
| Specification | Details |
|---|---|
| Product Type | RGB Light-Emitting Diode |
| LED Diameter | 5mm |
| LED Colours | Red, Green and Blue |
| Configuration | Common Anode (CA) |
| Number of Pins | 4 |
| Mounting Type | Through-hole |
| Control Method | Independent channel control / PWM |
| Activation Logic | Active LOW with compatible driving circuitry |
| Red Forward Voltage | Typically 1.8–2.2V |
| Green Forward Voltage | Typically 3.0–3.4V |
| Blue Forward Voltage | Typically 3.0–3.4V |
| Addressable LED | No |
| Current Limiting | External resistors required |
Forward voltage values are typical reference values for comparable RGB LEDs. Actual electrical characteristics may vary depending on the manufacturer.
6. Common Anode RGB LED Pinout
The Common Anode RGB LED features four electrical terminals.
| Terminal | Function |
|---|---|
| R | Red LED cathode (−) |
| G | Green LED cathode (−) |
| B | Blue LED cathode (−) |
| COM | Common anode (+) |
The longest terminal is typically the common anode.
Always verify the physical pin arrangement using the manufacturer’s datasheet, a multimeter or a suitable current-limited test circuit before connecting the LED.
7. How to Connect a Common Anode RGB LED to Arduino
The Common Anode RGB LED can be controlled using three PWM-capable digital output pins on an Arduino Uno.
Required components:
- Common Anode RGB LED
- Arduino Uno
- 3 × Current-limiting resistors
- Breadboard
- Jumper wires
Wiring connections:
| RGB LED Terminal | Arduino Uno |
|---|---|
| Red | D9 through a resistor |
| Green | D10 through a resistor |
| Blue | D11 through a resistor |
| Common Anode | 5V |
For a basic 5V Arduino Uno experiment, three individual 330Ω resistors are a practical starting point, subject to the LED’s electrical ratings.
Do not connect the LED directly to a power supply without suitable current-limiting resistors.
8. Arduino Example Code
The following program demonstrates different colours using a Common Anode RGB LED.
const int redPin = 9;
const int greenPin = 10;
const int bluePin = 11;
void setup() {
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, HIGH);
digitalWrite(bluePin, HIGH);
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void setColor(int red, int green, int blue) {
analogWrite(redPin, 255 - red);
analogWrite(greenPin, 255 - green);
analogWrite(bluePin, 255 - blue);
}
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(255, 0, 255); // Magenta
delay(1000);
setColor(0, 255, 255); // Cyan
delay(1000);
setColor(255, 255, 255); // White
delay(1000);
setColor(0, 0, 0); // OFF
delay(1000);
}
The program changes the colour of the RGB LED every second.
Unlike a common cathode RGB LED, the PWM output values are inverted using 255 - value because the common anode configuration uses active-LOW control.
9. Beginner Project: Touch-Controlled RGB LED
Build a colour-changing light using a Common Anode RGB LED and a TTP223 Touch Sensor Module.
Components required:
- 1 × Common Anode RGB LED
- 1 × Arduino Uno
- 1 × TTP223 Touch Sensor Module
- 3 × Current-limiting resistors
- Breadboard
- Jumper wires
Wiring:
- RGB LED common anode → Arduino 5V
- Red channel → D9 through a resistor
- Green channel → D10 through a resistor
- Blue channel → D11 through a resistor
- TTP223 signal output → D2
- TTP223 VCC → Compatible power supply
- TTP223 GND → Arduino GND
Program the Arduino to change the RGB LED colour each time the touch sensor is activated.
Red → Green → Blue → Yellow → Cyan → Magenta → White → OFF
Detect each new touch rather than continuously changing colours while the sensor remains activated.
This project teaches capacitive touch sensing, digital inputs, PWM output, colour mixing and conditional programming.
10. Related Products
Complete your electronics project with:
- 5mm RGB LED – Common Cathode
- RGB LED Module – HW-478
- Arduino Uno R3 Compatible Programmable Board
- ESP32 Development Board
- TTP223 Touch Sensor Module
- 6x6x5mm Tactile Push Button Switch
- Sound Sensor Module
- 330Ω Resistors
- Breadboard
- Jumper Wires
11. Related Tutorials
Explore these electronics project ideas:
- How to Connect a Common Anode RGB LED to Arduino
- Common Anode vs Common Cathode RGB LEDs
- How to Control an RGB LED Using ESP32
- Understanding RGB Colour Mixing
- How to Build a Colour-Changing LED
- PWM Brightness Control Using Arduino
- How to Calculate LED Current-Limiting Resistors
- How to Build a Touch-Controlled RGB Light
12. Frequently Asked Questions
What is a Common Anode RGB LED?
A Common Anode RGB LED is a multicolour LED in which the red, green and blue light-emitting elements share a common positive electrical connection.
What is the size of this RGB LED?
This RGB LED has a diameter of 5mm.
How many pins does a Common Anode RGB LED have?
It has four pins: three individual colour terminals and one common anode terminal.
What is the difference between common anode and common cathode RGB LEDs?
A common anode RGB LED shares a positive connection and uses active-LOW control. A common cathode RGB LED shares a negative connection and uses active-HIGH control.
Does a Common Anode RGB LED require resistors?
Yes. Each colour channel requires a separate, suitable current-limiting resistor.
Can I use this RGB LED with Arduino?
Yes. It can be controlled using Arduino digital and PWM-capable output pins with appropriate current-limiting resistors.
Can I use a Common Anode RGB LED with ESP32?
Yes, provided the supply voltage, LED forward voltages and driving circuit are compatible. Do not connect a 5V common-anode circuit directly to ESP32 GPIO pins.
Can an RGB LED produce white light?
Yes. Combining red, green and blue illumination can produce an approximate white colour.
Does this RGB LED automatically change colours?
No. The individual colour channels must be controlled using an external electronic circuit or microcontroller.
Are common anode and common cathode RGB LEDs interchangeable?
Not directly. They have different electrical connections and control logic.
Where can I buy a Common Anode RGB LED in Surat?
You can purchase the Common Anode RGB LED online from Yagobotix with same-day delivery and pickup available in Surat.
13. What Is Included?
- 1 × 5mm RGB LED – Common Anode (4 Pin)
Resistors, microcontroller boards, breadboards, jumper wires and other accessories are not included.
14. Compatibility
The Common Anode RGB LED can be used in suitable electronic circuits involving:
- Arduino Uno
- Arduino Nano
- Arduino Mega
- ESP32
- ESP8266
- Raspberry Pi
- Custom PCB designs
- Standalone LED control circuits
Always use suitable driving circuitry and individual current-limiting resistors based on the LED and controller specifications.
15. Buy Common Anode RGB LED Online in India
Add multicolour lighting effects to your next electronics project with the Common Anode RGB LED from Yagobotix.
Its compact 5mm design and independently controlled colour channels make it suitable for robotics, colour-changing lights, electronic indicators and educational electronics projects.
Order online with shipping across India and same-day delivery or pickup available in Surat, subject to stock availability and applicable order cut-off times.
Add to cart and bring colour to your next electronics project with Yagobotix!





There are no reviews yet.