Skip to content

RGB LED Color Mixer

Mix three independently driven PWM channels in a common-cathode RGB LED.

RGB LED Color Mixer: the matching Arduino Uno circuit rendered in Circuitera’s simulator
Matching Circuitera simulator circuit. Real firmware capture; modeled components are idealized.

Wire it up

Disconnect power before changing connections. Follow terminal names rather than wire colors.

FromToWhy it matters
RGB LED (rgb1) · COMUno · GND.1Ground reference
Uno · 9Resistor (r0) · 1Match this terminal to the sketch
Resistor (r0) · 2RGB LED (rgb1) · RMatch this terminal to the sketch
Uno · 10Resistor (r1) · 1Match this terminal to the sketch
Resistor (r1) · 2RGB LED (rgb1) · GMatch this terminal to the sketch
Uno · 11Resistor (r2) · 1Match this terminal to the sketch
Resistor (r2) · 2RGB LED (rgb1) · BMatch this terminal to the sketch

The complete sketch

rgb-color-mixer.ino
void setup() {
  pinMode(9, OUTPUT); pinMode(10, OUTPUT); pinMode(11, OUTPUT);
}
void loop() {
  analogWrite(9, 128);   // red
  analogWrite(10, 64);   // green
  analogWrite(11, 192);  // blue
}

The launch buttons use this same code and a matching saved circuit.

Build it step by step

  1. Open a complete project

    Launch in Simulator creates a separate Uno sketch and its matching wired circuit. Existing sketches are preserved. Press Run to compile and execute.

  2. Explore the live circuit

    Change one channel value, rerun, and compare the mixed color. Zero switches that channel off.

  3. Try it on hardware

    Disconnect power while wiring. Match terminal names in the table, select the exact board, Verify, then connect and upload. Check component ratings and power requirements first.

Understand the sketch

Three LEDs in one package

R, G, and B each need a current-limiting resistor. COM is connected to ground for this common-cathode project. A common-anode LED needs different wiring and inverted duty cycles.

If something is different

Unexpected colors

Use the named R/G/B/COM terminals. Physical lead order varies; check the exact LED pinout.

Expected output and tested scope

The red, green and blue PWM channels combine into changing modeled colors.

Version 1 · Last source- and build-matched test: 2026-10-25. Actual shipped AVR-GCC WASM compilation and Uno AVR engine execution; no physical hardware test.

Supported tutorial target: Arduino Uno R3 / ATmega328P. Compile: PASS · Modeled execution: PASS. Other boards require a separate review of pins, voltage, libraries and the exact build profile.

Keep exploring.