Facebook Twitter Pin It Reddit

Build a Peek-a-BOO Ghost This Halloween

Add Excitement to Your Scary Season Festivities

By Ryan Winters

Description: Peek-a-BOO kit
Assembly Time: 1+ hours
Skill Level: Beginner

Halloween can be an extremely fun time of year, especially for electronics enthusiasts. Having even a novice background in electronics can bring new life (or death) to a Halloween display with this most scary kit.

Last Halloween our friends at Nuts and Volts made a Peek-a-Boo ghost that reacts to an approaching object in a room. When idle, the ghost will keep its eyes covered, and when someone walks past, it will quickly uncover its eyes. We decided to try our hands at making a ghost, but you can let your creativity run wild and use your artistic skills to draw any hauntingly scary creature you choose.

There are three versions of the kit available. There's a full kit that provides all electronic parts needed for the build. There's also a kit available without Arduino Uno and a third option is a "lite" version of the kit. It doesn't include Arduino or jumper wires.

Required Tools and Materials:
Cardboard, poster board, foam board or other material
Paper for the image
Hot glue and hot glue gun or tape
Computer with latest Arduino IDE
Hobby knife/scissors
LEDs (optional, if you want to add blinky eyes)
Ultrasonic sensor library (download from product page)

The Peek-A-BOO Ghost electronics kit includes
Arduino Uno
Breadboard
Micro servos
Ultrasonic sensor
Connecting wires

Purchase the full Peek-A-BOO Ghost Kit.

The Peek-A-BOO Ghost w/out Arduino kit includes
Breadboard
Micro servos
Ultrasonic sensor
Connecting wires

Purchase the Peek-A-BOO Ghost Kit without Arduino.




Step 1: Making the Ghost

The main body and arms of the ghost can be made out of cardboard, poster board, foam board or any strong material that is easy to cut and isn't too heavy. You'll want something sturdy, but not so thick that the servos can't attach to the arms. I chose to use cardboard.

First draw an outline of your ghost on the board or chosen material and cut it out using a hobby knife or scissors. Save scrap pieces. Next, trace and cut out the same ghost shape onto a piece of white paper for a clean and presentable surface.

Peek A Boo
Draw arms for the ghost and cut them out separately. Make sure they're wide enough to cover the round servo attachments. Outline the servos on both sides of the ghost (where you'll attach the arms) and cut holes for them.

Liberally apply glue to the paper and attach it to the outline, taking care to glue all edges in order to avoid tearing them. Remove any wrinkles with a straightedge. Glue and attach the round servos close to the end of the ghost's arms. Cut the arm holes where the servo shafts will connect from the back side.

Peek A Boo
Trace the ultrasonic sensor on the backside of the paper ghost, and cut out the circles with a hobby knife. Place the paper ghost over the cardboard ghost and trace the sensor circle cutouts. Carefully cut out the circles.

Peek A Boo
Use more board or material of your choice to create a support stand that will keep the ghost propped. To make the stand, bevel the bottom of the ghost at a 45 degree angle. Make a three sided stand for support and glue it to the back of the ghost.

Peek A Boo Peek A Boo

Use hot glue to attach the servos to the back of the cardboard ghost so both have the same vertical orientation. Hold them in place until the glue dries. Wait to attach the arms until after you've centered the servos. Be careful not to get any glue on the shaft. Keep in mind that hot glue is named so for a reason. It is around 250 degrees Fahrenheit when it is released from the gun and won't hesitate to stick to fingers or anything else it touches. Use caution.

Step 2: Make Connections

Gather your materials to make the connections

Make Connection
  1. Connect a wire from the black wire on one of the servos (ground) to your breadboard.
  2. Connect a wire from the black wire on the other servo to the same row on the breadboard as the other black wire. (Both servo black wires on the same row).
  3. Connect a wire from the red wire of one servo (power) into a new row on your breadboard.
  4. Connect a wire from the red wire on the other servo to the same row on the breadboard as the other red wire. (Both servo red wires on the same row).
  5. Connect a wire from the white (or yellow) wire on the ghost's right arm servo (signal) to pin 9 on the Arduino Uno.
  6. Connect a wire from the white (or yellow) wire on the ghost's left arm servo to pin 10 on the Arduino Uno.
  7. Connect a jumper wire from the GND pin on the ultrasonic sensor to the ground row on the breadboard. It should also share the connections with the black wires of both servos.
  8. Connect a wire from the row of ground (black) connections on the breadboard to the GND pin on the Arduino Uno.
  9. Connect a jumper wire from the VCC pin on the ultrasonic sensor to the power row on the breadboard. It should also share the connections with the red wires of both servos.
  10. Connect a wire from the row of power (red) connections on the breadboard to the 5V pin on the Arduino Uno.
  11. Connect a jumper wire from the TRIG pin on the ultrasonic sensor to a new row on the breadboard.
  12. Connect a jumper wire from the ECHO pin on the ultrasonic sensor to the same row as the TRIG pin on the breadboard.
  13. Connect a wire from the TRIG/ECHO row on the breadboard to pin 7 on the Arduino Uno.
  14. Mount the servo in the mouth of the ghost. Use a Sharpie to black out the silver color of the sensor, if you prefer.
  15. Connect a wire from the row of power connections (red) to the 5V pin on the Arduino Uno.
  16. Connect a wire from the row of ground connections (black) to the GND pin on the Arduino Uno.

Step 3: Programming the Ghost

Upload the code; make sure you have the Ultrasonic Ranger library installed first. You need to center the servos at their midpoint before you can attach the arms. Open the Ghost code and delete everything in the main loop so the Arduino will only initialize the servos and center them at 90. Your main loop should just say: void loop() {}

#include <Servo.h>


/* The servos are both positioned in the same orientation. 90 is the midpoint.
The right arm servo should use values from 90 to 0,
and the left arm servo should use values from 90 to 180.*/


Servo rArm;  // create a servo object for the right arm
Servo lArm;  // create a servo object for the left arm


void setup()
{
  rArm.attach(9);  // attach the servo to pin 9 in the servo object
  lArm.attach(10); // attach the servo to pin 10 in the servo object
  rArm.write(90);  // set the servo to the midpoint
  lArm.write(90);  // set the servo to the midpoint
}

void loop()

Attach the arms so they are covering the eyes when at the centered position. Reload the Ghost loop with the main loop intact which will incorporate the ultrasonic sensor. By default, 36" is the trigger point for the ghost to react. You can change the reaction distance, delay time before responding again, and the amount of arm movement. Remember, the right arm should use values from 90 to 0, and the left arm should use values from 90 to 180.

#include <Servo.h>
#include "Ultrasonic.h"


/* The servos are both positioned in the same orientation. 90 is the midpoint.
The right arm servo should use values from 90 to 0,
and the left arm servo should use values from 90 to 180.*/


Servo rArm;  // create a servo object for the right arm
Servo lArm;  // create a servo object for the left arm
Ultrasonic sensor(7);  // create the object for the sensor

void setup()
{
  rArm.attach(9);  // attach the servo to pin 9 in the servo object
  lArm.attach(10); // attach the servo to pin 10 in the servo object
  rArm.write(90);  // set the servo to the midpoint
  lArm.write(90);  // set the servo to the midpoint
}

void loop()
{
  sensor.Measure();  //send a ping and listen for echo
  if (sensor.RangeInInches > 36)  //change number for distance reaction
  {
    lArm.write(90);  //eyes covered
    rArm.write(90);  //eyes covered
    delay(500);
  }
  else {
    lArm.write(120);  //eyes uncovered
    rArm.write(60);   //eyes uncovered
    delay(2000);
  }
}


Step 4: Let the Scaring Begin!

After you've successfully tested the code and your ghost is working as desired, set it up where you wish. Watch it spring into action and startle those unexpectedly walking by. With an hour or so of your time and some creativity, you'll have a low-cost custom decoration sure to give a fright and add delight to your Halloween for years to come. If you give the Peek-a-BOO Ghost a try, we'd love to hear about how it turned out. Share your story haunting experience at [email protected].

Warning! Working with electronics can be dangerous. Always use caution and follow all safety procedures. If you are uncertain of the dangers involved with a particular project be sure to seek assistance. Failure to follow safety procedures may result in injury or death.
Ryan Winters is a Bay Area, California native. He is mostly self-taught and his hobbies include working on cars and computers, fiddling with electronic gadgets and experimenting with robotics.