RGB LED (common cathode)
Three LEDs (red, green and blue) in a single body, with a common cathode. Each color needs its own resistor and its own pin; with PWM on each pin you mix the colors.
Pinout
| Pin | Connect to | Note |
|---|---|---|
| R | GPIO (PWM) through the resistor | red |
| GND | GND | longest leg (common cathode) |
| G | GPIO (PWM) through the resistor | green |
| B | GPIO (PWM) through the resistor | blue |
FastMindLocal AI assistant
The AI that remembers your life and lives on your computer
- Long-term memory with the source of every answer
- Works offline: your data stays on your PC
- Reads PDFs, slides, photos and meeting recordings
Essential plan free forever
MicroPython example
from machine import Pin, PWM
import time
r = PWM(Pin(18), freq=1000, duty_u16=0)
g = PWM(Pin(19), freq=1000, duty_u16=0)
b = PWM(Pin(21), freq=1000, duty_u16=0)
# purple: red + blue
r.duty_u16(40000)
b.duty_u16(40000)
time.sleep(1)
Specifications
| Item | Value | Source |
|---|---|---|
| Forward voltage (Vf) | R ~2.0 V · G ~3.0 V · B ~3.0 V | Typical datasheet values — Under review: measure the lab RGB LED |
| Maximum current per color | ~20 mA | Typical datasheet values |
| Variant | a common-anode version exists (the common pin goes to 3V3 and the color lights up with the pin at 0) | Typical datasheet values |
Values marked "Under review" will still be checked against the parts in the lab.