- 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.
Step #6: Transistor to Ground
Connect the emitter of all three transistors to ground.
- Connect your Arduino to your computer (running Windows, OSX, Linux).
- Open the Arduino program and upload the Arduino code within the following images.
Step #10: 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
Step #13: LED all on or off
All RGB cathodes on or off.