This Instructable covers the assembly of a circuit capable of PWM-ing (pulse width modulating) a 9-12v RGB LED strip and programming an Arduino to cycle through a range of colors. I will discuss how to mount a transistor to a heatsink & assemble the circuit but won't get into soldering as some RGB LED strips come with leads (and there is no shortage of great tutorials out there).
You will need:
- A Microcontroller
- Breadboard or PCB
- RGB LED strip
- Battery (9-12v)
- 3 NPN transistors (I'm using TIP 120s)
- LM7805 Voltage regulator (optional, but recommended)
- (4) 4-40 screws (length, up to you)
- (4) 4-40 nuts
- (4) nylon washers
- 22g hookup wire
Step 1: Brief Explanation of the Electronics
Without getting too technical, its worth knowing that individual strips are made up of 3 LEDs in series which can be cut with clippers at any junction. If you want to cut the strip at any point, just be sure to leave connection points on each halve. To understand how the RGB LED strip can be powered with 9-12V, you need to know the difference between circuits in series vs. parallel (this page has a simple explanation with great illustrations, and there is a popular Instructable that covers wiring LEDs in series & parallel). Basically, when active components are connected in series, their supply voltages are added together. For example, since an average RGB LED requires 3.3 V and 60mA (at full brightness; each color channel draws 20mA, so R-G-B all on at same time is 20 x 3 = 60mA), each strip of 3 RGB LEDs will require approximately 9.9V (the strip I'm using from Jameco can be powered between 9-12V. Be sure to look at your product's datasheet to prevent frying your components. Not all RGB LED strip is powered in the 9-12V range, such as Adafruit's digitally addressable RGB LED strip). One more thing, these strips are "common anode," meaning the LEDs share a positive terminal (read about anode vs. cathode).
Perhaps the greatest take-away is the power limitation of the Arduino. The next section which shows how to use a transistor can be applied to all sorts of other components (ex. motors, solenoids, servos) that require more than 40mA at 5V.
Note: Since I mentioned digitally-addressable strips, its important to recognize a limitation of the strip I'm using - all of the LEDs will behave in the exact same way as you will see. Digitally-addressable RGB LEDs are pretty awesome in that each LED can be accessed individually (check out this cheesy/awesome video)