Birthday Cake Animatronics Controller
My daughter's birthday is very close to Halloween, so that's always the theme of her birthday party. Last year I created an animated coffin as a cake decoration. The prop was modeled after a scene in Disney's haunted mansion and featured a jiggling cover as if a tiny figure trapped inside was trying to escape. I built the coffin out of gator board and used a pager motor pulsed by an 8 pin PIC Microcontroller to animate the lid. I suppose the PIC was overkill, but I wanted to cover to move in a random fashion and writing a simple program seemed the best way to get the effect I was after. The decoration was such a success that I knew I was on the hook to create something better next year.
For my next design I wanted to be able to do more than just pulse a motor on and off, so I started thinking about using model airplane servos. RC servos are fairly easy to control using a code library available for the Arduino platform. However, taking this approach would require me to write custom code for each animation sequence and I wanted a self contained solution that would let me program animations using just the controller board. I also wanted the controller to be smaller than an Arduino as well as run from battery power. The result is what I call the Birthday Cake Animatronics Controller, which is able to program and playback short sequences using one, or two RC servos. Here's a video that shows a repeat performance of the final cake decoration; a skeleton the pushes up through a graham cracker dirt covered grave and then reaches out a bony hand:
How it Works
The controller is based on an ATTiny13 microcontroller and is powered from 4 AAA batteries. The servos are powered directly from the 6 volts provided by the batteries and an on board regulator steps this down to a filtered 4.5 volts to power the microcontroller.
Programming is done by moving small potentiometers on the controller board which causes the servos to track along. Pressing a button on the board then records the position and, if the button is held down, tells the controller to animate the move over the interval of time the button was depressed. For example, here' how you would program a simple sequence:
Press and hold the STEP button while pressing the RESET button. This puts the controller in program mode.
Adjust POT1 and POT2 to position the servos to their starting position and press STEP to record these positions
Move POT1 and/or POT2 to the next position in the sequence, then press and hold STEP for the interval of time it should take to move to these new positions from the prior positions. Note: you can move one, or both servos, depending on what you need.
Optionally, press and hold STEP again for the interval of time the servos should hold this new position before moving to the next one.
Repeat these steps until you've recorded the complete sequence (Note: the controller has 64 bytes of nonvolatile memory and each press of the STEP button uses from 1-3 bytes of memory. Pressing STEP without a servo move uses 1 byte, and one additional byte is used for each servo that moves.)
Build Your Own
I designed a simple printed circuit board for the animatronic controller using the Osmond PCB layout software which runs on Mac OSX, then I fabricated the design via the wonderful BatchPCB service at Sparkfun.com. The following image shows the layout of the top side of the PCB: