PinLab › Components › RGB LED
RGND (long)GB

RGB LED

three colours in one, common cathode

Three LEDs (red, green, blue) in one package. By mixing intensities with PWM you get any colour.

Open the course →

How it works

Inside are three separate LEDs with a shared lead. With a common cathode (the most common type) the long leg is GND, and R, G, B connect to three PWM pins through a resistor each. With ledcWrite() on each channel you give 0–255 → 16 million combinations.

Pins and wiring

PinWhat it isWhere it connects / why
RRed anodeGPIO (PWM) through 220 Ω.
GND (common cathode)The longest legDirectly to GND.
GGreen anodeGPIO (PWM) through 220 Ω.
BBlue anodeGPIO (PWM) through 220 Ω.

Specifications

VfR ≈ 2.0 V, G ≈ 3.1 V, B ≈ 3.1 V
Current20 mA per colour max
Typecommon cathode or common anode

Tips and typical mistakes