Kevin Mehall

RGB LED Rainbow Fader

2007-03-17

I just completed my first project with the Atmel AVR microcontroller. I built a controller for a three color RGB LED. It currently has 4 modes: All Off, Fade Through Rainbow, Blink Primary Colors (RGB), and Blink Through Rainbow. The LEDs are Pulse Width Modulated in software because the ATtiny13 only has 2 channels of hardware PWM. Software PWM doesn't create a problem though, because the software doesn't have to do anything else. All together, the components cost about $5. I'm going to solder it together sometime soon so it can be small enough to fit completely inside the styrofoam ball

Photos

Click on any image to view it bigger

RGB LED Rainbow Fader RGB LED Rainbow Fader RGB LED Rainbow Fader RGB LED Rainbow Fader RGB LED Rainbow Fader RGB LED Rainbow Fader RGB LED Rainbow Fader RGB LED Rainbow Fader RGB LED Rainbow Fader RGB LED Rainbow Fader RGB LED Rainbow Fader

Read on for videos, schematics and code downloads

Videos

All videos are compressed as MPEG4 and RealMedia and are each about 900KB and 30 seconds

Specs

Microcontroller:
Atmel ATtiny13
ATtiny13 Speed:
Left at 1MHz default internal oscillator
LED
SparkFun "Triple Output LED"
Other Components:
3 220 ohm resistors (LED Protection), 0.22uf Mono Capacitor (Power Smoothing), Pushbutton (Changing Modes), 10K Resistor
Power Source:
3 AA Batteries = 4.5 v (Currently in a 4 AA Holder with one battery replaced with aluminum foil)
Power Consumption:
~10ma average while on
0.3ua sleeping
Cover:
Hollow Styrofoam ball

Schematic

schematic

Source Code

Download source and precompiled hex file

The code is licensed under the GNU General Public License and the build environment is based on the one at LinuxFocus and this Instructable. I use the DAPA cable (Instructions to build one are at both of the above links) and AVRDUDE. There is a precompiled .hex file in the tarball if you can't get the compiler working.