Starting in 2009 for Halloween, we needed a realistic looking flickering light effect that would mimic an actual fire torch, but not use real flame.
I'd also been wanting to experiment with using AVR Microcontrollers for some time, and this seemed like a good opportunity to get started.
The controller design is such that it can be used for many other things in the future, so it is massive overkill, but I will present that here as well.
Step 1: The Controller Design Schematic
The controller is based on an ATMega324P in a 44 pin TQFP package. The schematic was drawn in gEDA's gschem tool. Looking at the schematic which is attached in both PNG and in gEDA/gschem format.
An RGB common anode LED is connected at CONN2, this is a 3W model from Everlight that I found surplus. Each segment of this LED can handle 3W so it was necessary to drive the cathodes with power transistors Q4,A5, and Q6. This particular AVR was chosen since it brings out 3 PWM channels of the internal timers to pins. This allows independent brightness control of the R,G, and B color channels.
Both an ISP header (J9) and JTAG (J12) are brought out for programming and debugging. Only the ISP header is required, but I wanted to experiment with JTAG as well.
The CPU (U1) is clocked by a 20MHz crystal, X1.
The board is powered by 5V, with the option of a 12V pass-through at a later time.
Other functions that are not needed for this purpose include U2 a ULN2803A high power buffer for driving other loads from Port A of the CPU, as well as 3 channels that can drive relays at 12 V on J2, J3, and J4. The other timer outputs that are not used are pinned out on J8 and J11 to eventually control servo-motors. General Purpose IO (GPIO) is provided on J5, J7 and J10.