Display PWM

RGB LED

An RGB LED packages red, green, and blue LEDs together so a circuit can mix colors by controlling each channel.

Part images

RGB LED. Three LEDs in one package for color mixing. Image source: SunFounder Pico 2 W Starter Kit documentation, Components section, © 2026 SunFounder.
Color mixing. Red, green, and blue channels combine into many colors. Image source: SunFounder Pico 2 W Starter Kit documentation, Components section, © 2026 SunFounder.
RGB LED symbol. The symbol shows three LED channels in one part. Image source: SunFounder Pico 2 W Starter Kit documentation, Components section, © 2026 SunFounder.
RGB LED pinout. SunFounder pin reference for the common cathode RGB LED. Image source: SunFounder Pico 2 W Starter Kit documentation, Components section, © 2026 SunFounder.
KY-009 Module Photo. Module Photo for the KY-009 Full Color SMD RGB LED Module. Image source: Joy-IT SensorKit KY-009 module documentation
KY-009 Pinout / Module Diagram. Pinout / Module Diagram for the KY-009 Full Color SMD RGB LED Module. Image source: Joy-IT SensorKit KY-009 module documentation
KY-009 Arduino Wiring Diagram. Arduino Wiring Diagram for the KY-009 Full Color SMD RGB LED Module. Image source: Joy-IT SensorKit KY-009 module documentation
KY-009 Raspberry Pi Wiring Diagram. Raspberry Pi Wiring Diagram for the KY-009 Full Color SMD RGB LED Module. Image source: Joy-IT SensorKit KY-009 module documentation
KY-016 Module Photo. Module Photo for the KY-016 3-Color LED Module. Image source: Joy-IT SensorKit KY-016 module documentation
KY-016 Pinout / Module Diagram. Pinout / Module Diagram for the KY-016 3-Color LED Module. Image source: Joy-IT SensorKit KY-016 module documentation
KY-016 Arduino Wiring Diagram. Arduino Wiring Diagram for the KY-016 3-Color LED Module. Image source: Joy-IT SensorKit KY-016 module documentation
KY-016 Raspberry Pi Wiring Diagram. Raspberry Pi Wiring Diagram for the KY-016 3-Color LED Module. Image source: Joy-IT SensorKit KY-016 module documentation
KY-034 Module Photo. Module Photo for the KY-034 Automatic Flashing Color LED Module. Image source: Joy-IT SensorKit KY-034 module documentation
KY-034 Pinout / Module Diagram. Pinout / Module Diagram for the KY-034 Automatic Flashing Color LED Module. Image source: Joy-IT SensorKit KY-034 module documentation
KY-034 Arduino Wiring Diagram. Arduino Wiring Diagram for the KY-034 Automatic Flashing Color LED Module. Image source: Joy-IT SensorKit KY-034 module documentation
KY-034 Raspberry Pi Wiring Diagram. Raspberry Pi Wiring Diagram for the KY-034 Automatic Flashing Color LED Module. Image source: Joy-IT SensorKit KY-034 module documentation

What it is

An RGB LED packages red, green, and blue LEDs together so a circuit can mix colors by controlling each channel.

How students use it

Students use it for color indicators, mood lights, feedback states, and PWM color-mixing projects.

Pins and power

Four pins: common cathode plus red, green, and blue. SunFounder notes the longest pin is the common cathode; the adjacent left pin is red, and the two right pins are green and blue.

Common cathode RGB LED. Each color channel needs its own current-limiting resistor.

The kit uses a common cathode RGB LED, so the shared pin goes to GND and each color pin is driven high through current limiting.

Voltage and safety

Each color has a different forward voltage, so resistor values and brightness can differ by channel.

Do not drive any color channel without current limiting. Keep total current within Pico and power-source limits.

Datasheet notes

SunFounder lists: common cathode, 5mm clear round lens, red forward voltage DC 2.0-2.2V, blue/green DC 3.0-3.2V at 20mA, 0.06W DIP RGB LED, and 30 degree viewing angle.

Common libraries

Use three PWM outputs with machine.PWM for color mixing.

Common mistakes

Treating it like one LED, using only one resistor on the common pin, mixing up common anode and common cathode code, and swapping red/green/blue pins.