when I was walking throw ODC I found a big machine called vending machine
this machine consists of many parts we discussed at the coin acceptor where we can give it a coin and it decides if our given coin is valid or not
Some sketches
First sketch by hand
My first imagination about design
Toolchain
Arduino uno
9V battery
limit switch*2#
servo motor
resistor
LED
Preparation Process
Tenkercad
I used Tinkercad to simulate my circuit before wiring it physically
For more demonstration
1- I use 2 limit switches as an input component
2-And my output component is a movement action by a servo motor and graphical (emitting light)
If scope
in this case, I command my Arduino to read the state of switch 1 and then read the state of switch 2 if switch 1 is high and switch 2 is low move my servo to 0 degrees and wait for 2 sec to let our coin get out of the machine then goes to the degree 90 (normal state)
else scope
in this case, I command my Arduino to read the state of switch 1 and then read the state of switch 2 if switch 1 is high and switch 2 is high move my servo to 180 degrees and wait for 2 sec to let our coinget into our machine then goes to the degree 90 (normal state)
Development Process
In the future, I will use a metal detector to check if the inserted coin is a metal coin or a fake coin made out of plastic for example
Final Project
this video shows my device wiring and testing
What is the coolest thing that you've learned this week
In the first place youtube platform, slack community troubleshooting
some of problems I faced
1* if I insert a fake coin at some times my system recognizes it as the right coin because time is needed to check the coin *so I added a delay time of 2 sec to let my coin settle down in its place and sensors take a signal and send it to my arduinio