1. Modify the candy dispenser
We kept the batteries, but removed the touch sensor and, instead, connected straight to the candy machine motor to complete the circuit. This may require some wire stripping, soldering and/or duct tape. And remember to remove the batteries before you start taking things apart. :-)
2. Set up your circuit
Check out our handy circuit diagram below for how to connect your kit.
We've used a power bank to power our particle Photon, it's great because of it's size it can be placed anywhere and rarely needs to be recharged.
We also kept it simple with the Photon code by using a tweaked version of the Blink an LED starter projects include in the Photon set-up tutorial, and used our Android app to tell it when to run. Include a third variable "int led3 = D6" to each section, and adjust how much candy is dispensed by updating the delay time in the code - simples!
3. Make it rain candy
For our project we made an Android app using the new Google ML Kit face recognition. But you can trigger your Photon with a simple post function. Try it out with the simple html web page included below.
Smarties, Skittles or M&Ms are the perfect size for this dispenser. Now get yourself some candy and enjoy the smiles!