What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Project Steps

Schematic

This circuit uses an Arduino UNO but it still works on an Arduino MEGA 2560.

In this project we only use one 5mm LED, but since the LED has four pins, I used three LED symbols in place of the four-pin LED. The three cathodes of the LEDs in the schematic are the three cathodes on the Full-Color 5mm LED. The three anodes of the LEDs are the one anode on the Full-Color 5mm LED.

Remember, the longest pin of the LED is the anode, the other three short pins are the cathodes (RGB)

Also, while the flat side of the transistor is facing you, the left pin is the collector, the middle is the base, and the right pin is the emitter.

The photo notes the 2N2222 transistor. For the 2N3904 and 2N4401, the Collector and Emitter are switched.

Circuit Assembly

Connect the LED to the breadboard.

Connect the anode of the LED to the other half of the breadboard.

Connect the cathode (frist pin) to the other side of the breadboard.

LED to Transistor

Connect the collector of one transistor to the first cathode of the LED.

Connect the other transistors as shown in the image. Connect the collector of the second transistor to the second cathode of the LED.

Connect the collector of the third transistor to the third cathode of the LED.

I’m using the 2N2222 transistor, so in my case the transistor faces my direction. If the 2N3904 or 2N4401 transistor are used, the transistor will face the opposite direction.

Transistor to Resistor

Connect one resistor to the base of the third transistor.

Connect the second resistor to the base of the second transistor.

Connect the third resistor to the base of the first transistor.

Transistor to Ground

Connect the emitter of all three transistors to ground.

Resistor to Arduino

Connect the resistor from the third transistor to pin 9 on the Arduino.

Connect the resistor from the second transistor to pin 10 on the Arduino.

Connect the resistor from the first transistor to pin 11 on the Arduino.

Ground and LED anode to Arduino

Connect the anode of the LED to pin 12 on the Arduino.

Connect ground from the Arduino to the ground strip of the breadboard.

Arduino Program

Connect your Arduino to your computer (running Windows, OSX, Linux).

Open the Arduino program and upload the Arduino code within the following images.

Arduino Serial Monitor Testing

After uploading the code, open the serial monitor and input a character from 1 – 8.

1 = RED, 2 = GREEN, 3 = BLUE

The LED only has three pins for RGB (Red, Green, Blue), but turning on more then one pin creates diverse colors.

4 = PURPLE, 5 = AQUA, 6 = ORANGE, 7 = BRIGHT WHITISH PURPLE

8 = OFF

RGB colors

Normal RGB light settings.

RB, GB, and RG colors

Other RGB settings. RB, GB, or RG.

LED all on or off

All RGB cathodes on or off.