Choosing parts for Arduino projects: the RGB LED example — Select one resistor per channel, identify the common leg and plan your jumper colours before building an RGB LED circuit.

Component selection

Choosing parts for Arduino projects: the RGB LED example

Choosing parts for Arduino projects: the RGB LED example — Select one resistor per channel, identify the common leg and plan your jumper colours before building an RGB LED circuit.

Select one resistor per channel, identify the common leg and plan your jumper colours before building an RGB LED circuit.

22 November 20264 min read
Choosing parts for Arduino projects: the RGB LED example — Arduino and breadboard circuit diagram
Breadboard layout, components and jumper connections for this circuit.

Bu projeyi gerçekten kurmak istersen parçaları hobidevre.com'dan temin edebilirsin →

Build it for real

To build this project for real, get the parts from hobidevre.com → hobidevre.com →

More build guides: hobidevre.com/blog

Create a free account — save your progress and get more circuits →

Save your progress

What it does

A four leg RGB LED contains three separate colour channels that you drive independently. Each channel connects to a digital pin through its own series resistor, and the common leg goes to ground. Changing the brightness ratio of the three channels produces primary colours as well as intermediate tones. The circuit shows how light colours add together and how digital outputs can be controlled gradually. On the breadboard the three resistors and the LED sit side by side and each wire is a different jumper colour so the channels stay distinguishable. With one channel on you see a pure colour, with two on an intermediate colour, and with all three on a near white tone.

Parts you need

Use the following parts to build this circuit:

  • Control board × 1 — Drives the three channels independently.
  • Four-leg RGB LED × 1 — Combines three colour channels in one package.
  • 220 Ω resistor × 3 — Limits the current of each colour channel.
  • Jumper wire × 8 — Makes the channel and ground connections.
  • Ground (GND) × 1 — Common cathode reference.

Build it step by step

  1. Place the RGB LED and the three resistors on the breadboard.Separate the four legs according to the pin order.
  2. Connect the red channel through a 220 Ω resistor to pin 1.The resistor must come before the LED.
  3. Connect the green channel through its own resistor to pin 2.Every channel uses a separate resistor.
  4. Connect the blue channel through its own resistor to pin 3.Use a different jumper colour for each channel.
  5. Connect the common cathode leg to ground and ground to the board GND pin.Without the common leg no channel will light.
  6. Turn channels on one at a time and then together to watch the colour mix.Red plus green gives yellow; all three give near white.

How it works

An RGB LED contains three separate diodes that produce red, green and blue light in one package. The three channels are independent and each is driven through its own series resistor. The resistor keeps the channel current in a safe range and prevents damage. When the common cathode leg is tied to ground, a signal on the matching pin makes that channel conduct. With two channels on at once the eye combines the two colours into an intermediate tone, and with all three on the result is close to white. By setting different brightness ratios you can produce many intermediate tones. This is the basis of colour indicator panels and ambient lighting.

What you learn

  • Explain how the three colour channels are driven independently.
  • State why each channel needs its own series resistor.
  • Understand that colour mixing is additive light.
  • Recognise the role of the common cathode connection.

Tips

  • If one channel stays dark, check that channel resistor and its pin order first.
  • Choose resistors of the same value so the colours mix evenly.
  • If the common leg is not tied to ground, no colour will appear.

Try it yourself

  • Light only the red channel, then add the green channel.
  • Turn on red and blue together and record the resulting colour.
  • Turn on all three channels and observe the near white tone.

Expected result: A single channel gives a pure colour; more than one channel gives an intermediate tone.

Get the parts

If you want to build this project in real life, you can get the parts from hobidevre.com.

Frequently asked questions

What is this circuit for?

A four leg RGB LED contains three separate colour channels that you drive independently. Each channel connects to a digital pin through its own series resistor, and the common leg goes to ground. Changing the brightness ratio of the three channels produces primary colours as well as intermediate tones. The circuit shows how light colours add together and how digital outputs can be controlled gradually. On the breadboard the three resistors and the LED sit side by side and each wire is a different jumper colour so the channels stay distinguishable. With one channel on you see a pure colour, with two on an intermediate colour, and with all three on a near white tone.

How does it work?

An RGB LED contains three separate diodes that produce red, green and blue light in one package. The three channels are independent and each is driven through its own series resistor. The resistor keeps the channel current in a safe range and prevents damage. When the common cathode leg is tied to ground, a signal on the matching pin makes that channel conduct. With two channels on at once the eye combines the two colours into an intermediate tone, and with all three on the result is close to white. By setting different brightness ratios you can produce many intermediate tones. This is the basis of colour indicator panels and ambient lighting.

What should I see at the end?

A single channel gives a pure colour; more than one channel gives an intermediate tone.

Related reading

Try the circuit in the browser

Open the same layout in the simulator, inspect the connections and follow the steps.