Funny Proximity Activated Pumpkin
by donutsorelse in Circuits > Arduino
459 Views, 1 Favorites, 0 Comments
Funny Proximity Activated Pumpkin
I enjoy Halloween season quite a bit, especially due to all the opportunities for fun projects it creates. Because I found the idea slightly amusing, I'm making an Arduino controlled pumpkin that will fart pumpkin spice spray when someone walks close to it. This can be easily translated into any sort of proximity activated pumpkin project, such as making the pumpkin light up when someone gets close. So, even if the idea of a farting pumpkin isn't your brand of humor, you can still make something that fits your style with basically the same setup.
Supplies
- Arduino
- Breadboard
- Powerful Servo - This is what I used
- Battery for Servo - This is what I used
- Ultrasonic Sensor
- 9V battery
- Pumpkin Spice Spray
- Pumpkin
The Electronics
As seen in the code and the video, I attempted to use multiple servos to press the spray, so the schematic provided here is simpler than what I actually did.
You connect the Ultrasonic sensor such that-
- VCC is connected to 5V
- TRIG is connected to pin 11
- ECHO is connected to pin 12
- and GND is connected to GND
I used a more powerful servo because the ones that can operate with the built-in 5v from the Arduino can't push down the trigger on the Pumpkin Spice spray canister. To connect the servo, you connect:
- The red wire of the servo to the red wire of the battery
- The ground wire of the battery to the breadboard, then to the Arduino GND, then to the servo black wire
- The remaining servo wire to pin 9
Last, you'll want to use the 9V battery to power the Arduino, since my understanding is most pumpkins don't come with USB ports. However, I'd hold off on plugging in the battery until it's installation time, or you risk triggering pumpkin spice spray anytime you accidentally move in front of your sensor!
Code Time!
With the code, we look for a reading from the proximity sensor. This comes in as time data, which we translate into distance with a simple conversion. Then if the distance is less than whatever we want our proximity threshold to be, we trigger a servo movement. That servo just moves one direction, pauses long enough to spray for a moment, and returns. Lastly, we pause a bit longer if the pumpkin is triggered so that it's not going too crazy.
The code is attached within this step.
Downloads
Carve the Pumpkin!
This part is a Halloween staple that you're more than likely quite familiar with, but there is an important component to this. The Ultrasonic Sensors need to fit in the eye holes (or at least somewhere in the design), and they're fairly small and close together. As such, it's easier to start by outlining those with a dry erase marker, and messing with the design until it looks right.
Otherwise, it's pumpkin carving time! Cut out the top, pull out the seeds and guts, and use those little pumpkin saws to create your masterpiece. Needless to say, for a farting pumpkin there needs to be a segment carved out of the backside as well.
Rig the Spray
This is night and day easier with the more powerful servo. I still may recommend using some rubber bands to hold the spray trigger down somewhat, because not only is it easier for the servo to make the spray go but it's also easier to press up against the rubber bands.
Otherwise, this part will be hidden within the pumpkin and doesn't necessarily need to be pretty. I used a mess of duct tape to hold the servo tightly in place, positioned such that it would press the spray's trigger when rotated.
One important note is to put duct tape over the spray itself if you're going to run any tests so that it'll spray into the duct tape instead of into your face.
Install the Pumpkin's Eyes, Brain, And...
It's time to cram all our hard work into a pumpkin! Drop the Arduino in and position the spray container such that it's aimed out the hole in the backside. Positioning the Ultrasonic Sensors in the eyes can potentially be a bit tricky if it doesn't just fit in place nicely. To hold it in place, you can put a piece of tape on the back of the sensor and pin it to the pumpkin. The tape itself won't stick to the pumpkin, hence the pin.
Last, plug in the 9V battery to activate the device! Now, just walk in front of the pumpkin and watch your glorious creation do its magic.
It's a silly project, but it's one I'm quite thrilled to have on my porch. It's been good for décor, as well as a few laughs. Hope you enjoy!