DIY Automated Halloween Candy Vending Machine
by MAKE_IT WITH_ME in Circuits > Arduino
161 Views, 1 Favorites, 0 Comments
DIY Automated Halloween Candy Vending Machine
We are all aware of the Halloween tradition. Apart from the diffusion of Halloween costumes the major components for kids is the Halloween candy. But for many years its getting worse than ever. Kids trying to grab as many candy as possible without thinking of others, which is bad. So for a change, lets make an automated DIY Halloween themed candy vending machine.
This entire project is DIY (Do It Yourself) which means that I can only provide you the basic idea on how to design it, not on how to replicate it with the same dimension.
Supplies
Cardboard box and some sheet of cardboard
White cloth
Black marker
Glue, and other necessary materials.
Electronic Components:
1x ESP8266(Nodemcu) or any other compatible micro-controller
1x Servo motor with servo horns
1x HC-SR04 Ultrasonic Sensor
1x 5V Power Supply module (If available)
Prototyping
Before starting this projects, I need a base 3d design on how the bot should be. For this I used Tinkercad for designing.
Since I didn't had access to 3D printing service, I had to make all using cardboard. So if you wish to go for 3d printing, its your choice as you can use my design as a base model.
Face Please
Cut out 2 holes at the top of the box that could fit the HC-SR05 ultrasonic sensor in place. On bottom part, cut out a mouth such that the size of the mouth is a bit bigger than the size of the candy that you choose.
The same step is done with the white cloth.
Candy Storage
Since it was important that the candy could slide easily, I had to create a slanting path for it. As you have seen in the 3d prototype, there is a square hole at its end through which our candy moves out. The size of the hole could vary based on the size of candy as well as the average candy that must be removed during each call. So to controlling its flow, I had to attach a servo motor to its back as well as a small piece of cardboard which acts as a door. Finally I had attached a small cardboard at the bottom of the storage area through which the candy is directed towards the mouth.
Also I had to create a small opening at the top through which I can refill the candy.
Wiring
If you have seen in Step 3, the bottom part of the support structure is not glue to its surface, this is because it is the place where all our electronic components resides.
Connect all the necessary components as shown in the above circuit diagram. Since I was using an external power supply module, I had to make a small hole at the edge to connect the cable onto it. Also since there are few moving elements inside, It's better to have a proper cable management and placing the components in its right manner as possible.
Programming
Based on the type of microcontroller used, the output pins might differ. In my case, I am using a ESP8266 based microcontroller. Here trigger pin of HC-SR05 is connected to D6 and echo to D5. In case of servo, it is directly connected to D4.
In addition to the basic working cycle, I have also included the arduino OTA library for wireless programming. This is because there are instance where you might need to change the code for external modification, etc.
Downloads
Cover Up
Take the white cloth and cover it. Make sure that the eyes and mouth align properly. You can also use any black market to create an outline.
It's Show Time!
Even though my design has little flaws, I hope that you people could bring up a better solution. With this I hope you had a great Halloween.