
The RGB LED Color Mixing project introduces one of the most exciting concepts in electronics: creating multiple colors using a single LED.
Unlike a standard LED that can only produce one color, an RGB LED contains three individual LEDs inside a single package:
By controlling the brightness of each color channel independently using PWM (Pulse Width Modulation), Arduino can mix these colors together to generate a wide variety of colors.
This project introduces:
By the end of this project, you'll understand how displays, LEDs, and smart lighting systems create millions of colors.
Arduino Uno × 1
Breadboard × 1
RGB LED × 1
220Ω Resistor × 3
Jumper Wires × 4
USB Cable × 1
Connect the Arduino GND pin to the negative rail of the breadboard.
This provides a common ground reference for the RGB LED.
Insert the RGB LED into the breadboard.
Ensure all four legs are placed in separate rows.
Connect the Red pin of the RGB LED to Arduino Pin 9 through a 220Ω resistor.
Connect the Green pin of the RGB LED to Arduino Pin 10 through a 220Ω resistor.
Connect the Blue pin of the RGB LED to Arduino Pin 11 through a 220Ω resistor.
Connect the longest leg (Common Cathode) of the RGB LED directly to the breadboard ground rail.
Check all resistor connections and verify that the RGB LED pins are connected to the correct Arduino pins.
Important: This project assumes a Common Cathode RGB LED. If you are using a Common Anode RGB LED, the code logic must be inverted.
Inside setup(), Arduino configures Pin 9, Pin 10, and Pin 11 as output pins.
Each pin controls one color channel of the RGB LED.
Using analogWrite(), Arduino controls the brightness of:
Each channel accepts PWM values between 0 and 255.
Different combinations of Red, Green, and Blue produce different colors.
Examples:
Red + Green = Yellow
Red + Blue = Purple
Green + Blue = Cyan
Red + Green + Blue = White
PWM allows Arduino to control how bright each color channel appears.
By changing brightness levels, millions of unique color combinations can be created.
After uploading the code:
The sequence repeats continuously.
RGB LED Does Not Light Up: Verify the common pin connection and check LED orientation.
Incorrect Colors Appear: Check the wiring of the Red, Green, and Blue pins. Some RGB LEDs use a different pin order.
Only One Color Works: Verify all resistor connections and PWM pin assignments.
Upload Errors: Confirm the correct board and COM port are selected in Arduino IDE.
By completing this project, you have learned:
In Day 6, you'll build an Arduino Traffic Light System and learn how multiple LEDs can be controlled using timing logic and sequencing techniques.