PN 8-038 BA · RS · ME / Regional academic maker initiative

LEDs — red, yellow, green and RGB

All kit LEDs in one article: light indicators, a traffic-light model and RGB colour mixing.

What they are and how they work

The kit contains 17 LEDs: five red, five yellow, five green and two RGB. An LED converts electrical energy into light when current flows in the appropriate direction. A single-colour LED has an anode and cathode and needs a correctly selected series resistor.

An RGB LED contains red, green and blue light channels in one package. Adjusting their brightness mixes different colours. Four leads usually represent three channels and a shared terminal. The image does not establish whether these parts have a common anode or common cathode, or their channel order.

What we can use them for

  • Build a traffic-light model with red, yellow and green signals.
  • Indicate sensor states, task completion or errors with different lights.
  • Mix RGB colours and explore brightness control using PWM.

First exercise

Begin with one single-colour LED and a calculated resistor. Program slow blinking, then add another indicator. For RGB, identify the shared terminal and channels through documentation or measurement and test each separately. Only then combine colours and vary their brightness. Record the connection labels for later exercises.

Handling notes

Each RGB channel needs its own resistor. A shared resistor is unsuitable for independent colour control. Check LED current and GPIO limits. Lead length can help identify polarity but becomes unreliable after trimming. Adapt Arduino examples to ESP32; do not copy 5 V wiring unchanged.

Source: Adafruit — RGB LED connections and individual resistors.