Your project doesn't have to be free. This awesome coin validator/acceptor module is like those in arcades. You can program it to accept coins with diameters from 10.8mm to 25.1mm, including American, European, Japanese, and Canadian coins. When a valid coin is inserted, the output line pulses for 20 - 60ms (configurable). It checks diameter, thickness, and dropping speed to validate coins, and you can choose 3 strictness levels. It comes with the acceptor, mounting hardware, and a power/signal cable. You decide how and where to store the coins. To program, power it with 12VDC, hold the top button for 5 seconds, then insert 30 sample coins. After the LED goes out, it's programmed. Connect a 10K (1K - 100K is okay) pullup resistor from the COIN wire to your microcontroller's VCC line and listen for pulses. You can download the Electronic Piggy Bank project code from github.

Using this coin acceptor is easy. First, program it to accept the type of coin you want. Power it with 12VDC. Press and hold the small button on top for 5 seconds and then insert 30 sample coins of the value you want to detect. Once the LED goes out, it's ready to use. Connect a pullup resistor from the COIN wire to your microcontroller's VCC line. When a valid coin is inserted, the output line will pulse. You can adjust the pulse time from 20 to 60 milliseconds. Make sure to choose the right strictness level for coin validation. As for maintenance, keep it clean and dry. If you encounter any issues, check the power connection and the resistor. And don't forget, you can download the project code from github to enhance your experience.