Coin acceptor
This is one of the 2 commercial components that compose the assembled system.
Its purpose is to detect coins as they are inserted and:
- reject them if they are invalid or unknown
- allow them to pass if they are valid
- communicate with the main microcontroller to inform it of the value of the coin inserted, so it can keep track of the different types of coins we have.
Configuration
For Iteration 1, I wanted to be able to accept all coins, without having to program the coin acceptor.
Reasons:
- It allows me to start designing a packaging and casing that will be able to integrate the coin acceptor, even if I don’t have time to program it to recognize euros.
- It eliminates having to create a backup plan for:
- What if I cannot use the coin acceptor.
- What if I want to integrate it in the future.
- Design 3D pieces for each of these 2 scenarios and make sure the overall design can incorporate them both.
The datasheet for the 6CoinAcceptor device (the larger device that encapsulates all of the functionality) reads like this:
This beautiful feature, which can be controlled through the INHIBIT switch jumper and the 5V input pin, allows me to set the coin rejection policy. This policy can be set to accept all coins (for iteration 1), and to easily enable complete coin detection in the future, if I have more time.
Win/Win…
Thank you, Electronic Engineers! 🎉
Bad news
Unfortunately, this did not seem to be true when I attempted to get it working for real.
Initially, I thought it was because some of the coins did not meet the basic requirements of the 6CoinPro, which is the actual coin detector device that is embedded inside the coin acceptor and classifies coins by type.
Its datasheet reads like this.
So my fears dissipated quickly and I thought of a more realistic scenario: that I had (probably) misunderstood the first datasheet!
After lots of attempts, I believe the first data sheet is written in ambiguous terms. I believe when they wrote “it will accept all coins” they meant to say “it will accept all of the coins that it recognises”, not just any object you through in it! This INHIBIT flag/feature will not blindly accept everything, you still need to teach it was coins are ” actual coins”. It seems that the Inhibit feature is to disable coin acceptance, for example when your product/machine is out of stock, is not working properly, etc… (eg. a vending machine that is broken, or has no cans left, will disable the acceptor so people understand that they will not be able to purchase anything until it’s fixed or replenished).
This means I will have to program the coins even for iteration 1, even if I cannot process and parse its serial signals.
A quick online tutorial explains how to do that in a few minutes.
The finished component
This is the outcome after programming the first 2 coins.
Assets
Assets: Assets in gitlab