Interactive Cauldron With Hologram
by teamrhoepsilonkappatau in Design > 3D Design
33 Views, 0 Favorites, 0 Comments
Interactive Cauldron With Hologram
In 2023, 34% of Americans were planning to cut back on spending on Halloween decorations in lieu of economic difficulties. In light of this, we wanted to create an economical, interesting Halloween decoration.
Our design is a decoration that interacts with trick-or-treaters and hands out candies during Halloween. The main shape of the decoration consists of a cauldron, with a hollow interior that will be filled with candy. There is a Pepper’s Ghost illusion (“hologram”) on the top of the cauldron that changes based on user interactions. The cauldron, hologram, and audio components will interact with trick-or-treaters when activated by a load cell and PIR sensor.
Supplies
Tools
- 3D Printer
- Monitor
- Set of metric Allen keys
- Keyboard
- Laptop
- Safety Glasses
- Soldering Iron
- Hot Glue Gun
- Wire stripper
Materials
- Raspberry Pi 3B+
- 5” LCD Screen [can use any screen with HDMI, can modify mount to adapt to this]
- LED strip
- Black Filament
- Orange Filament
- PIR Sensor
- USB Speaker w/ microphone
- Load Cell
- HX711 Amplifier
- Acrylic sheet (9.5” by 5”) (We used 1/16” thickness)
- HDMI to HDMI Cable (12”)
- ¼” spacers (can 3D print these)
- Female to Female Jumper Wires
- Extension cord
- Power strip
- 5V MicroUSB power adapter (2x)
- AC Power Adapter
- M4 Bolts (25mm)
- M2.5 Bolts
- M3 Bolts
- M3 Heat Inserts
- M3 Nuts
- M2 Bolts
- Electrical Tape
- Solder
- Hot Glue Sticks
Software Needed
Operating System: Raspberry Pi OS Full
System-wide packages:
- dnsmasq
- hostapd
- fbi
Environment packages:
- sounddevice
- numpy
- threading
- queue
- wave
- flask
- flask_socketio
- fbi
Print All Parts
Print the cauldron and plate in Bambu Slicer (or any other slicer software) with 15% Infill, Rectangular infill. You will need the following:
1x Top Pumpkin
1x Bottom Pumpkin
1x Bottom Plate
63x Chains
The GrabCAD can also be found here: https://grabcad.com/library/interactive-cauldron-hologram-1
Create Acrylic Plate
- Cut out an acrylic plate with dimensions 9.5” x 4.8” x 0.0625” (1/16" thickness)
- Follow the drawing below to drill out the holes.
If you have access to a CNC machine, you can use the DXF file linked in step 1 to make these holes as well.
Prepare HX711
- Using a wire stripper, strip off some of the insulation of the four load cell wires. The wires we received were very thin, so we twisted them multiple times to create a braid. Then, using a soldering iron, solder the wires to the HX711. The red wire goes to E+, the black wire goes to E-, the white wire goes to A-, and the green wire goes to A+.
- We also used hot glue to secure the wires to the HX711.
- Snap a 4-pin segment from the provided pin headers. Solder this to the other side of the HX711 (the one marked with VCC, GND, DT, SCK)
Create Load Cell Apparatus
- Build the load sensor apparatus and attach it to the bottom of the cauldron. Use M4 nuts and bolts with 1/4" and 1/2" spacers. Note that spacers must be used to raise up the load cell to get accurate scale readings!
Note: We took the acrylic plate off the load cell in the second image to better show what the hardware looks like. The finished product should have the plate covering the load cell.
Install the PIR Sensor Onto the Cauldron
- Using M2.5 bolts, attach the PIR in the "nose" of the cauldron. There are extrusions for you to put the bolts into. Please note that these extrusions are a little fragile, so try your best not to put too much stress on them.
Wire the Load Cell and PIR to the Raspberry Pi
- Follow the wiring diagram above to connect the F-F jumper wires from the PIR and the load cell to the Raspberry Pi. For reference:
- Both VCC (red) wires need to go to 5V
- GND (black) can go to any Ground on the Raspberry Pi.
- PIR DOUT goes to GPIO21 (yellow)
- HX711 SCK goes to GPIO26 (pink)
- HX711 DT goes to GPIO4 (blue)
Prepare Pi Files
Raspberry Pi 3B+ requires 5V DC power.
- Unzip folder on personal device (https://drive.google.com/file/d/1OZ-RrEJ59icTGlfvFKjDhFrZLB8iW7AL/view?usp=sharing)
- Copy folder to USB Drive
- Insert USB Drive to Raspberry Pi via USB 3.0 or 2.0 port
- Copy the “Webserver” folder and its contents exactly into the Raspberry Pi’s home directory
- Check below for the folder hierarchy
- Raw code is pasted below for review.
~/Webserver/
|
|------venv/
|------sounds/
| |------pir/
| | |---Come closer denielle.wav
| | |---Come Closer.wav
| | |---Grab some candy if you dare.wav
| | |---Hey kid want some candy Alex.wav
| | |---Hey kid want some candy.wav
| | |---Reach into my mouth for some candy.wav
| | |---Reach into my mouth.wav
| | |---Stranger danger.wav
| |------weight/
| | |---Put that back James.wav
| | |---Put That Back Alex.wav
| |
|------images/
| |---open.png
| |---closed.png
|------static/
| |---socket.io.min.js
|------templates/
| |---index.html
|------app.py
Wav files in pir/ and weight/ can include custom wav files. MUST BE WAV FORMAT, ALL SEPARATE NAMES.
Below is the .py for review. You do not need to download this.
Downloads
Create Virtual Environment
- Open up Thonny, and create a virtual environment by pressing on the path in the bottom left corner, and click on new virtual environment
- Navigate in the file explorer popup to …/Webserver/venv/, then press create new virtual environment.
Download Systemwide Packages
In the terminal, type (without quotation marks):
- “sudo apt update”
- “sudo apt upgrade -y”
- “sudo apt install dnsmasq hostapd fbi -y”
- “sudo systemctl stop dnsmasq”
- “sudo systemctl stop hostapd” (Temporarily stop to prevent conflicts)
- “nano /path/to/your/venv/pyvenv.cfg”
- Change the line “include-system-site-packages = false” from false to true
- Press Ctrl + O, Enter, Ctrl + X
Download Environment Packages
- In the terminal, activate the virtual environment with “source ~/Webserver/venv/bin/activate”
- In the terminal, type (without quotation marks):
- “pip install sounddevice processing numpy”
- “deactivate”
Setting Up Access Point
In the terminal, type (without quotation marks):
- "sudo nano /etc/dhcpcd.conf"
- add the following to the bottom:
interface wlan0
static ip_address=10.0.0.1/24
nohook wpa_supplicant
- Ctrl + O, Enter, Ctrl + X
- "sudo service dhcpcd restart"
- "sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig"
- "sudo nano /etc/dnsmasq.conf"
- Add the following:
interface=wlan0
dhcp-range=10.0.0.2,10.0.0.20,255.255.255.0,24h
- Ctrl + O, Enter, Ctrl + X
- "sudo nano /etc/hostapd/hostapd.conf"
- Add the following:
interface=wlan0
driver=nl80211
ssid=CauldronNetwork
hw_mode=g
channel=6
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=cauldronadmin
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
- Ctrl + O, Enter, Ctrl + X
- "sudo nano /etc/default/hostapd"
- find the line "#DAEMON_CONF="""
- Replace with DAEMON_CONF="/etc/hostapd/hostapd.conf"
Managing Services
Enable everything by typing in these into terminal:
- "sudo systemctl unmask hostapd"
- "sudo systemctl enable hostapd"
- "sudo systemctl enable dnsmasq"
- "sudo systemctl start hostapd"
- "sudo systemctl start dnsmasq"
Type these into terminal (NOTE, RUNNING THIS WILL DISABLE PI WIFI, MAKE SURE ALL PACKAGES ARE DOWNLOADED):
- "sudo systemctl disable NetworkManager"
- "sudo systemctl disable wpa_supplicant"
Reboot pi with "sudo reboot"
After rebooting, type in terminal “iw dev”
- If wlan0 says AP, everything is fine, close terminal
- If wlan0 says managed, type these into terminal
- “sudo rfkill unblock wlan”
- “sudo ip link set wlan0 down”
- “sudo iw dev wlan0 set type __ap”
- “sudo ip link set wlan0 up”
- If needed, reboot again
Running the Program + Startup
- Open Thonny code editor
- Ensure that the interpreter is currently using the virtual environment (Check bottom right for ~/Webserver/venv/bin/python##
- Open app.py, to run manually, press run and display will force onto screen
Running Program on Startup (Optional):
- In the pi’s terminal, type (without quotation marks):
- “nano ~/.bashrc”
- Go to the end of the file and add this line:
- “sudo python3 /home/pi/Webserver/app.py &”
- If the step above did not work, then you need to replace /home/pi/Webserver/app.py with YOUR relative path to the app.py file
- Press Ctrl + O, Enter, Ctrl + X
- Type in terminal “sudo reboot” to reboot the pi
NOTE: If auto start does not work, it is likely an issue with your hostapd or dnsmasq not initializing the access point before the file runs. To fix this, undo step 12 and run manually with Thonny
Assembly
- Attach the Raspberry Pi along the bottom of the acrylic plate with 4 M2.5 bolts. Use 1/4" spacers between the plate and the Raspberry Pi to prevent damage to the Pi.
- Secure the LCD screen to the bent acrylic piece with M3 bolts, using 1/4" spacers. Important: the screen must be oriented with the HDMI port on the right side.
- Get a power strip, and place the 2 microUSB power adapters and the AC adapter next to each other. Place the 3D printed housing over them, and use M2.5 bolts to attach the housing top over them. Make sure that all the wires go through the top hole.
- Connect the 2 microUSB power adapters to the screen and the Raspberry Pi. Make sure the power brick is outside of the Cauldron, and the wires are routed through the hole included in the back of the cauldron.
- Place the acrylic plate assembly (with LCD screen and Raspberry Pi) on the top half of the cauldron, securing it with 4 M3 bolts.
- Install the LED strips on the bottom half of the cauldron, using an adhesive. Make sure the back of the LED strip wraps around the inside. Ensure that the power cable for the LED strip is placed away from the mouth of the cauldron. You may have to route the LED strips under the PIR sensor.
- Using 2 M5 bolts, attach the USB speaker to the back of the bottom half of the cauldron. Make sure the speaker faces towards the mouth. Plug in the USB associated with the speaker into the Raspberry Pi.
Connecting to the Pi Remotely
- Connect to the Pi's network, "CauldronNetwork"
- password is "cauldronadmin"
- Use google chrome on a separate device
- Goto "chrome://flags/#unsafely-treat-insecure-origin-as-secure"
- Add the Pi's ip to the box below (http://10.0.0.1:5000) and enable the flag
- Restart chrome and open http://10.0.0.1:5000
- Ip may be different depending on your config. Check the ip by hovering your mouse over the top right corner with the ↑↓
- Website will always be hosted on port 5000, so visit the website at https://YOUR_IP:5000.
- To properly initialize (autonomous mode), enable and disable microphone once upon startup
- Use headphones, and keep device away from pumpkin microphone to prevent feedback loop
Finishing Touches
- Place the top half of the cauldron onto the bottom half, aligning the holes with each other. The two halves should snap together nicely.
- Place the chain links onto the cauldron by hooking all the chains into each other, and into the loops that surround the top and bottom halves of the cauldron.
- Use an HDMI to HDMI cable to connect the screen to the Raspberry Pi.
- Run the program, and have fun!
You may also customize what the hologram displays by inserting your own MP4 files. Feel free to edit the code to add your custom interactions and voice lines!