DIY Automated Halloween Candy Vending Machine

by MAKE_IT WITH_ME in Circuits > Arduino

149 Views, 1 Favorites, 0 Comments

DIY Automated Halloween Candy Vending Machine

WhatsApp Image 2023-11-13 at 22.32.33_d06cad4c.jpg

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

WhatsApp Image 2023-11-10 at 23.13.43_aabaf883.jpg
WhatsApp Image 2023-11-13 at 23.55.28_31e9a133.jpg

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

Screenshot 2023-11-13 at 23-12-12 3D design Exquisite Krunk Tinkercad.png
Screenshot 2023-11-13 at 23-13-00 3D design Exquisite Krunk Tinkercad.png

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

WhatsApp Image 2023-11-10 at 23.12.49_57c0a48e.jpg
WhatsApp Image 2023-11-10 at 23.13.40_f62dbe43.jpg
WhatsApp Image 2023-11-10 at 23.13.39_0479ac09.jpg
WhatsApp Image 2023-11-10 at 23.13.38_e1337f07.jpg
WhatsApp Image 2023-11-10 at 23.13.37_47f518c4.jpg
WhatsApp Image 2023-11-13 at 22.29.10_6b1c3fad.jpg
WhatsApp Image 2023-11-13 at 22.29.10_34fd168b.jpg

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

WhatsApp Image 2023-11-10 at 23.12.46_4a3c9da1.jpg
WhatsApp Image 2023-11-10 at 23.12.44_29a4a9c8.jpg
WhatsApp Image 2023-11-10 at 23.12.42_391ea27c.jpg
WhatsApp Image 2023-11-10 at 23.12.15_c1f7227f.jpg
WhatsApp Image 2023-11-10 at 23.12.11_96f34ce8.jpg
WhatsApp Image 2023-11-13 at 17.50.40_15bd8593.jpg
WhatsApp Image 2023-11-13 at 17.50.47_e3342275.jpg

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

Screenshot 2023-11-13 at 23-51-21 Untitled design(9).png (PNG Image 1920 × 1080 pixels) — Scaled (51%).png
WhatsApp Image 2023-11-13 at 17.50.56_c08b46cf.jpg
WhatsApp Image 2023-11-13 at 17.50.55_33e04ac8.jpg
WhatsApp Image 2023-11-13 at 17.50.59_b5484042.jpg
WhatsApp Image 2023-11-13 at 17.51.03_8cfa1064.jpg
WhatsApp Image 2023-11-13 at 17.51.01_acf2ba60.jpg

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

WhatsApp Image 2023-11-13 at 17.51.00_2beae5a0.jpg
Screenshot 2023-11-14 000734.png

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.

Cover Up

WhatsApp Image 2023-11-13 at 22.29.09_9cc63dd5.jpg
WhatsApp Image 2023-11-13 at 22.29.08_e92af4f8.jpg
WhatsApp Image 2023-11-13 at 22.29.07_d5b0080e.jpg
WhatsApp Image 2023-11-13 at 22.29.06_ccc85c28.jpg

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!

WhatsApp Image 2023-11-13 at 22.32.32_591c35da.jpg
WhatsApp Image 2023-11-13 at 22.32.34_f07ff968.jpg
WhatsApp Image 2023-11-13 at 22.32.33_79ad1293.jpg
WhatsApp Video 2023-11-13 at 22.29.06_8e15fcc0
WhatsApp Video 2023-11-13 at 22.28.33_83f4c481

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.