Skip to content
Intermediate 2.5 hours

Arduino RGB Colour Mixer with Three Potentiometers

By Amit1379
July 13, 2026

This project demonstrates how RGB LEDs work — they contain three separate LEDs (red, green, blue) in one package. By controlling each colour’s brightness independently using PWM (Pulse Width Modulation) on the Arduino, you can mix over 16 million colours. Three potentiometers give hands-on, analogue control of each channel.

What You’ll Need

  • Arduino Uno
  • Common-cathode RGB LED (4-pin)
  • 3 × 100 Ω resistors (one per LED colour pin)
  • 3 × 10 kΩ potentiometers
  • Breadboard and jumper wires
  • 16×2 I2C LCD or serial monitor for displaying RGB values (optional)

Step-by-Step Instructions

  1. Wire the RGB LED: The longest pin (common cathode) goes to GND. The remaining three pins are Red, Green, Blue. Connect each through a 100 Ω resistor to Arduino PWM pins 9 (R), 10 (G), 11 (B).
  2. Wire potentiometers: Each pot: outer pins to 5 V and GND, centre wiper to A0 (Red pot), A1 (Green), A2 (Blue).
  3. Write the sketch:
    void loop() {
      int r = analogRead(A0) / 4;  // 0-1023 → 0-255
      int g = analogRead(A1) / 4;
      int b = analogRead(A2) / 4;
      analogWrite(9, r);
      analogWrite(10, g);
      analogWrite(11, b);
      delay(20);
    }
  4. Optionally display values: Print R, G, B values to Serial Monitor or LCD so you can record colour codes for specific mixes.
  5. Experiment: Turn all three to maximum for white, all to zero for off. Try red+green=yellow, red+blue=magenta, green+blue=cyan.

Safety Notes

  • Always use current-limiting resistors with each LED pin — driving without resistors will destroy the LED and potentially the Arduino output pin.
  • Common-anode RGB LEDs wire differently — the long pin goes to 5 V and logic is inverted (write 0 for full brightness). Check your specific LED datasheet.

Tips & Troubleshooting

  • If one colour is much brighter than others, reduce its resistor value to compensate for different LED efficiencies.
  • Extend this into a colour-picker that saves favourite colours to EEPROM and replays them on button press.
  • Use a capacitive touch sensor instead of potentiometers for a more modern control method.

Leave a Comment

Your email address will not be published. Required fields are marked *