Step #1: SchematicPrevNext
- 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.
Step #2: PrevNext
- 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 #3: Circuit AssemblyPrevNext
- 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.
Step #4: LED to TransistorPrevNext
- 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.
Step #5: Transistor to ResistorPrevNext
- 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.
Step #6: Transistor to GroundPrevNext
Connect the emitter of all three transistors to ground.
Step #7: Resistor to ArduinoPrevNext
- 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.
Step #8: Ground and LED anode to ArduinoPrevNext
- Connect the anode of the LED to pin 12 on the Arduino.
- Connect ground from the Arduino to the ground strip of the breadboard.
Step #9: Arduino ProgramPrevNext
- 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 TestingPrevNext
- 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