Make a Robotic Snap-O-Lantern!
|
The first task is to carve the pumpkin. It needs to have big pointy teeth in the front, and a hinge in the back. We'll use a simple friction hinge, and the big pointy teeth help to realign the pumpkin's mouth when it snaps shut.
| |
|
|
|
Start with a large-ish mini-pumpkin. Pick a side to be the face and draw some big pointy teeth on it using a fine-point sharpie. The ink can be removed later, if necessary, with rubbing alcohol.
| |
|
Away from the teeth, simplify the pattern to a simple cut, and on the side exactly opposite the center of teeth, mark a shape like so. This notch, an inch or two wide, will form the basis of a hinge.
|
|
|
|
| |
|
|
|
| |
|
|
|
|
|
Make a guide mark below the top of the slot, and cut the surface of the notch at an angle such that the lid can tip back easily, virtually hinged at the point where the two pumpkin halves meet. Look carefully at the photos to make sure that you see where the cut needs to be added; you can always click on the photos to get a closer view.
| |
|
|
|
|
|
The basic idea is that we add two toothpicks to the back of the lower half of the pumpkin. The tongue and slot prevent side-to-side motion while the toothpicks prevent the lid from sliding backwards and provide friction against sliding upwards. Then, when we push up on the upper front teeth, the jaw tends to open neatly, and fall back into place when released. Insert the toothpicks as shown in the photo (you may want them a little more vertical than this) and trim them so that only about 1/2" of each toothpick is visible.
Now that we have a working hinge, we come to the electronic portion of the project. Here is the list of parts:
Download the firmware for the project here (12 kB .zip file). If you already have a working setup for programming AVR microcontrollers, you probably already know what to do. Unzip the file, customize the header of the makefile to reflect the programmer that you use and which port it is on, and run (in a terminal) "make all", "make program" to compile and flash it. If you have a more specialized programming environment, you can use that instead without any worries-- just make sure to copy over the fuse settings from the makefile. If you are new to programming AVR microcontrollers, or to microcontrollers in general, start here for a great overview. (See also our list of AVR resources.) You will need a to set up a tool chain of (free, open-source) software and some programming hardware.
The rest of the parts are set up as shown in this diagram:
Wire up the battery pack, positive side to pin 20 of the ATtiny2313, negative ("ground") side to pin 10. Use the 2x3 DIP header as a pair of standard servo connectors, where the signal sides come from pins 12 and 13 of the chip, the middle pins go to the positive end of the battery, and the other two end pins go to the negative end of the battery. Finally, two LEDs with 1k series load resistors go between pins 8 and 9 and ground. Instead of wiring the LEDs directly on the board, put them on the end of long wires so that they can be placed as eyes for the pumpkin.
| |
|
|
|
| |
|
|
|
Next, attach the LED eyes. For very small pumpkins like these it can be hard to wire the LEDs inside the pumpkin itself. A good compromise is to attach them directly to the top, anchoring the wires by hand inserting staples. If you do use a larger pumpkin (perhaps pie-pumpkin sized) , you may well be able to fit the microcontroller, LEDs, and battery all inside the pumpkin itself. On the other hand, the servo will have to work much harder to lift the additional weight.
So how does it work? Nice and creepy like. Additional project build photos are here, and we've also put up a project video on YouTube, you can watch it there or embedded here.
| |
|
MetaBlog links for this story: [ del.icio.us | technorati ]
Technorati tags: diy, avr, servo, howto, pumpkin, halloween, robotics, LED, microcontroller |






























