Introduction: Candy Catapult
As years pass, we see less and less trick-or-treaters roaming around neighborhoods for candy, and wanted to make a product that would encourage the holiday. This project was made as a solution to making Halloween more fun for trick-or-treaters.
The Candy Catapult launches candy via a gear mechanism for a distance of ~6 feet, through the use of a website. This non-contact nature was incorporated to combat transmitted illnesses during Halloween. Trick-or-treaters can catch the flying candy with their buckets, and avoid illnesses in one go!
Supplies
Banana plug to alligator clips
ASUS router (any router can be used)
Vex metal supports
- 2 15x30 Baseplate
- 4 5x1x25x1 Steel C-Channel
- 1 cut 2x1x15x1 Aluminum C-Channel
- 2 2x1x25 Steel Chassis Rail
- 4 2x2x15 Angle
- 4 2x2x20 Angle
- 2 1x8 Steel Bar
- 1 Pulley Gearbox
- 4 12" Shafts
Step 1: The Base
Starting with the steel base, attach 4 2x2x20 angles and 2 2x2x15 angles onto the sides of the baseplate, where they would be mirrored on the other side. Make sure they are evenly spaced, and that the 2x2x15 angles are in front of the catapult (where the projectile will go). Attach them with 4 screws on each angle, each side.
Secure attached angles with an additional 2x1x25 steel chassis rail on each side on the base, and secure that with 4 screws each angle each side. Additionally, add a 2x2x15 angle to secure the middle section of the vertical angles, and the two 8 aluminum cut bars and connect them to the 2x2x20 and 2x2x15 angles to secure them.
Step 2: Motor and Shafts
Put the 30 teeth sprocket onto a shaft, and put the shaft into the front of the catapult in the 2x2x15 angles. Then secure the shaft using shaft lockers, and attach the motor to that shaft. Secure it in place using the #8-32 Hex Drive screws.
Put the 12 teeth sprocket onto the second shaft and a 6 teeth sprocket next to that sprocket with some distance between them. Attach the shaft onto the middle 2x2x20 angles, and connect the 12 teeth with the 30 teeth via chains. Secure the shaft using shaft collars.
Attach the cut 2x1x15x1 Aluminum C-Channel onto the last shaft (¼ of the shaft should be on the side of the shaft opposite of the spoon), and attach the last 18 teeth sprocket, and line that up with the previous 6 teeth sprocket. Secure the C-Channel with shaft collars, and attach this shaft onto the final 2x2x20 angle and connect the 6 teeth sprocket with the 18 teeth sprocket via the chain. Then, above that shaft, add another shaft to stop the C-Channel from rotating too far.
Step 3: The Spoon
Assemble the 3D spoon with 2 screws and put the 3D printed spoon onto the Aluminum C-Channel and attach it to the very end, on the back side of the catapult with 2 screws.
Step 4: A 2nd Floor
In order to make the catapult higher off the ground, put another base plate under the catapult, and elevate it using the 4 5x1x25x1 Steel C-Channels. Secure it with as many screws as needed to prevent wiggling.
Attach the Pulley gearbox to the C-Channel nearest to the motor on the inside. Ensure it is elevated (around half-way up).
Step 5: Wire Up Electrical Components
Connect usb to power raspberry pi and connect raspberry pi by ethernet cable.
Connect raspberry pi to GPIO extension board with extension cable
Put GPIO board on a breadboard for easy access
Connect GPIO pin 5 and 6 on the breadboard to motor control to IN1 and IN2
Connect power supply black wire to ground and red to 12v, connect motor to motor controller
Step 6: Software
Download vs code and start coding the server.
Write a script to determine the forward direction, test IN1 low, IN2 high and IN1 high, IN2 low combination.
When the backend server receives a get request for forward, set GPIO IN1 to low and IN2 to high. When received, the request to reverse will set IN1 to high and IN2 to low and reverse.
Write a nice UI with nextjs for frontend, build static html and upload it to server
What we used:
Backend python server:
https://github.com/04041b/catapult_python_backend
Beautiful anime background frontend:
Step 7: Start Server
Unplug ethernet connection between the laptop and Raspberry Pi. Connect the Raspberry Pi with router using an ethernet cable and connect router to power. Connect router to laptop with an ethernet cable (optional).
Login to the router and found Raspberry Pi's IP address, ssh with the new IP, start the server.