Mix colour with the RGB LED
Cycle red, green and blue, then mix all three using PWM on D9, D10 and D11.
Cycle red, green and blue, then mix all three using PWM on D9, D10 and D11.
Use the Uno R3 Learning Kit. Build with power disconnected, check the labelled connections, then upload the supplied sketch. Drag or zoom the 3D model to inspect it from any angle.
Step 1 — Watch the complete build
Press Play for the narrated build. You can rotate and zoom the model while it plays, or follow the individual steps below.
Loading assembly…
Keep U S B disconnected while you build. On this breadboard, each group of five holes shares a connection; the centre channel separates the two halves. You can drag the 3D view to look around. Connect Arduino ground to the ground rail. Add the R G B L E D · common cathode. Its red anode lead goes into column 15 row E; the highlights show the remaining holes. Add the 330 ohms resistor. Its Pin 0 lead goes into column 3 row A; the highlights show the remaining holes. Add the 330 ohms resistor. Its Pin 0 lead goes into column 3 row I; the highlights show the remaining holes. Add the 330 ohms resistor. Its Pin 0 lead goes into column 10 row I; the highlights show the remaining holes. Connect the common cathode to ground. It is shared by all three colour dies. Connect Arduino digital pin 9 to one end of the resistor. Connect the other end of the resistor to the L E D’s red anode lead. Connect Arduino digital pin 10 to one end of the resistor. Connect the other end of the resistor to the L E D’s green anode lead. Connect Arduino digital pin 11 to one end of the resistor. Connect the other end of the resistor to the L E D’s blue anode lead. Check all wiring. Connect the square U S B-B plug to the Uno and the U S B-A plug to your computer. Use Verify and Upload in the code editor below.
Step 2 — Understand the breadboard
Keep USB disconnected while you build. On this breadboard, each group of five holes shares a connection; the centre channel separates the two halves. You can drag the 3D view to look around.
Loading assembly…
Keep U S B disconnected while you build. On this breadboard, each group of five holes shares a connection; the centre channel separates the two halves. You can drag the 3D view to look around.
Step 3 — Connect Uno GND → T- rail 1
Connect Arduino ground to the ground rail.
| Connect | To |
|---|---|
| Uno GND | T- rail 1 |
Loading assembly…
Connect Arduino ground to the ground rail.
Step 4 — Place RGB LED · common cathode
Add the RGB LED · common cathode. Its red anode lead goes into column 15 row E; the highlights show the remaining holes.
Exact breadboard holes
- rgb · red anode → column 15 row E
- rgb · common cathode → column 16 row E
- rgb · blue anode → column 17 row E
- rgb · green anode → column 18 row E
Loading assembly…
Add the R G B L E D · common cathode. Its red anode lead goes into column 15 row E; the highlights show the remaining holes.
Step 5 — Place 330 Ω resistor
Add the 330 Ω resistor. Its Pin 0 lead goes into column 3 row A; the highlights show the remaining holes.
Exact breadboard holes
- rr · Pin 0 → column 3 row A
- rr · Pin 1 → column 7 row A
Loading assembly…
Add the 330 ohms resistor. Its Pin 0 lead goes into column 3 row A; the highlights show the remaining holes.
Step 6 — Place 330 Ω resistor
Add the 330 Ω resistor. Its Pin 0 lead goes into column 3 row I; the highlights show the remaining holes.
Exact breadboard holes
- rb · Pin 0 → column 3 row I
- rb · Pin 1 → column 7 row I
Loading assembly…
Add the 330 ohms resistor. Its Pin 0 lead goes into column 3 row I; the highlights show the remaining holes.
Step 7 — Place 330 Ω resistor
Add the 330 Ω resistor. Its Pin 0 lead goes into column 10 row I; the highlights show the remaining holes.
Exact breadboard holes
- rg · Pin 0 → column 10 row I
- rg · Pin 1 → column 14 row I
Loading assembly…
Add the 330 ohms resistor. Its Pin 0 lead goes into column 10 row I; the highlights show the remaining holes.
Step 8 — Ground the common cathode
Connect the common cathode to ground. It is shared by all three colour dies.
| Connect | To |
|---|---|
| column 16 row A | T- rail 16 |
Loading assembly…
Connect the common cathode to ground. It is shared by all three colour dies.
Step 9 — Connect Uno D9 PWM → column 3 row B
Connect Arduino digital pin 9 to one end of the resistor.
| Connect | To |
|---|---|
| Uno D9 PWM | column 3 row B |
Loading assembly…
Connect Arduino digital pin 9 to one end of the resistor.
Step 10 — Connect column 7 row B → column 15 row A
Connect the other end of the resistor to the LED’s red anode lead.
| Connect | To |
|---|---|
| column 7 row B | column 15 row A |
Loading assembly…
Connect the other end of the resistor to the L E D’s red anode lead.
Step 11 — Connect Uno D10 PWM/SS → column 10 row J
Connect Arduino digital pin 10 to one end of the resistor.
| Connect | To |
|---|---|
| Uno D10 PWM/SS | column 10 row J |
Loading assembly…
Connect Arduino digital pin 10 to one end of the resistor.
Step 12 — Connect column 14 row J → column 18 row A
Connect the other end of the resistor to the LED’s green anode lead.
| Connect | To |
|---|---|
| column 14 row J | column 18 row A |
Loading assembly…
Connect the other end of the resistor to the L E D’s green anode lead.
Step 13 — Connect Uno D11 PWM/MOSI → column 3 row J
Connect Arduino digital pin 11 to one end of the resistor.
| Connect | To |
|---|---|
| Uno D11 PWM/MOSI | column 3 row J |
Loading assembly…
Connect Arduino digital pin 11 to one end of the resistor.
Step 14 — Connect column 7 row J → column 17 row A
Connect the other end of the resistor to the LED’s blue anode lead.
| Connect | To |
|---|---|
| column 7 row J | column 17 row A |
Loading assembly…
Connect the other end of the resistor to the L E D’s blue anode lead.
Step 15 — Place USB-A to USB-B cable · Uno
Check all wiring. Connect the square USB-B plug to the Uno and the USB-A plug to your computer. Use Verify and Upload in the code editor below.
Loading assembly…
Check all wiring. Connect the square U S B-B plug to the Uno and the U S B-A plug to your computer. Use Verify and Upload in the code editor below.
Step 16 — Program your Uno
Choose Arduino Uno. Verify, pair the board and Upload this sketch. Keep USB connected. Cycle red, green and blue, then mix all three using PWM on D9, D10 and D11.
Step 17 — Try it and troubleshoot
Look for three individual colours and a mixed white. Adjust the three PWM levels to balance the white.
If it does not work
If the colour order is wrong, identify the anodes using one resistor and one colour at a time. The three resistors must remain separate.
Parts List
Required Parts (1)
Use the components named in this tutorial. A computer and any additional power supply are not included.
x1
$64.70
In stockProject Summary
1 part total
Unavailable items will be skipped