Haunted Jack in the Box

by seanhodgins in Circuits > Raspberry Pi

13445 Views, 87 Favorites, 0 Comments

Haunted Jack in the Box

IMG_2519-Edit-2-3.jpg

This is a project I have wanted to do for a while, and Halloween is the perfect excuse to do it. I'm using a Raspberry Pi to make a Jack in the Box autonomous. It uses a Pi camera to detect when someone is looking at it. Go scare your friends.

Watch the Video!

Haunted Jack in the Box - DIY

Get the Parts!

Parts:

Tools:

  • Soldering Iron
  • Drill
  • Tin Snips

Download the Files and 3D Print

3DPrinting_2.gif
3Dprinting_1.gif

You can get the files on Thingiverse.

https://www.thingiverse.com/thing:2578661

3D Print Them.

Cut Open the Jack in the Box Bottom.

Drilling_1.gif
TinSnips_1.gif
Pliers_1.gif

Time to try and not ruin your brand new jack in the box. I decided to screw four larger holes in the corners. I took some tin snips and carefully snipped out the bottom. This was actually easier than expected. After the bottom comes out, I folded up the remaining metal to make sure it wouldn't cut me while I was working on it. Just just some pliers, but careful not to damage the paint on the outside.

Wire the Components and Test.

Jumper Wiring.jpg
Wiring_1.gif
Wired_1.gif

I always test out my components before I install them. That way I don't need to debug when the thing is assembled, this is helpful.Run the python script I have made on the GitHub.

Install Components in Base.

camera1.gif
Parts_In_Base_1.gif

With the components tested, its time to mount the components to the 3D printed base, for the most part they're just loosely fit in. The motor is snug and doesn't require any tape. Use double sided tape where necessary. Camera is mounted with plastic threading screws.

Install Pulleys to Drive Music Box.

MotorPulley1.gif
Handle_Pulley1.gif

This is a fun step(not). Getting the handle pulley is a pain. Take some doublesided tape and put it in the channel where the pulley mounts to the handle, this will make it easier. Then take your plastic threading screws and tighten it down. If done right it should be secured to the handle on the inside.

The motor pulley is just friction fit, and push on.

Install Magnet, Hall Switch, and Servo.

Servo1.gif
ReedSwitch1.gif

Since we will be triggering the Jack in the Box with the servo instead of the little mechanical switch, you need to stick the servo inside of the box. You will need to make the servo arm longer, I used a second servo arm and screwed them together.

You need to attach the magnet on the opposite side of where the mechanical latch is. I used a small amount of super glue to mount it. Seems to be holding. This way the raspberry pi know when it is "supposed" trigger the jack, but doesn't have to. Then install the reed switch(I call it the hall effect sensor in the video) - I mount it to magnets(but not too close!) so I could move it around and find just the right spot. Used double sided tape to mount it to the magnets. Test the reed switch to make sure it triggers at the right point.

Put It All Together.

Pulleys1.gif
AllTogether1.gif
ScrewingClosed1.gif

This is the tricky part, you need to feed the elastic band through the hole around the arm. Then pull it tight and get it around the motor, careful not to break it. Make sure all of the wires are shoved neatly inside(this is a joke, just get them in there any way possible).

I drilled two small holes to secure it to the base because the jack coming out is a little violent.

Connect to Your Pi and Program.

Program1.gif

Now test everything again! Understand the program so you know how it works.

https://github.com/IdleHandsProject/haunted_jitb

Set It Up and Wait for a Victim.

WindingWaiting1.gif

The best part.

Design Your Own Program!

WindingEnd1.gif

There are many ways to add more character to this. I have created one(at the time of writing this) program, but there are many ways to create variations that could be scarier than this.

Support My Open Source Projects!

Patreon_logo.svg.png
youtube.png

If you would like to support my projects, Consider becoming a patron, subbing to my YouTube and following on Instagram. I would love to bsynce able to rely on the support of my viewers, so I can keep creating free open source projects like this one.

Subscribe to my YouTube!

Become a Patron!

Instagram

Twitter.

Get notified the moment a new project comes out!

You can also send me bitcoins, here -

19s7hAVkm54Ev7QZEsWAfoyECy1CwXSrhL