Coin Counter
I made this coin counter for a school project in which we had to learn how to use an arduino. It's mostly made for me to learn how to create stuff with an arduino. For this project i also learned how to use a lasercutter and 3d printer.
Supplies
Arduino uno
16x2 LCD Display
Aluminium foil
Stripboard or perfboard (stripboard preferred)
6 10k ohm resistors
1 220 ohm resistor
10k ohm potentiometer
The Sorter
The first thing i made was the coin sorter. The way i chose to sort the coins is based on size. This is a simpler way than most vending machines work. Those usually use a combination of systems to measure the coins, like size electrical resistance and weight. This may give more accurate measurements but isn't really feasable with my current skill and time limit.
While not really complex it's important to get exact measurements of the coins it has to sort. The way the sorter works is by having coins slide down a slope and falling in the first hole with the right size. So a fifty cent coin for example slides down to the 6th hole before falling down. This way the arduino just has to recognize that a coin fell down a certain hole to know it's value.
The reason i only made 7 holes instead of 8 is because the 1 and 2 cent coins are both unused, so i just chose to sort them at the same time.
The Wiring
The wiring is roughly as seen above. The best idea is to start with the screen. Be sure to get the 220 ohm resistor when connecting the LCD screen. The potentiometer in this setup is used to change the level of contrast in the screen. Do this first on a breadboard so you know if it al works.
After the screen is connected you can connect the other cables. This part will act the same as if you're connecting normal buttons except with the buttons taken out. The holes between the grey cables is where you connect the next part to.
Creating the Sensors
The way i chose to register coins falling down was with closing an electrical circuit. When a coin falls down it hits 2 pieces of aluminium foil and closes the circuit. This let's the arduino know a coin fell down.
Every hole except for the first one (the highest one) should get 2 pieces of aluminium foil. Either of those pieces should get connected to a grey cable from the last step. Every hole should get one piece connected to one of the left and one of the right cables.
The Code
The code for this project can be found here: https://docs.google.com/document/d/1GQUGITOzggiav9...
The way it works is by having a variable for single and tens for both euro's and cents. This means it can count up to €99,95! For every hole there is an if statement that checks if a coin fell through. If it registers a coin the corresponding if statement gets fired off and adds the amount of cents/euros that corresponds with that hole.
Putting It in a Case
For this step i chose to make a case that gives the coins into an open tray. This is because i had to showcase it working and this way i had enough with only one of each coin. The design of the case is mostly just a simple box with a hole for a screen ,buttons and a coin. The buttons are not currently used in this project but are leftovers from overambition in wanting to make a vending machine.