Halloween Project
Candy Dispenser
Mission
The goal of this project was to design a candy dispenser that would cost under $100 to make and would dispense only the specified amount of candy and can be left outside one's house on Halloween. This project ended with a showcase in which kids came and went trick or treating on Halloween, so my team also wanted to make sure our dispenser was fun and interactive.

Vision
In order to operate the device, the player follows the intuitive placement of parts from left to right. They start by pulling the tab on the ammunition dispenser and pushing it back in to dispense one singular piece of starburst. Next, the player loads the ammunition into the front of the candy launcher, pulls the ring back to compress the spring, aims the launcher at the cannon by turning the bearings, and releases to fire the candy. If the candy hit the orange circle at the center of the target, the piezo-electric sensors triggered an Arduino Uno to turn a stepper motor attached to the pinion on the automated dispenser, which works in the same manner as the manual dispenser to dispense two pieces of candy. If the player misfires and does not hit the target, they have the opportunity to repeat the process and dispense another piece of ammunition to try again.
Functionality
For the cannon, a spring-loaded design was selected to improve robustness and reduce design complexity, as well as add a bit more of a skill requirement to the “game”. Instead of using electronics, the spring mechanism meant that the cannon was very resistant to damage or malfunctions through many uses, and users had to decide how far back to pull the spring instead of just pushing a button.
The manual “ammunition” dispenser was structured to provide an easy way for individual Starbursts to be distributed. Pulling and reinserting the tab allowed for an interactive element, and the dispenser was also very resistant to damage or malfunction. It dispensed a single candy accurately every time, and was reset and ready for the next usage.
The reward dispenser included a rack and pinion that pushed out two reward Starbursts. This functioned very similarly to the manual dispenser, and the rack and pinion were fairly reliable for the repetitive back-and-forth motion needed to push out candies. The pinion was actuated with a stepper motor, which allowed for accurate turns to a specified angle that would move the rack an exact desired amount.
Finally, the target consisted of a wooden frame shaped like a ghost holding a pumpkin. The center of the pumpkin was 3D-printed PLA, which allowed for more accurate sensing of vibrations on the target (as the wood was ineffective for transmitting vibrations to the sensors). Three piezoelectric vibration sensors were attached to the back of the target center with adhesive in a triangular distribution. This meant that vibrations from candy hitting the target were sensed fairly equally across the entire target. During initial testing with a singular sensor, only vibrations in the middle of the target were sensed consistently, and the system was more susceptible to noise in the sensor readings. Meanwhile, with three sensors the readings could be averaged before analysis, which meant that the system was robust to noise or even single-sensor malfunctions.


Safety
The dispenser prioritizes safety in every aspect. The cannon’s range of motion prevents users from firing anywhere except into the box, with the swivel base limiting lateral rotation to within a 110 degree range. The cannon assembly also prevents the cannon from pivoting backward, instead being able to turn only as far as straight up. Due to the setup, it’s impossible to pull back the ring to launch in this orientation, so the cannon can only be fired in the intended direction. Additionally, the device contains no sharp edges, with all 3D-printed parts included filleted and sanded edges. Electronic components were hidden, contained, and insulated, and the moving mechanical components like the rack and pinion were also contained within a gravestone-themed housing to prevent any risk of injury.
​
The acrylic housing was an excellent method of waterproofing the system. The acrylic panels fit together well, and they provide a watertight shield against weather. Additionally, the dispenser components in the front were protected by the gravestone-shaped casings, and the cannon consisted only of 3D-printed PLA and ball bearings, which are resistant to standard weather conditions. The electronics in the back of the device were protected by a watertight laser cut wooden box, which only included a small slot in the side for cables. Any wiring running on the outside of the device was insulated using electrical tape, which prevented water damage and avoided any chance of users coming into contact with wiring.