LED - RGB 5mm Common Cathode RGB LED

SKU: ST6007
5mm clear common cathode RGB LEDs with four legs lit red, green and blue, with product label

LED - RGB 5mm Common Cathode RGB LED

SKU: ST6007
Type
Regular price $0.50
/
  • Free shipping on all orders over $100
  • Secure payments
  • In stock, ready to ship
  • Inventory on the way

Add $100.00 more for free shipping

Tax included. Shipping calculated at checkout.

You'll also need

Tick an item to add it to your cart.

Breadboard 400 holes
$4.49✓ In cart

The 5 mm common cathode RGB LED is a clear, four-leg through-hole LED that mixes red, green and blue light in one package.

Connect the longest leg to GND and drive each colour leg through its own resistor. Turn colours on together to make yellow, cyan, magenta and white. It suits breadboard projects with Arduino, ESP32 and Raspberry Pi Pico.

Type
5 mm RGB LED
Common pin
Cathode (−)
Current
20 mA per colour
Forward voltage
2.0–2.2 V red, 3.0–3.2 V green/blue

Why choose it

  • Three colours in one lens — separate red, green and blue legs let you mix many colours from three pins.
  • One shared ground — the common cathode is the longest leg, so only one wire goes to GND.
  • Works at 5 V and 3.3 V — with the right resistors it runs from Arduino UNO, ESP32 and Raspberry Pi Pico pins.

Specifications

Electrical
Colours Red, green and blue in one package
Common pin Common cathode (−), the longest leg
Forward voltage (red) 2.0–2.2 V
Forward voltage (green, blue) 3.0–3.2 V
Forward current 20 mA per colour
Physical
Package 5 mm round through-hole, 4 legs
Lens Clear (transparent)
Pieces per pack 1

Compatibility

Platform Works Notes
Arduino UNO / Nano (5 V) ✓ Yes Use a resistor on each colour leg (about 220 Ω).
ESP32 / ESP8266 (3.3 V) ✓ Yes Use about 100 Ω on red and 47 Ω on green and blue; green and blue look dimmer at 3.3 V.
Raspberry Pi Pico (3.3 V) ✓ Yes Same resistors as the ESP32.
Software ✓ Yes No library needed: digitalWrite() in Arduino, Pin.value() in MicroPython.

In the box

Included
  • 1 × 5 mm common cathode RGB LED, clear lens

Applications

  • Colour-mixing and PWM learning projects
  • Status indicators that show more than one state
  • Mood-light and decoration prototypes on a breadboard

Tutorial

What you'll build: Light the LED in red, green, blue and the mixed colours yellow, cyan, magenta and white, and print each colour name on your computer · About 15 minutes.

Choose your board

Board Logic voltage Pins used Language Best for
Arduino UNO 5 V D9–D11 C++ First-timers
ESP32 3.3 V GPIO25–27 C++ Wi-Fi later

New to this? Start with the Arduino UNO.

How it works

Inside the clear 5 mm lens are three tiny LEDs: one red, one green and one blue. Each has its own leg, and they share one leg called the common cathode.

  • Common cathode — the shared leg (the longest one). It goes to GND, the return path for the current.
  • Resistor — a small part that limits the current so the LED is not damaged. Every colour leg needs one.
  • Mixing — turn on two or three colours at once to make yellow, cyan, magenta or white.
Arduino UNO Tutorial

You need: Arduino UNO R3, USB cable, a breadboard, 3 × 220 Ω resistors (from the resistor kit), jumper wires.

Wiring diagram: Arduino UNO to 5mm RGB LED through three 220 ohm resistors Arduino UNO5 V logic5mm RGB LEDD9Red leg220ΩD10Green leg220ΩD11Blue leg220ΩGNDLongest leg (−)

■ Power ■ GND ■ Signal ■ I2C / SPI / UART ■ Other ⌒ = wires cross, not connected. This build uses only the signal (yellow) and GND (dark) wires.

# Arduino UNO pin → LED leg Wire Notes
1 D9 → Red leg Yellow Through a 220 Ω resistor
2 D10 → Green leg Yellow Through a 220 Ω resistor
3 D11 → Blue leg Yellow Through a 220 Ω resistor
4 GND → Longest leg (common cathode −) Dark No resistor on this wire

Watch out: Never connect an LED leg straight to a pin without a resistor. About 220 Ω keeps the current under 14 mA per colour at 5 V. Check the pin labels printed on your board.

1
Install the Arduino IDE
Download and install the Arduino IDE (once only).
2
Wire it up
Unplug the USB cable first. Put the LED in the breadboard, add the three resistors and wires exactly as in the diagram and pin table.
3
Find the common cathode
Hold the LED with the clear lens facing up. The longest of the four legs is the common cathode (−); it goes to GND. The other three legs are red, green and blue, one each. If you are not sure which is which, build the circuit as shown, run the sketch below and watch the colours. If a colour appears in a different order from the one printed in the Serial Monitor, swap the resistor wires on those legs.
4
Upload the sketch
Plug in the USB cable. Choose Tools → Board → Arduino AVR Boards → Arduino Uno and Tools → Port → your board. If no port appears, use a data USB cable and install the USB driver for your board. Paste the sketch below and click Upload (the arrow button), then open Tools → Serial Monitor and set 115200 baud.
▸ Example 1 — Colour cycle (Arduino UNO)
// Wiring: D9 -> 220 ohm -> red leg, D10 -> 220 ohm -> green leg,
//         D11 -> 220 ohm -> blue leg, longest leg (common cathode) -> GND
const int RED_PIN   = 9;   // matches the pin table
const int GREEN_PIN = 10;  // matches the pin table
const int BLUE_PIN  = 11;  // matches the pin table

const int STEP_MS = 1000;  // you can change this: time each colour stays on

void show(const char* name, bool r, bool g, bool b) {
  Serial.println(name);                 // print the colour name
  digitalWrite(RED_PIN,   r ? HIGH : LOW);   // common cathode: HIGH = on
  digitalWrite(GREEN_PIN, g ? HIGH : LOW);
  digitalWrite(BLUE_PIN,  b ? HIGH : LOW);
  delay(STEP_MS);
}

void setup() {
  Serial.begin(115200);                 // speed used by the Serial Monitor
  pinMode(RED_PIN, OUTPUT);
  pinMode(GREEN_PIN, OUTPUT);
  pinMode(BLUE_PIN, OUTPUT);
  Serial.println("OK - epartners.co.nz test");
}

void loop() {
  show("Red",     true,  false, false);
  show("Green",   false, true,  false);
  show("Blue",    false, false, true);
  show("Yellow",  true,  true,  false);
  show("Cyan",    false, true,  true);
  show("Magenta", true,  false, true);
  show("White",   true,  true,  true);
  show("Off",     false, false, false);
}

✓ Check: The LED cycles through red, green, blue, yellow, cyan, magenta, white and off, one second each. The Serial Monitor (115200 baud) prints "OK - epartners.co.nz test" once, then the colour name as each colour appears.

ESP32 Tutorial

You need: ESP32 DevKitC (ESP32-WROOM-32) board, USB cable, a breadboard, 1 × 100 Ω and 2 × 47 Ω resistors (from the resistor kit, or the nearest values), jumper wires.

Wiring diagram: ESP32 DevKitC to 5mm RGB LED through one 100 ohm and two 47 ohm resistors ESP32 DevKitC3.3 V logic5mm RGB LEDGPIO25Red leg100ΩGPIO26Green leg47ΩGPIO27Blue leg47ΩGNDLongest leg (−)

■ Power ■ GND ■ Signal ■ I2C / SPI / UART ■ Other ⌒ = wires cross, not connected. This build uses only the signal (yellow) and GND (dark) wires.

# ESP32 pin → LED leg Wire Notes
1 GPIO25 → Red leg Yellow Through a 100 Ω resistor
2 GPIO26 → Green leg Yellow Through a 47 Ω resistor
3 GPIO27 → Blue leg Yellow Through a 47 Ω resistor
4 GND → Longest leg (common cathode −) Dark No resistor on this wire

Watch out: ESP32 pins output 3.3 V only. Green and blue need about 3.0–3.2 V to light, so they look dimmer than at 5 V; that is why they use smaller resistors. Check the pin labels printed on your board.

1
Install the Arduino IDE
Download and install the Arduino IDE (once only).
2
Add the ESP32 board package
Open File → Preferences, paste https://espressif.github.io/arduino-esp32/package_esp32_index.json into “Additional boards manager URLs”, then open Tools → Board → Boards Manager, search for “esp32 by Espressif Systems” and click Install. See the official install guide.
3
Wire it up
Unplug the USB cable first. Build the circuit as in the diagram and pin table.
4
Find the common cathode
Hold the LED with the clear lens facing up. The longest of the four legs is the common cathode (−); it goes to GND. The other three legs are red, green and blue, one each. If you are not sure which is which, build the circuit as shown, run the sketch below and watch the colours. If a colour appears in a different order from the one printed in the Serial Monitor, swap the resistor wires on those legs.
5
Upload the sketch
Plug in the USB cable. Choose Tools → Board → esp32 → ESP32 Dev Module and Tools → Port → your board. If no port appears, use a data USB cable and install the USB driver for your board. Paste the sketch below and click Upload, then open Tools → Serial Monitor at 115200 baud. If the upload fails, set Tools → Upload Speed to 115200 and upload again.
▸ Example 1 — Colour cycle (ESP32)
// Wiring: GPIO25 -> 100 ohm -> red leg, GPIO26 -> 47 ohm -> green leg,
//         GPIO27 -> 47 ohm -> blue leg, longest leg (common cathode) -> GND
const int RED_PIN   = 25;   // matches the pin table
const int GREEN_PIN = 26;  // matches the pin table
const int BLUE_PIN  = 27;  // matches the pin table

const int STEP_MS = 1000;  // you can change this: time each colour stays on

void show(const char* name, bool r, bool g, bool b) {
  Serial.println(name);                 // print the colour name
  digitalWrite(RED_PIN,   r ? HIGH : LOW);   // common cathode: HIGH = on
  digitalWrite(GREEN_PIN, g ? HIGH : LOW);
  digitalWrite(BLUE_PIN,  b ? HIGH : LOW);
  delay(STEP_MS);
}

void setup() {
  Serial.begin(115200);                 // speed used by the Serial Monitor
  pinMode(RED_PIN, OUTPUT);
  pinMode(GREEN_PIN, OUTPUT);
  pinMode(BLUE_PIN, OUTPUT);
  Serial.println("OK - epartners.co.nz test");
}

void loop() {
  show("Red",     true,  false, false);
  show("Green",   false, true,  false);
  show("Blue",    false, false, true);
  show("Yellow",  true,  true,  false);
  show("Cyan",    false, true,  true);
  show("Magenta", true,  false, true);
  show("White",   true,  true,  true);
  show("Off",     false, false, false);
}

✓ Check: The LED cycles through red, green, blue, yellow, cyan, magenta, white and off, one second each. The Serial Monitor (115200 baud) prints "OK - epartners.co.nz test" once, then the colour name as each colour appears.

Troubleshooting

Board Problem Likely cause Fix
All Nothing lights The longest leg is not connected to GND, or a wire is loose Check that the longest leg goes to GND and push every wire in firmly.
All One colour never lights That leg or its resistor is not connected Check the wire and resistor for that colour against the pin table.
All Colours appear in a different order from the Serial Monitor The legs are in a different order from the wiring you used Swap the resistor wires on the legs that are mixed up.
All LED is very bright and gets warm A resistor is missing or too small Unplug the board straight away and fit the correct resistor on every colour leg.
ESP32 Upload fails or stops part-way Upload speed too high for the USB cable or USB chip Tools → Upload Speed → 115200, then upload again.
ESP32 Stuck on “Connecting…” Board not in upload mode Hold the BOOT button until uploading starts.
ESP32 Green and blue look dim 3.3 V is close to their forward voltage This is normal at 3.3 V. Use 47 Ω or the nearest smaller value, or power the LED legs from a 5 V UNO.

Try next: Fade between colours with PWM (analogWrite() on UNO pins D9, D10 and D11), or change the colour from a button or a potentiometer.

Spotted a problem in this tutorial? Email support@epartners.co.nz and we'll check it and update the tutorial.

Good to know
  • Always fit a resistor on each colour leg. Without one the LED can be damaged.
  • This is a common cathode LED: the longest leg goes to GND and a HIGH pin turns a colour on. A common anode LED works the other way round.
  • On 3.3 V boards the green and blue legs sit close to their forward voltage, so they look dimmer than on 5 V.

Resources

Which one should I choose?

Product Key difference Best for
This product (5 mm common cathode RGB LED) Shared leg is the cathode (−); it goes to GND and a HIGH pin turns a colour on Circuits where the common leg is wired to GND
LED RGB - 5mm Common Anode Transparent Red Green Blue LED Shared leg is the anode (+); it goes to the supply and a LOW pin turns a colour on Circuits where the common leg is wired to the supply voltage

FAQ

▸ Is this a common cathode or common anode LED?

It is a common cathode LED. The shared leg is the cathode (−), it is the longest leg, and it connects to GND.

▸ Do I need resistors?

Yes. Put one resistor in series with each colour leg. About 220 Ω works on a 5 V Arduino UNO. On 3.3 V boards such as the ESP32 and Raspberry Pi Pico, about 100 Ω on red and 47 Ω on green and blue works.

▸ Can I use it with an ESP32 or Raspberry Pi Pico?

Yes. Both output 3.3 V. Red lights normally; green and blue look dimmer than at 5 V because their forward voltage is about 3.0–3.2 V.

▸ How do I fade or mix colours smoothly?

Drive each colour leg from a PWM pin. On an Arduino UNO, pins D9, D10 and D11 support analogWrite().

Technical question about this part? Email support@epartners.co.nz with your board and wiring, and we'll help you get it working.

Shipping: $5.99 urban, $9.99 rural. Free shipping on orders of $100 or more.

Order by 10:30am (NZT), Monday to Friday, and we dispatch the same day. Orders placed after 10:30am, on weekends or on public holidays are dispatched the next business day.

Delivery usually takes 1–2 business days after dispatch (2–3 for rural addresses). See our Shipping Policy for full details.

This site is protected by hCaptcha and the hCaptcha Privacy Policy and Terms of Service apply.

Recently viewed