My coworker Rick Petty and I put together our own version of the cylon pumpkin I mentioned earlier. I had intended on following the instructions from evilmadscientist.com, but Rick intervened. "That's really old school," he opined... and convinced me to instead use a AT Mega 8 microcontroller.
The circuit was much simpler... far fewer wires. And then I could program the controller in C code with AVR GCC. And these chips only cost a buck! Much easier than the original plan.
Yes, for Halloween this year, I programmed a pumpkin.
The circuit is much simpler because all we need is LEDs with the positive end connected to the chip, and the negative end bussed through a resistor to ground. Then we can turn the pins on and off at will with the microcontroller. We used some super bright LEDs, and a 10 ohm resistor.
On the chip, we connected pins PD0 through PD7, and PC0 through PC6 to the LEDs. All microcontrollers also need a voltage regulator to supply the correct amount of voltage to the chip. We used 9V AC input, but needed 5V DC for the chip, so we used a
LM7805 voltage regulator, and a 100 microfarad capacitor.
I whipped up a prototype on a bread board, but the chip was busted. So I relied on Rick's inventory, and superior soldering skills to make the final version last weekend. He also gave me a crash course in microcontroller programming so I could write the code to run the dang thing. The final version lit up one pin brightly, dimly lights its immediate neighbors, and slowly panned from side to side.
To get the code on to the chip, we had to use what's called an AVR In-System Programmer. Plug the USB end into your computer, and the other end to power, ground, and the MISO / MOSI pins on the chip. It communicates over a serial bus, so you can even program you chip to output "Hello World!" if you are so inclined...
I really enjoyed this project, and I think Rick has got me hooked on microcontrollers. However, I would need a much better soldering iron to do this project alone... mine makes buzzing sounds and smells of ozone.
You don't gotta be Mr Wizard to know that ain't right...
Flickr photoset of the pumpkins
Video 1 - partly assembled
Video 2 - fully assembled
AVR Freaks - for people who program microcontrollers for things besides pumpkins
AVR Lib c - C standard libraries for the AVR family of microcontrollers
Pumpkin source code