How to control a coin acceptor (Nerdkit)



I have seen many times on eBay this nead Multi Coin Acceptors and got interested how I can handle the output signal.

So I have orderd one of them for 30 Dollars and waited for the arrival.

Model JY-923 which is able to learn 3 different types of coins.

You only have to sample each coin the get it working. In real it is a little bid more difficult. :-)

Just one thing which is really important. Do not use the Minus Button, besides you really need it.

Using the Minus Button, always messed up my whole config.


I tried to build a project where I have to enter the right sequence of coins.

Therefore the microcontroller must be able to differ between the coins out of the signal from the Coin Acceptor.

I used the tempsensor program of the nerdkit to read the input signal.


I set my Coin Acceptor like that:

H1 25, 5, 5        -        Coin 1: 25 samples, 5 pulses, accurancy value of 5

H2 25, 18, 5      -        Coin 2: 25 samples, 18 pulses, accurancy value of 5

H3 25, 35, 5      -        Coin 3: 25 samples, 35 pulses, accurancy value of 5


A1 = 10 cent, A2 = 20 cent, A3 = 50 cent


Hardware Switches were set to NC and SLOW.

NC means I am using a Normal Closed Signal.

SLOW means that the signal is peaking as slow as possible.



The connector of the Coin Acceptor has 4 wires (red, white, black, grey)

red -> VCC

white -> GND

grey -> External Counter

white -> Signal Wire


The white wire to PC0 of the ATMega168.

The red wire to + of an external 12V battery.

The black wire to - of the external 12 battery.

Important is here that you use a common GND (12V battery and Development Board).


With this program you are now able to detect 3 different types of coins.


On the HD44780 display you can see a little helpful output:

1st row: Shows if the 3 coins have been inserted in the right order.

2nd row: Shows the pulse count which has been entered on device itself.

3rd row: Shows if the last pulse ended or is still in progress. With a value of 15 the last pulse ended.


You can download the whole program in the download section.