A few days ago I started working on an arduino powered pumpkin inspired by this Pimp Your Pumpkin project I saw on youtube. The purpose is to have a motion (or proximity) sensitive pumpkin that goes from a simulated candle flicker when no one is around to a menacing red light and spooky noise if someone gets too close.
The majority of the coding and setup I completed on Thursday. The major hurdle to me was getting better sound. I'd only been able to come up with a very quiet and non-scary beep. One way to solve this is with a wave shield, but unfortunately local stores don't carry one and adafruit is out of stock.
Determined to find something better than a beep, I stumbled across High-Low Tech which has a custom library called PCM that does exactly what I need.The basics are pretty simple. You record the audio you'd like and save it as an MP3. Then you encode it with a 16 KB bit rate and an 8Hz sample rate. The audio, obviously, isn't as crisp as when you started but that's ok. Once the audio file is encoded it needs to be converted to numeric value with a program like EncodeAudio (source file), which is available on High-Low Tech. The full tutorial of how to do this is on this website with the PCM library you'll need.

As you can see, Chris was kind enough to provide the voice for the pumpkin.
The next major hurdle was to get more sound. The small 8-ohm mini-speaker I have is adorable, but quiet. I need something that Trick-or-Treating kids will hear.
That means something louder. Something like old computer speakers. They have their own power source, you can control the volume, and they're easy to hook up. All you need is a 3.5mm jack.
I wired one up pretty easily, and voila, more volume.
The whole setup is pretty easy. I sketched everything out in Fritzing for an easy visual. The orange (or yellow if orange isn't available) is wired to a PWM slot for more subtlety with the simulated candle flicker.
Once done with the audio portion, the actual installation into the pumpkin begins. There are a lot of way to hide the actual circuitry in the pumpkin, from tissue paper to felt and anything in-between. We opted for gauze to give it a more spooky feel.
We placed the pumpkin on a covered stool and will use the decorative wreath to hide the ultrasonic on Halloween. The are under the stool cover and out of sight.
Here is a very short (8 seconds) video. It's pretty simple and the ultrasonic sensor works fairly well.

Chris has a nice video too with the pumpkin and a few other Halloween decorations we made for this year.

Next year I hope to improve on it. I'd like to actually have several arduino-powered pumpkins that communicate via RF.

Here's a list of materials and code I used in case you'd like to try something like this yourself.

Github: Source code and files
or if you prefer, dropbox: Source code and files

**October 2013 update: I added a wave shield.
Project notes here
Github: Source code and files

Materials Used


I love it. love love love it.

Post a Comment