Have fun with colors by building an RGB LED color mixer. RGB LEDs can emit red, green, and blue light, which can be combined to create a wide range of colors. By controlling the intensity of each color using PWM (Pulse Width Modulation), you'll be able to mix and create various hues.
- Arduino board (e.g., Arduino Uno)
- Common anode RGB LED
- 3 x 220-ohm resistors
- Breadboard
- Jumper wires
- 3 potentiometers (optional for manual control)
- Common anode of RGB LED → 5V (VCC)
- Red pin of RGB LED → 220-ohm resistor → Digital PWM pin 9
- Green pin of RGB LED → 220-ohm resistor → Digital PWM pin 10
- Blue pin of RGB LED → 220-ohm resistor → Digital PWM pin 11
- Connect one terminal of each potentiometer to 5V.
- Connect the opposite terminal to Ground (GND).
- Connect the middle terminal of each potentiometer to Analog pins A0, A1, and A2 respectively.
- Assemble the components as per the circuit diagram.
- Upload the Arduino code to your Arduino board.
- Once the code is uploaded, the RGB LED should start reacting to the potentiometer adjustments.
- By adjusting the potentiometers, you can mix different colors by changing the intensity of red, green, and blue lights.
- The code includes serial print statements to output the PWM values of the red, green, and blue channels to the Serial Monitor. This helps in debugging and understanding the color mixing process.
This Code is Designed by Prince Kushwaha from COSM Electronics.