RGB LED Controller

Project Info
Author: Chris
Difficulty: Easy
Time Invested: 3 Hours

Take a look at the above
articles before continuing
to read this article.
           A very popular type of LED that has finally come about is the tri-color, RGB LED. The RGB stands for: red, green and blue since the LED is capable of displaying all three colors, independently. This means that an RGB LED can display any color of the rainbow. This is a powerful capability, but it also requires more control.
           In this article, we shall look at how to build an RGB LED controller so that we have accurate and independant control over all three colors at any instant. The method of Fading LEDs via PWM will be leveraged for this design, since our goal here is quite similar, but with more control paths.

RGB LED Controller - Demonstration

RGB LED Controller - Setup

Purpose & Overview of this project
           The purpose of this project is to build an RGB LED controller that can display all the colors of the rainbow is a slow, but methodical motion. A microcontroller should be used with 3 digital outputs. An interrupt timer routine will be used to keep track of elapsed time, along with counters to know what duty cycle the PWM control should be outputting.
           The PIC 18F452 will be used as the microcontroller of this project with a 40 MHz crystal clock. Running this fast will allow the microcontroller a greater resolution of control for the PWM's duty cycle. A common-cathode high intensity RGB LED will be used with 3 2N2222 general purpose transistors to control switching when the R/G/B portions of the LED should be connected to power or ground.