RGB LED Controller

Current Part:

PIC 18F452 Microcontroller
40 MHz Crystal
7805 +5v Regulator
4x 10kΩ Resistor
7x 100Ω Resistor
47uF Capacitor
3x 2N2222
9v Connector
Battery Holder

Parts List Details
           The parts used in this project are virtually the same as with the Fading LEDs via PWM article, we'll use a few more 2n2222 tranistors, resistors and an RGB LED instead of a standard 1 color LED.

PIC 18F452
           This microcontroller built by microchip will serve as the intelligent device for our system, controlling the RGB LED at our will. It will run at a 40 MHz crystal clock speed, which is the maximum for the PIC18F452.

7805 +5 Voltage Regulator
           This +5v regulator will be used create the power supply source for all of the electronics used in this circuit. Since the circuit is very small the actual load placed on this regulator will be small, maybe 100 miliamp.

PICkit 2
           The PICkit 2 is a programmer for the Microchip PIC microcontroller and it has a legacy for being one of the best, even with the 3rd version already available. You will need some programmer to get your programs onto the PIC and this is the one that I suggest.

2N2222 General Purpose Transistor
           This 2N2222 transistor will be used to control the LED state between on and off. The transistor will be connected directly to the microcontroller which will send a signal telling the transistor what state it should be in: on or off.

           This is the common-cathode RGB LED. It has 4 wires coming out of it. The longest wire is the ground pin. The other 3 wires connect to the anode of the Red, Green and Blue LEDs. You can test each portion of the LED by connected a 100Ω resistor a power source (9v battery) and the ground pin to ground.

Jumper Wires & Breadboard
           I prefer to use a breadboard with the projects in my articles because they offer maximum flexibilty with circuit design with minimal downtown between changes. In addition to the breadboard you will need jumper wire to get everything connected together.