Introduction: Arduino Powered Haunted Pumpkin

Picture of Arduino Powered Haunted Pumpkin
This is a cute little project that takes a pumpkin, motion sensor, and some parts from Radio Shack. It was fun to create and build. This project was sponsored by the Radio Shack Great Create and I was able to make the whole thing with parts available from Radio Shack. Thanks for the gift card, Radio Shack!

Step 1: Parts

Picture of Parts

Arduino Uno

9V Recording Module

MPS2222A Transistor

150 ohm resistors (5 pack)

(2) 10MM high brightness red LED two-packs (total of 4)
(2*$2.19) $4.38

10mm High-Brightness White LED

PIR Sensor Module

Total cost of Radio Shack parts: $31.13

These other parts are good to have handy:
Heat shrink tube:
Digital multimeter:
22 ga. solid hookup wires:
Zip ties:

Solder and soldering iron.
Hot Glue

Step 2: The Circuit

Picture of The Circuit

This circuit is relatively simple. The red LEDs are attached to digital pins on the Arduino through the resistors. The white LED goes to Pin 13 (no resistor needed given the voltage and duty cycle of the LED) and the motion sensor and voice module are given their own digital lines as well.

It is important that the two "glowing eyes" LEDs are attached to PWM pins on the Arduino so they can properly fade. I used Pin 3 and Pin 5.

Step 3: LED Tips

Picture of LED Tips

To keep this project simple, I soldered the resistors for the LEDs "in line" with the wire, shown in this photo. Heat-shrink tube adds both stability and insulation to the circuit.

Step 4: Hacking the Voice Module

Picture of Hacking the Voice Module

The voice module required a transistor to trigger the button. The video and photo attached show how to use the transistor in the parts list to trigger the button from an Arduino pin.

Extra special thanks to Paul at Radio Shack #01-3209 in Santa Clara for suggesting this and other parts.

Step 5: The Source Code

Picture of The Source Code

This code loops the "brightness up" and "brightness down" on the LEDs, checking for motion at the top and bottom of the cycle. If motion is detected, it calls the "freakout" function causing the blinking and laughter. That's all!

This is the source code for the motion sensitive
haunted pumpkin built for Radio Shack.
Original code by Daniel Gentleman,

// Set up pin assignments
int leftEye = 3; // PWM pin 3
int rightEye = 5; // PWM pin 5
int redBlink1 = 9;
int redBlink2 = 10;
int whiteBlink = 13;
int laughBox = 12; // transistor to voice module
int pirSensor = 7; // passive infrared sensors
int pirState = 0; //Initial IR state

// Setting up pin modes
void setup() {
pinMode(leftEye, OUTPUT);
pinMode(rightEye, OUTPUT);
pinMode(redBlink1, OUTPUT);
pinMode(redBlink2, OUTPUT);
pinMode(whiteBlink, OUTPUT);
pinMode(laughBox, OUTPUT);
pinMode(pirSensor, INPUT);

void loop () {
// fade in from min to max in increments of 5 points:
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {
// sets the value (range from 0 to 255):
analogWrite(leftEye, fadeValue);
analogWrite(rightEye, fadeValue);
// wait for 30 milliseconds
pirState = digitalRead(pirSensor); // read the state of the pirsensor value:
if (pirState == HIGH){ // If motion is detected
freakout(); // Call the freakout routine

// fade out from max to min in increments of 5 points:
for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) {
// sets the value (range from 0 to 255):
analogWrite(leftEye, fadeValue);
analogWrite(rightEye, fadeValue);
// wait for 30 milliseconds to see the dimming effect
pirState = digitalRead(pirSensor); // Same as above
if (pirState == HIGH){


void freakout(){
digitalWrite(laughBox, HIGH); // Send intial ON for all pins
digitalWrite(leftEye, HIGH);
digitalWrite(rightEye, HIGH);
digitalWrite(redBlink1, HIGH);
digitalWrite(redBlink2, HIGH);
digitalWrite(whiteBlink, HIGH);
digitalWrite(laughBox, LOW); // turn off laugh button
for (int i=1; i<=40; i++){ // Start blinking mayhem
digitalWrite(leftEye, HIGH);
digitalWrite(rightEye, HIGH);
digitalWrite(redBlink1, LOW);
digitalWrite(redBlink2, LOW);
digitalWrite(whiteBlink, LOW);
digitalWrite(leftEye, LOW);
digitalWrite(rightEye, LOW);
digitalWrite(redBlink1, HIGH);
digitalWrite(redBlink2, HIGH);
digitalWrite(whiteBlink, HIGH);
} // Finish blinking mayhem, turn everything off
digitalWrite(redBlink1, LOW);
digitalWrite(redBlink2, LOW);
digitalWrite(whiteBlink, LOW);


Step 6: Installation, Testing, and Completion.

Picture of Installation, Testing, and Completion.
I used a USB battery which should offer plenty of run time for such a simple circuit. An artificial pumpkin, hobby knife, and hot glue did the rest.

Be very careful with your wiring as too much tugging can yank the wires out. There should be no harm done in leaving the circuit running while going through the hot glue and installation tests.

Below are two videos of the pumpkin in action:


zeiche (author)2013-07-26

Since there is only a passing mention of the transistor in the video, I would like to add a little here. Please keep in mind I am a total newbie to electronics, however I did manage to trigger the voice recorder via Arduino. This is what I did:

- Select a digital pin other than 13. The LED on pin 13 might prevent the transistor from saturating without a different value resistor.
- Place a 150 Ohm resistor between the digital pin and the base of the transistor.
- Tie the collector to ground
- Tie the emitter to the sound module.
- Write a short HIGH/LOW pulse to the pin to start/stop the recording.

By the way, I was able to solder directly to the button pad by cutting the negative trace that feeds the pad. The wire wraps under the sound module via the exposed holes for protection.

Big thanks to thoughtfix for sharing this wonderful idea!

EET1982 (author)2013-04-17

Thanks for the great 'ible. I will def be referring back to this near halloween. Thanks again!!!

mnova (author)2012-02-06

Do you have a resistor on the base of the transistor and is this the correct way to hook up the transistor ?

bturner11 (author)2011-11-06

Can you post a clearer picture of how you soldered to the recording module so you could control it via Arduino? Thanks.

alollar (author)2011-10-30

It is so creepy in the dark. I like it a lot!

leeski (author)2011-10-28

Great project. Arduino has been a blast to work with for Halloween projects. Keep up the good work!

About This Instructable




More by thoughtfix:Mint-Sized Success Meter (quit smoking!) with ArduinoArduino powered Haunted PumpkinMake your pet dishes tweet!
Add instructable to: