When I was a kid, every year for Halloween — instead of just handing out candy in a bowl — our neighbor would create a magical machine that allowed kids to select one of four types of candy using a Morse code key hooked up to a buzzer. After keying in the code, a light bulb over the selection would illuminate and the candy bar would come flying out of a chute. The premise of “The Machine” was that it was fully automatic (imagine a box about the size of 12-pack of beer, sitting on a table, with a curtain strung up behind it), and they did a great job keeping the story going year after year.
When our neighbor aged out, the responsibility for the Machine was bequeathed to me. It was then that I learned the truth about the man behind the curtain, who had to listen carefully to count the Morse code beeps, manually connect the wires to the right light bulb, and send the candy down the chute. To say this was a life-shaping moment would be an understatement. Ever since, I’ve wanted to make the real, fully automatic Machine.
Now my kids are about the same age I was then, so I decided it was time to make this dream happen. I also saw this project as a great opportunity to again experience the early product development cycle (I spent 10 years at iRobot leading the team that built the first 4,000,000 Roombas, and today through Dragon Innovation and Bolt I help companies like Jibo go from prototype to high-volume production).
Proof of Concept
Originally, our plan was to make the Machine work with no software. This plan changed quickly when we decided it was easier to use stepper motors rather than dealing with brushed motors and gearboxes. Our first task was figuring out the “material handling” for the candy. We landed on a design that used 1½” PVC tubes arranged like a pipe organ, with an actuator wheel made out of pieces of a flat brush from McMaster-Carr wrapped around a wooden dowel.
For the electrical engineering (EE) side, we purchased an Arduino Leonardo microcontroller. (Adafruit and Sparkfun both have amazing libraries and tutorials to help get you rolling with Arduinos.) From here, we built a proof of concept with one candy channel, and were able to prove out the feeder mechanism. Within a few minutes we were able to wire up the stepper motor, and cut and paste some simple code on the Arduino to get it to spin when a button was pressed, accompanied by flashing LEDs of course. (A task for next year is to close the loop and use a sensor to detect when the candy has been vended.)