Seeing as it’s getting closer to that time of the year when people walk around at night wearing ghastly clothing, no it’s not Talk like a Pirate Day; Halloween. As part of the festivities at work we have a yearly Best Costume and Pumpkin Carving competition. So I thought I would share with you our team’s 2nd place winning Pumpkin family.
The Pumpkin Family
Yes the pumpkin was suped up a little from the traditional pumpkin; the competition rules allowed for props to be used I decided to take it to the limit. In a last minute rush the night before the carving, I wired, programmed and sequenced the hardware.
The setup consisted of a Netduino (Micro-controller that is programmed in c#) for the brains, 4 LEDs (light emitting diode) for the eyes, 2 servos (motors that allow you to set the rotation of an arm between 0-180 degrees) for the eyes and eyebrows and a little speaker to play the theme tune.
Once all the hardware was built, I created a very simple program to play the theme tune and sequence the movement of the servos and toggle the lighting of the LEDs. The first thing I wrote was the tone generator; to play a note I passed in the note (F#) and using a lookup table I had the note’s frequency, with this I set the speaker output pin to oscillate that frequency. Next I created an array of notes and duration’s, these were the base of the sequencer. Now having the music playing (Thanks goes to my wife who converted the sheet music to note and duration for me) I created the servo and LED tracks and set their timing.
The only thing left to do was create an event handler that would fire off the sequence when I pressed a button on the NetDuino. The quality of the music was quite gritty, this was due to not having any smoothing electronics in place, but I kinda liked the classic sounding theme, so I left it.
The eyes in the following image were bought at a dollar store and mounted on some wire as pivots then the servo and controller arms were mounted to some cardboard for easy installation.
So I hope this quick rundown of how I created the Pumpkin Family electronics has inspired you to go and make your pumpkin a little more high-tech.
Happy Hacking!