Spooky Pumpkin Photobooth
On the gloomy night of All Hallows Eve, a wandering soul happened upon a glowing Pumpkin. She was enthralled by the Pumpkin, especially its nose. She thought it was a fantastic nose. It protruded a half-inch outward, with those orange hues of sunset and skyfall that other Pumpkins just didn’t have. Something about it was so alluring, so enticing, that she was compelled to press it. For a moment’s breath, all was still.
“AHHHHH!” An ear-splitting shriek rang out.
Then she slapped the pumpkin to the ground. It broke.
(true story)
Introduction
Over the years, many homeowners throughout all of America have slowly refused to partake in the traditional activities of Halloween, such as Trick-Or-Treating. This action has taken away from the spirit within neighborhoods, as less people Trick-Or-Treating gives less incentives to help bring more and more people back in. While setting up more elaborate, unique, and innovative decorations can help bring light to the issue and give something the neighborhood can use to motivate them back into the Halloween spirit, there are still many issues present. Some of these issues include the hassle some of the decorations take to set up, such as in assembling pieces and inflating pop-up decorations, and also the cost that brings no benefit in the repetitiveness of the designs within the market.
Our Solution
Here we present a fully functional photobooth in the shape of a typical Jack-O-Lantern design when not in use. However, the nose is labeled as a button that dares the user to press, and if they do, then the surprise will occur. The pumpkin will initially not perform any actions to make it seem as if the button didn’t actually do what was intended. However, in one quick motion, the speaker from the inside will play a loud scream sound, a ghost will pop out of the top of the pumpkin, and the camera will snap a photo of the user while they are still in a shocked mood. After this, the photo taken by the camera will be transferred to a mini printer hidden inside the system that will print out the photo of their shocked faces, giving them a souvenir for Trick-Or-Treating.
Presented by Diamond Bar High School - Brandon L., Eric W., and Nathan T.
Full CAD Assembly Link: https://drive.google.com/drive/folders/104CqxMrO6RMTgBaZrhYU7xKfbcfOByOd?usp=drive_link
Supplies
Section 1: 3D Printing
- Any 3D Printer Available to you
- Note: Depending on your bed size and printer type, quality and sections to split the CAD file into may vary
- For this project, we had an Bambu Lab H2D Laser available to us so the pumpkin is split into 3rds
- Bed sizes for the H2D
- Identical filaments in both nozzles: 350mm by 320mm by 325mm
- Duel, non-identical nozzles: 300mm by 320mm by 325mm
- Single nozzle printing: 325mm by 320mm by 325mm
- 3-4 Spools of 1 Kg PLA filament
- Pick a color of your choice!
- It doesn't have to be Orange
- Pliers, Files, & Sand paper
- Depending on your printer, the tolerances may vary
- If necessary, scrape of excess support or filament in order to fit certain holes together
- 3D Modeling Software (Fusion360, Solidworks, Onshape, etc)
- Make the edits you want to the pumpkin (to make it fit onto your bed size or just to add creativity)
- 3D Printing Slicer (Depends on what printer you are using)
Section 2: Electronic Components
- Raspberry Pi 3B+
- For this project, we used a 3B+
- However, you may use any Raspberry Pi available to you
- 12V Brushless DC Motor
- 12MP IMX708 Raspberry Pi Camera
- TTL Thermal Printer
- Small Speaker
- We suggest a small speaker that can connect to the Pi with a USB
- Note: The Pi also has an audio jack so you may play noise from , but the code will need a very small edit for this to work
- L298N Motor Drive Controller Board Module Dual H Bridge DC Stepper
- Keyboard Tactile Switch
- Lighting Module
- Choose LEDS that you want!
- Note: We used Christmas lights that were externally controlled, so no code was written for the lighting portion of our project
- Barrel Jack Power Supply
- One 5V - 5V power supplies connects to Raspberry Pi and Thermal Printer
- One 12V - 12V power supply connects to the motor driver
- 2 Pin Barrel Jack Adapter to 2 Pin output
- Cables
- Micro USB Cable
- TTL Printer USB Cable (comes with the printer)
Section 3: General Supplies/Miscellaneous
- A Monitor/laptop that can connect to the Raspberry Pi
- Power Strips
- You will need to connect to an outlet to power most of the systems
- Jumper Wires
- Depending on your components you will need
- Male-to-Male Wires
- Male-to-Female Wires
- Female-Female Wires
- Varying Screws
- Screws are used to mount the motor to the Rack & Pinion Stand
- We used M3 screws for our motor
- Screws are also used to mount general parts to the pumpkin
- Raspberry Pi Screws (mounted to the front stand, inside the pumpkin)
- The pumpkin is mounted using screws around 0.16 in in diameter
- Note: The cad can be edited to fit screw sizes of your choice
- TPI doesn't matter
- Screwdriver/Power drill
- Extra Thermal Paper Rolls
Circuitry
Start by gathering the following components:
- ArduCam
- Motor Driver L298N
- Speaker Module
- Mechanical Switch
- 8 Male to Female wires
- 2 Female to Female wires
- 2 Male to Male Wires
- 2 Barrel Jack to 2-Pin Adapters
- 1 +5v Micro-USB cable
- 1 +5V Barrel jack cable
- 1 +12V Barrel Jack Cable
There's quite a bit of wiring to be done, so we broke it down into several sections to make it easier to follow.
Section 1: Setting Motor Driver & Motor
- Between the Pi and the Motor Driver (Using 4 Male to Female wires):
- Connect one wire from Pi’s Ground (6) to the Driver’s Ground
- Connect one wire from GPIO 25 (22) to ENA
- Connect one wire from GPIO 24 (18) to IN2
- Connect one wire from GPIO 23 (16) to IN1
- Between the Motor Driver and the Motor (Using 2 Male to Female wires):
- Strip the Female end of the wires
- Connect one wire from Out1 to one of the Motor’s pins. Solder the connection of the open wire to the Motor’s pin
- Connect one wire from Out2 to one of the Motor’s pins. Solder the connection of the open wire to the Motor’s pin
- To power the Motor Driver (Using 2 Male to Female wires and 1 Barrel Jack Adapter):
- Strip the Female end of the wires
- Connect one end from the Driver’s Ground to the (-) side of the Barrel Jack Adapter
- Connect one end from the Driver’s +12V to the (+) side of the Barrel Jack Adapter
Section 2: Mechanical Keyboard Switch
- Between the Pi and the Mechanical Switch (Using 2 Female to Female wires):
- Strip one Female end of both wires
- Connect one wire from GPIO4 (7) to one of the Switch’s pins. Solder the connection of the open wire to the Switch’s pin
- Connect one wire from Ground (9) to one of the Switch’s pins. Solder the connection of the open wire to the Switch’s pin
Section 3: Thermal Printer
- To Power and Connect the Thermal Printer (Using Barrel Jack Adapter and the power and data cable included with the Thermal Printer):
- Connect the included power cable to the Thermal Printer’s side
- Strip both wires on the other end of the power cable
- Connect the black wire to the (-) side of the Barrel Jack Adapter
- Connect the red wire to the (+) side of the Barrel Jack Adapter
- Plug in the data cable to the Thermal Printer. Connect the other end into any USB port available on the Pi
Section 4: Speaker & Camera
- To connect the Speaker:
- Use any cable as necessary to connect the Speaker to the USB port on the Pi
- Plug in the ArduCam into the allocated slot on the Raspberry Pi
Section 5: Power and Testing
- To power all components:
- Connect the +12V Barrel Jack Cable to the Adapter that connects with the Motor Driver
- Connect the +5V Barrel Jack Cable to the Adapter that connects with the Thermal Printer
- Connect the +5V Micro-USB Cable to the Raspberry Pi
- Plug in all Barrel Jack Cables and the Micro-USB cable into a power strip nearby
Configuring the Pi
- Download the files attached, boothMain.py and scream.wav
- Placed the file main.py under the /home/pi/mu_code folder on the Raspberry Pi
- Place the file scream.wav under the /home/pi/Downloads folder on the Raspberry Pi
- Open Terminal. Run the following commands:
- sudo apt update
- sudo apt install python3-pip
- sudo pip3 install gpiozero
- sudo pip3 install time
- sudo pip3 install picamera2
- sudo pip3 install cv2
- sudo pip3 install numpy
- sudo pip3 install python-escpos
- sudo pip3 install PIL
- Now, we need to run the code whenever the Pi boots.
- Open Terminal and run: sudo nano /home/pi/.bashrc
- On the last line of the script, add:
- echo Running at boot
- sudo python3 /home/pi/mu_code/boothMain.py &
- This will also run the code whenever Terminal is opened!
- The code should all be done now! DO NOT REBOOT THE PI YET!! To test the code, open a Terminal window. If there are any errors, try redownloading the libraries that show up in the errors or searching up the errors to find out what is wrong. If the code works, the scream sound should play automatically, signifying that the photo booth is now ready to run!
- Once you can verify that the code works, now it is time to reboot the Pi and test!
Rack & Pinion Assembly
Start by screwing in the motor into the rack & pinion stand (if you haven't already). The stand should then be aligned with three holes near the back of the base. Three screws should be pushed in to lock it down to prevent the ghost that will be attached later from dismounting the entire stand
Slide the ghost onto the top of the stand, sandwiching the ghost's square hook in between the two squared shaped supports on the rack. Afterwards, put the rack up against the slot, vertically against the backing of the stand and slide the pinion in to lock it down
Note: The pinion print has a keyed hole to prevent slipping so ensure it is put in properly
Mounting Electronics
Start by mounting the Pi onto the elevated platform at the front of the pumpkin base. The orientation should be so that the USB cables face to the left with part of the Pi overhanging.
Next, slide in the Printer into its slot, making sure the printable area/slot is facing upwards so it can print through the mount of the pumpkin. Ensure your Thermal Paper was been loaded in.
Slide the micro USB cable into the open slot in the side of the cylinder of the pumpkin base. Plug in your speaker. Speaker holder may or may not have to resized depending what speaker you use.
Slide the Front of the pumpkin into position and lock it down using two screws, ensuring it is tightly fit with the base of the pumpkin.
For the last few steps, simply slide in the camera into the slot right between the eyes of the pumpkin. Note, it should be a tighter fit to prevent it from falling out. Finally, the mechanical switch is to be placed and hot glued to the inner surface of the pumpkin face.
Note the other unmounted electronics may just reside on top of the base within the pumpkin as long as it doesn't interfere with the ghost's path of travel. An example of this is the L298 that simply sits to the side of the rack & pinion stand.
Finishing Touches
You are almost done!
Unplug your barrel jack wires and micro USB and loop it through the hole in the back of he pumpkin. Then, slide in the back of the pumpkin into position, locking it down with two more screws.
Finally, insert your pumpkin top to hide the Ghost.
It's up to you whether you want to cover up the eyes with somewhat opaque paper to prevent your friends from seeing the inside of the pumpkin. However, it is highly suggested.
Scare Away Your Neighbors
We hope you guys enjoy our project as much as we did building it!