Introduction: DIY Vending Machine

About: My name is Wojtek and I am 21 years old student of electronic high school. I am passionate about electronics as well as recording and editing movies. I follow the rule: "Do not delay, do it today".

Three years ago, I started studying in an electronic technical college. One of the facts that surprised me at that time was the number of smokers because during breaks, half of the students left the walls of the school to unload their emotions after a forty-five-minute lesson. If I was a passer-by not knowing the area walking near the school during the break, I would call the fire brigade. A significant part of smokers buy cigarettes for pieces - this is how the idea of making a cigarette machine was born.

Step 1: Money Counter

The first part was creating the money counter. I printed a coin sorter using a 3D printer working in such a way that the coin dropped falls into the hole whose dimensions match the coin's size. Falling coin interrupts the beam of light sending by the emitting diode to the receiving diode, informing the electronic part about the value of the inserted coin. You can see a detailed description in my previous instructable.

Step 2: Electronics and Board

I will start working with the second part of this project by creating a circuit diagram because I know what electronic components I want to use. As always, I will use the microcontroller and battery charging modules and add a servo and step-up converter to them, because a 5V power supply is needed for proper servo working. I will also add i2c outputs to communicate with the money counter and to connect the OLED display. Then I need to put all the elements on the PCB and export it to Gerber files so that order it from a professional manufacturer.

Step 3: PCB Ordering

I went to PCBWay and clicked "Quote Now" and then "Quick Order PCB" and "Online Gerber Viewer", where I uploaded files for my board, so I could see what it would look like. I went back to the previous tab and clicked "Upload Gerber File", I chose my file and all parameters were loading themselves, I changed only the soldermask colour to blue and black. Then I clicked "Save To Card", provided shipping details and paid for the order. After two days the tile was sent, and after another two days, it was already on my desk.

Step 4: Desinging

My device should have a container for cigarettes that will fall into the compartment where only one cigarette can fit. After throwing in the right amount of money, it will be pushed out by a servo-controlled mechanism. It also cannot fall outdue to the movement of the machine, which is why I have to remember about proper protection. I'll start by designing a cigarette ejection mechanism. For this purpose, I imported a servo and created a holder and an element that converts rotational movement to linear movement. Then I made small corrections and printed the next parts of the vending machine.

Step 5: PCB Soldering

I will use a hot-air station when soldering elements on the board, so I will first apply solder paste to all soldering pads. [When I did it, it was so hot at the outside that the paste was melting, and if I put it outside I would not have to use the hot-air station to solder the elements. :)] I installed the nozzle with the largest diameter, set the temperature to 300 degrees and the airflow almost the smallest. There was no need to improve anything with a regular soldering iron, but I used it to solder goldpin connectors and a step-up converter. Finally, I cleaned the board with isopropyl alcohol and a toothbrush.

Step 6: Electronics Testing

I connected the oscilloscope probes (you can use a regular multimeter) to the connectors to which I will connect the servo and adjusted the voltage to 5V with a flat screwdriver. Then I connected a programmer to my board and uploaded the blink code to make sure that the microcontroller was working properly. The code is uploaded - everything is fine.

Step 7: Folding

The electronics work properly, the elements are printed, I can go about assembling the machine. I screwed the servo to the mounts, and to it the cigarette ejection element. Then I screwed all the printed elements together with small screws, put the electronics into the housing and connected to my board the servo, the display, a battery, a switch and the money counter. I put the housing cover on, which presses the board so that it does not move because I did not put the screw holes in the board and glued it. All that is left is put cigarettes in it!

Step 8: Summary

This design is only a prototype, it can be slightly modified and you can add e.g. other types of cigarettes and maybe a pump and liquid for electronic cigarettes. Of course, I do not smoke and do not encourage smoking, and even urge you not to smoke! Cigarettes are just an example of using your own mini vending machine, you can sell pens, pencils or maybe chewing gums, candies or gums that help you stop smoking. It all depends on your creativity! I invite you to check my previous projects!

If you have any questions, write to me:

My Youtube: YouTube

My Facebook: Facebook

My Instagram: Instagram

Order your own PCB: PCBWay