Coin Acceptor - Programmable 1 Coin Type
Your project may be free-as-in-speech, but that doesn't mean it has to be free-as-in-beer. This handy coin validator/acceptor module is just like the ones you've seen in arcades. First, program it with what coin you want it to accept, any coin from 10.8mm to 25.1mm in diameter can be used so you can use American, European, Japanese, Canadian, etc. coins as long as they fit. When a valid coin is inserted, the output line will pulse for 20-60ms (configurable). The acceptor looks for diameter, thickness, dropping speed, etc to determine if a coin is valid. You can select 3 different "strictness" levels.
Comes with the acceptor itself, mounting hardware, and a cable for power/signal. The coin falls through, you choose how and where to store them.
To program the validator: power with 12VDC (power wire goes to +12VDC, ground wire to common ground). Press and hold the little button on top for 5 seconds and release. The LED will be on. Now insert 30 sample coins of the value you want to detect (say 30 quarters or 30 Euro coins). Once the LED goes out it's programmed! Connect a 10K (1K to 100K is fine) pullup resistor from the COIN wire to your microcontroller's VCC line (for Arduino, this is a +5V). Then connect/'listen' on the COIN wire for pulses. Insert a coin, and verify that the line pulses high for about 40 milliseconds.
You can download the Electronic Piggy Bank project code from github.