Max Mednik
  • Home
  • About
  • Interests
    • Angel investing
    • Magic
    • Scuba Diving
  • Blog
  • Contact

Readings and musings

Automated Candy Engineering

11/4/2020

0 Comments

 
Picture
The process of building the automated candy dispenser was a roller coaster and definitely an example of the Pareto principle, where 20% of the details took 80% of the time.

I learned a lot through the experience and hope to have made a lot of kids happy. On the technical side, I learned about Arduino boards, basic programming, libraries, shields, and their IoT Cloud and Web Editor. I also learned about some of the capabilities and limitations of Alexa Routines and Skills. On the non-technical side, I learned that it's important to know what you're good at and not to be afraid to ask for help for other things (the software, electronics, and programming took me a few hours, but all the mechanical/building/cutting/drilling was a lot more tricky and new for me so I needed to ask for help from family with all that); I also learned that duct tape can do a lot but not everything, and if something doesn't work with duct tape to try a better (ideally mechanical) method.

Below you can read about the engineering process I went through, some of the design decisions, review of prior art, and areas for future work that I identified.

I started the design/engineering process defining the goals/objectives. I wanted to be able to dispense new, wrapped candy in a fully automated fashion with no human intervention and no human touching any of the candy at any time close to when it's dispensed.

I started to review the prior art and existing open source designs. I found a lot of helpful links on the Internet, especially the first one which goes through their engineering process and includes a parts list:
https://barkersrandomprojects.com/projects/candyDispenser (huge thanks to them for their guidance and support and answering questions)
https://www.instructables.com/id/Automatic-Halloween-Candy-Dispenser/
https://www.mentalfloss.com/article/87177/10-creative-halloween-candy-dispensers
https://www.benrady.com/2014/10/candy-or-death-the-automatic-halloween-candy-dispenser.html
https://makezine.com/projects/build-an-arduino-powered-candy-vending-machine/
https://blog.adafruit.com/2019/10/26/automatic-halloween-candy-dispenser-for-halloween/

I liked many of the elements of these other designs and took bits and pieces as inspiration for my design.

I decided to build a door opening and closing mechanism and have the candy fall out with the help of gravity. I realized (as did the Barkers team) that there would be jamming of candy, but I decided this wasn't a big deal; worst case it would mean variability in dispensing quantity, which could be solved by just having a larger reservoir of candy.

I looked around the house for reservoirs/hoppers and found a poster tube that could hold the candy. I did some quick experiments to see how fast candy would slide down it. I then asked around for a suitable Arduino servo motor and was recommended this one:
https://www.amazon.com/ZOSKAY-Coreless-Digital-Stainless-arduino/dp/B07S9XZYN2/ref=sr_1_3?dchild=1&keywords=servo+dispenser&qid=1600132935&sr=8-3

I also ordered some different chutes to test with from Home Depot:
https://www.homedepot.com/p/Speedi-Products-3-in-x-96-in-Round-Aluminum-Flex-Pipe-EX-AF-396/202907340
https://www.homedepot.com/p/Everbilt-4-in-x-8-ft-Semi-Rigid-Flexible-Aluminum-Dryer-Vent-Duct-MFX48XHD12/203626514
https://www.homedepot.com/p/Master-Flow-3-in-90-Deg-Round-Adjustable-Elbow-B90E3/100112500

To run the brain of the whole thing, I ordered an Arduino IoT kit, which included the microcontroller and a bunch of helpful accessories. Using their IoT Cloud and Web Editor and their own Arduino Alexa Skill, I was able to quickly program the microcontroller to connect to Wi-Fi and operate the servo motor when activated via Alexa. This article was a helpful inspiration:
https://blog.arduino.cc/2019/11/12/create-a-voice-controlled-device-with-alexa-and-arduino-iot-cloud-in-7-minutes/

With the software "done," I started working on the stuff that was harder for me: all the mechanical building stuff.

At first I duct taped the motor to the tube and screwed in a small piece of particle board. Below is my "v1" of the dispenser.

Picture
This version performed really poorly. There was jamming all over, and the motor kept moving and shifting, which prevented the door from operating as desired. I was almost ready to give up, but then I realized I should talk to some family members who have a lot more experience actually building real world (as opposed to software) things. I learned that building the assembly out of wood and screwing/clamping things down much more securely would address the shifting and door reliability issues. Also, constructing a door out of wood would make it operate more securely too.

With a lot of help, we were able to to build a much better v2:
Picture
I did some calibration of the optimal angle and door opening timing, which was easy to quickly iterate on with the Arduino. The main metric I was optimizing for was the # of dispenses before running out of candy (my optimal was about 20 for a full load of the pipe).

Here is a video of our first time testing the v2 with multiple dispenses in a row. The door was still too large, which resulted in chucking candies backwards, but that was easily fixed with trimming down the size of the door.
This is the core of the design we ended up going with. We added some spray paint and connected it to the chute with a simple funnel made out of a thick paper. We tied the whole thing down to a chair and balcony railing.

I considered a few other possible designs which I spent some time investigating as risk reduction steps in case the door mechanism didn't work out. First off, I looked into robotic arms/claws (even Arduino sells one) with the idea that an arm could pick up the candy and drop it into the chute. I was even thinking of controlling it with computer vision, maybe even with Google Coral. However, I realized there too could be risks with this related to the mechanical gripping/friction issues and also issues with candy not being uniform and kind of getting stuck in whatever hopper it was being scooped up/grabbed from.

A second design we thought of and actually started to build was based on vending machines which use coils/augers to push items forward. I ordered on eBay a few vending spiral coils and even a motor that connects to a cotter pin, and we put those into a poster tube, and that also seemed to do the job. This design might even better than the door mechanism since it dispenses candy in a more uniform fashion, but we didn't finish it so we don't know if there would be problems with loading in to the coil from the hopper or how to control how long to turn the coil when dispensing (or maybe you could sense a successful dispensing via an IR break sensor).

Running the dispenser all day for Halloween showed me some areas for future improvements. First of all, I would've wanted some way to know how empty/full the dispenser was and get a notification when it was totally out of candy. I did set up the Alexa Routine to notify my phone when it ran, and I kind of just kept track mentally of how much candy should be there. Also, it would be nice to have a "loading mode" where candy can be loaded or unloaded without the motor being connected and without the candy just falling straight out (maybe like with a manually operated second door).

Overall, this was a fun project, and I learned a lot about Arduino, Alexa, and building mechanical contraptions. I hope all this info is helpful to others looking to build automated candy dispensers in the future.
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Archives

    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    January 2022
    October 2021
    August 2021
    July 2021
    June 2021
    May 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    April 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    May 2019
    March 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    February 2018
    January 2018
    November 2017
    October 2017
    September 2017
    May 2017
    April 2017
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014
    May 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    February 2013
    January 2013
    December 2012
    November 2012
    October 2012
    September 2012
    August 2012
    July 2012
    June 2012
    May 2012
    April 2012
    March 2012
    February 2012
    January 2012
    December 2011
    November 2011
    October 2011
    September 2011
    August 2011
    July 2011
    June 2011
    May 2011
    April 2011
    March 2011
    February 2011
    January 2011
    December 2010
    November 2010
    October 2010
    September 2010
    August 2010
    July 2010
    June 2010
    May 2010
    April 2010
    March 2010
    February 2010

    Categories

    All
    Angel Investing
    Cacti
    Cars
    China
    Community Service
    Culture
    Design
    Djing
    Dogs
    Education
    Entertainment
    Entrepreneurship
    Family
    Finance
    Food
    Google
    Happiness
    Incentives
    Investment Banking
    Judaism
    Law
    Lighting
    Magic
    Marketing
    Medicine
    Networking
    Nolabound
    Philosophy
    Professionalism
    Psychology
    Reading
    Real Estate
    Religion
    Romance
    Sales
    Science
    Shangri-La
    Social Entrepreneurship
    Social Media
    Sports
    Teams
    Technology
    Travel
    Turtles
    Ucla
    Venture Capital
    Web Services
    Weddings
    Zen

    Subscribe

    RSS Feed

Picture
Picture
  • Home
  • About
  • Interests
    • Angel investing
    • Magic
    • Scuba Diving
  • Blog
  • Contact