Project Overview
Arduino RGB Color Mixer: Three Knobs, 16 Million Colors: Build an Arduino Uno RGB LED color mixer using three potentiometers, where each knob controls one PWM channel to blend any color and print the live RGB recipe to Serial.
This is a hands-on lesson in PWM, analog input, and additive color mixing, the same basics used in screens and LED lighting projects.
- Time: ~45 minutes
- Skill level: Beginner
- What you will build: A physical color picker with red, green, and blue knobs and live RGB values you can copy into any design tool.
Parts List
From ShillehTek
- Arduino Uno R3 Super Starter Kit - includes the RGB LED, potentiometers, button, and resistors
- Resistor Kit - 220a9 per color channel, 10Ω for the button
- Tactile Button Kit - the on/off toggle
- 830-Point Breadboard - room for three pots
- Dupont Jumper Wires - quick breadboard wiring
External
- Ping-pong ball or paper cup - diffuser that blends the three LED dies into one smooth color
Note: A common-cathode RGB LED is three LEDs sharing one ground. PWM each anode at 0 6255 and your eyes blend the channels (additive color mixing), the same principle used by displays.
Step-by-Step Guide
Step 1 - Wire LED, Pots, and Button
Goal: Connect three analog inputs and three PWM outputs.
What to do: Wire the RGB LED so red goes to D9, green to D10, and blue to D11, each through a 220a9 resistor. Connect the LED common cathode to GND.
Wire three potentiometers with the outer legs to 5V and GND. Connect the wipers to A0 (red), A1 (green), and A2 (blue).
Wire the button from D7 to GND with a 10Ω pull-up, or use INPUT_PULLUP in code and skip the resistor.
Expected result: Your circuit is ready for live color mixing.
Step 2 - Upload the Mixer Sketch
Goal: Convert 10-bit analog readings into 8-bit PWM values.
Code:
const int R_PIN = 9, G_PIN = 10, B_PIN = 11;
const int R_POT = A0, G_POT = A1, B_POT = A2;
const int BTN = 7;
bool on = true;
void setup() {
Serial.begin(9600);
pinMode(BTN, INPUT_PULLUP);
}
void loop() {
if (digitalRead(BTN) == LOW) { // toggle on/off
on = !on;
delay(250); // crude debounce
}
// analogRead gives 0-1023; PWM wants 0-255 -> divide by 4
int r = on ? analogRead(R_POT) / 4 : 0;
int g = on ? analogRead(G_POT) / 4 : 0;
int b = on ? analogRead(B_POT) / 4 : 0;
analogWrite(R_PIN, r);
analogWrite(G_PIN, g);
analogWrite(B_PIN, b);
Serial.print("RGB("); // copy this into any design tool
Serial.print(r); Serial.print(", ");
Serial.print(g); Serial.print(", ");
Serial.print(b); Serial.println(")");
delay(100);
}
What to do: Upload the sketch, then twist the knobs. Dividing by 4 converts the 0 61023 ADC range into the 0 6255 PWM range.
Expected result: The LED changes color smoothly, and Serial Monitor prints RGB(r, g, b) values as you adjust the knobs.
Step 3 - Add a Diffuser
Goal: Blend the three LED points into one solid-looking color.
What to do: Place a ping-pong ball or paper cup over the RGB LED to diffuse the light and blend the channels.
Expected result: A single smooth glow instead of three visible dots.
Step 4 - Use the Printed RGB Recipes
Goal: Transfer real-world knob settings into digital color values.
What to do: Dial in a color you like, read its RGB() values from Serial, and paste them into CSS, Figma, or other LED projects.
Expected result: A physical color picker that produces copyable RGB values for your designs and builds.
Conclusion
You built an Arduino Uno RGB LED color mixer using three potentiometers to control PWM output, plus a button toggle and a Serial readout of the exact RGB recipe. This same workflow is a foundation for LED lighting projects and understanding additive color.
Want the exact parts used in this build? Grab them from ShillehTek.com. If you want help customizing this project or building something for your product, check out our IoT consulting services.
Credits
All photos and images in this tutorial are credited to FIELDING on Hackster.io. The original guide by FIELDING served as the reference for this ShillehTek version. We thank them for the excellent work in the maker community.







