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.
- Raspberry Pi (I used a Model B 3 for the Wifi)
- Hall Effect switch (I actually used a reed switch)
- Lots of Jumper cables! youll need an assortment
- Elastic Band
- Soldering Iron
- Tin Snips
You can get the files on Thingiverse.
3D Print Them.
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.
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.
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.
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.
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.
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.
Now test everything again! Understand the program so you know how it works.
The best part.
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.
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.
Get notified the moment a new project comes out!
You can also send me bitcoins, here -
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!