Hi, currently i'm using an ALLAN coin acceptor connected to my MEGA 2560 With WiFi Built-in - ESP8266, i have tried to follow the following tutorials on youtube:
however when i tried running their code, and did the wirings right for the coin acceptor, no pulse was shown on the arduino. I tried running it on a spare uno, but it still wont show any pulses.
Code i am currently using (provided in one of the tutorials):
I can see that you are powering the coin acceptor from a power supply that is out of the picture.
You need to have a connection between the Arduino GND and the coin acceptor GND.
Without that connection, the Arduino input has no reference to determine whether the input is high or low.
Also that code is poor.
The output of the coin acceptor is a series of pulses, whose width can be set to one of three widths using the Fast/Medium/Slow slide switch on the coin acceptor.
The code just reads the state of the coin acceptor output, and displays a 1 or 0 on the LCD.
After a delay of 35ms it will test the output of the coin acceptor again and display the result.
With the combination of that delay and the pulse width, the code might or might not accurately capture all the pulses from the coin acceptor.
All you are going to see on the LCD is a a number that flickers between 1 and 0.
Better code would use the techniques shown in the Arduino IDE example "StateChangeDetection" to count the pulses, and display the total.