Once we heard the Halloween Mechatronics Contest was happening again in 2020, our team, The Gorgons (formerly Hell’s Angels), was back for redemption from our 2nd place finish in 2019. Unfortunately for us, the babies showcased in our previous entry are a year older and a year more opinionated, so they couldn’t be counted on to perform when the pressure was high. Luckily, there were four older children at our disposal who were looking for a chance at YouTube stardom. We put our heads together to come up with an idea for a contraption to showcase our electrical, firmware, and mechanical engineering prowess, and the concept of a spooky, socially-distanced, automated candy dispenser was born. Enter Medusa! The tragically misunderstood lady of Greek mythology whose terrible snake-haired visage turned onlookers to stone now protects our candy bowl from greedy trick-or-treaters by dispensing candy “safely” when asked.
The Gorgons Contest Entry
Electrical Engineering
This year we once again made use of the Adafruit Circuit Playground family of boards – very sensor-laden dev boards which are a great platform to develop a variety of ideas. To capitalize on BLE capabilities we choose the Circuit Playground Bluefruit. We knew we wanted to have the device automatically dispense candy to avoid the spread of COVID-19 so we used the on-board microphone to sense the children’s cries of Trick-or-Treat. Additionally, we used an ultrasonic sensor to sense the approaching rugrats and menacingly turn Medusa’s snakes’ eyes from green to red. The LEDs were neopixels once again, but in a new formfactor that was quite useful: a tiny 1cm rigid discs with a single pixel. They were easier to handle than the flexible strips although soldering wires to 24 pixels was quite time consuming. We found the dinky speaker on the Playground Bluefruit to not be loud enough, so we added an amplifier and speaker to allow for additional menace in the form of snake hissing and an evil cackle.
One feature which unfortunately did not make the cut was a giant vibration motor to make the snakes wiggle. We expected our construction to be a little pliant (this being a weekend project in our free-time) but the base for the medusa was super solid (due to excellent mechanical design) so the snakes did not wiggle! The system required more power than our previous entry, so we implemented a 5V plug-in power supply with and 8A output. Wiring is always a difficult problem on these projects, but we kept things fairly clean by not constricting it to a box and using a piece of copper clad PCB as a bus bar for the 48 power leads on the LEDs. It came together fairly easily on the EE end of things with only a minimal amount of soldering MOSFETs and LEDs backwards.
Wiring in process
Firmware Engineering
The Circuit Playground Bluefruit board again let us utilize CircuitPython for development, which maked the coding very simple and flexible.
Motor control was minimal this year. Kristin and Amy chose a very simple motor to control the candy drive. So it was all up to timing to turn the motor on for a few seconds to get some candy to fall down the shoot.
This project involved a lot of LEDs to control! Each of the ten snakeheads had two neopixels and Medusa had four neopixels to light up her mouth. Despite the quantity of LEDs they were easy to control with the addressable neopixels. The challenge came with controlling the LEDs to slowly change from green to red as tricker-treaters approached. The proximity sensor reports a distance measurement in centimeters. We took that and translated it into a color, controlling the red and green LEDs and leaving the blue unlit. The green LEDs started out fully lit and as the trick-or-treaters walked up the approach we started slowly lighting the red LEDs from 0 to 255 to produce a yellow color. As they kept approaching we started slowly reducing the green LEDs setting the color from 255 to 0 to end in an angry red eye color.
First night demo of the angry red eyes
We utilized the built in microphone to assess if the trick-or-treaters yelled ‘Trick or treat!’ to start the candy dispensing algorithm.
The audio out capabilities of the Adafruit board allowed us to play some creepy mp3 sound effects to ramp up the spooky fun. A rattlesnake hiss was added to the start of the candy delivery algorithm and a witchy cackle was added to the end. The audio proved to be a little tricky due to some memory management issues. The audio files would only play 10% of the time. The randomness was a bit amusing to us working on it but didn’t have the spooky feel we were going for. The issue was resolved by some additional garbage collection after each audio file was played. After this change, Medusa hissed and crackled reliably.
BLE capabilities was one of the benefits of using the Bluefruit Circuit Playground board. It allowed us to implement some easy commands to control Medusa from afar. If there was a particularly shy / quiet trick-treater, a simple command could be sent to Medusa to spit out some candy. Or to add a seemingly random hiss or cackle.
Mechanical Engineering
Our socially-distanced candy dispenser was mechanically broken into two subassemblies, the candy feed assembly and the Medusa façade. The candy feed assembly needed to provide an appropriate amount of candy to each trick-or-treater without crushing the candy, jamming, or relying on a lot of user intervention. A screw conveyor and hopper seemed like a great solution to this issue since the hopper could be filled at some interval by the user and the screw mechanism could easily be used to meter the candy based on how long the motor was turned on without crushing the candy like a sliding door might. The screw was 3D printed in four main pieces, the two halves of the screw, a motor mount end cap, and a static end cap, and then joined together with epoxy. A threaded insert was heat-set into the motor mount end cap to provide a mechanical lock against the motor shaft. The end supports were also 3D printed and an acrylic tube was meticulously handformed from an acrylic sheet using a heat gun; these parts were also epoxied together to form the trough of the screw conveyor system.
CAD model of the screw conveyor
The Medusa façade required a lot less mechanical engineering but a lot more solid modeling finesse and 3D printing power. The snakeheads and Medusa face were scavenged from free 3d models found online and then modified to provide holes for LED access, mounting points, and a candy slide. After running the 3D printer for two weeks straight, all of the components were ready for assembly. The snakeheads, with LEDs installed, were mounted to armature wire, which allowed them to be individually adjusted into the optimal positions for Medusa’s hairstyle, and then the armature wire was inserted into a wooden support that mounted behind Medusa’s head.
Assembly of Medusa’s head in process
The armature wire and LED wiring was covered with flexible, plastic wire loom tubing and zip-tied in place. Finally, the whole assembly was installed on top of a plinth that was made from concrete form tube and scrap wood and the Medusa façade was carefully painted a uniform, stony gray.
Carefully spray painting Medusa and her snakes
With both subassemblies complete, the connecting candy slide was constructed in place on the front porch from corrugated plastic sheets. This last-minute assembly allowed us to optimize the spacing between the candy dispenser and Medusa’s mouth to ensure that the candy made it safely to the waiting trick-or-treaters.
A former Hell’s Angels baby on the way to a Candy Dispensing Medusa Head
So, did The Gorgons get redemption this year? Well, we came in just a hair behind the first place winners (so close) but you better watch out for next year because we are already thinking of ways to engineer ourselves into first place gold.