Coin acceptor with relay project
Moderators: grovkillen, Stuntteam, TD-er
Coin acceptor with relay project
Hello to all, I decided to make a coin acceptor relay board with nodemcu with your helps. I have a cheap chinese coin acceptor mechanism. There are Ground, coin and dc+12 pinout at hte coin mechanism. Which pins should I use at the nodemcu? Later I will connect an LCD to the nodemcu.
- Attachments
-
- 2.jpg (115.64 KiB) Viewed 2257 times
-
- 1.jpg (326.8 KiB) Viewed 2257 times
Re: Coin acceptor with relay project
What voltage is there at the "coin" pin?
Or is it a mechanical switch and if so, will it connect to GND or +12V?
Or is it a mechanical switch and if so, will it connect to GND or +12V?
Re: Coin acceptor with relay project
Sorry I am not familiar with that mechanism but can you look at that page "https://miliohm.com/coin-acceptor-or-co ... h-arduino/" and help me. Somebody make it with arduino.
Re: Coin acceptor with relay project
OK, that's very simple indeed.

You simply add some pull-up resistor between 3V3 and the "coin" pin.
The "coin" pin should then be connected to a GPIO pin on the ESP.
Please consult these tables to pick the right GPIO pin: https://espeasy.readthedocs.io/en/lates ... on-esp8266
Then connect the ESP ground to the ground of the coin acceptor.
Just make sure both are powered via either the same power supply (and thus have a voltage regulator from 12V to what is needed for the ESP) or 2 separate power supplies which can share a common ground.
In other words, if you join both grounds, nothing should start to smoke
For the chosen GPIO pin, you must then add a pulse-counter task in ESPEasy.
I think you may also need to set some "debounce time", like 100 msec.
Set the trigger to "rising" in the pulse counter task.

You simply add some pull-up resistor between 3V3 and the "coin" pin.
The "coin" pin should then be connected to a GPIO pin on the ESP.
Please consult these tables to pick the right GPIO pin: https://espeasy.readthedocs.io/en/lates ... on-esp8266
Then connect the ESP ground to the ground of the coin acceptor.
Just make sure both are powered via either the same power supply (and thus have a voltage regulator from 12V to what is needed for the ESP) or 2 separate power supplies which can share a common ground.
In other words, if you join both grounds, nothing should start to smoke

For the chosen GPIO pin, you must then add a pulse-counter task in ESPEasy.
I think you may also need to set some "debounce time", like 100 msec.
Set the trigger to "rising" in the pulse counter task.
Re: Coin acceptor with relay project
Thank you very much.TD-er wrote: ↑17 Aug 2022, 23:25 OK, that's very simple indeed.
You simply add some pull-up resistor between 3V3 and the "coin" pin.
The "coin" pin should then be connected to a GPIO pin on the ESP.
Please consult these tables to pick the right GPIO pin: https://espeasy.readthedocs.io/en/lates ... on-esp8266
Then connect the ESP ground to the ground of the coin acceptor.
Just make sure both are powered via either the same power supply (and thus have a voltage regulator from 12V to what is needed for the ESP) or 2 separate power supplies which can share a common ground.
In other words, if you join both grounds, nothing should start to smoke
For the chosen GPIO pin, you must then add a pulse-counter task in ESPEasy.
I think you may also need to set some "debounce time", like 100 msec.
Set the trigger to "rising" in the pulse counter task.
- Attachments
-
- page2.png (48.74 KiB) Viewed 2214 times
-
- page1.jpg (85.95 KiB) Viewed 2214 times
Re: Coin acceptor with relay project
I want to coin activated relay. Here is my project. LCD's first row type "please insert 3 coin" then if somebody insert 3 coin LCD's same (or second) row type "please push green button to start" then if green push button is pressed relay activated for 300 second by the way same (or third) row types "until finish ...... (countdown second)second remains. After 300 second later relay will off. At fourth row will type "push red button whenever to stop". Can you help me for coding it?
- Attachments
-
- project.jpg (83.62 KiB) Viewed 2211 times
Re: Coin acceptor with relay project
Maybe others can help you first here as right now I'm working hard on other issues regarding ESP32 issues regarding the flash and sending data via HTTP (2 separate issues)
Re: Coin acceptor with relay project
It is been long to activate my coin acceptor with relay project. I have a big issue at the Pulse counter. As I attach the video, when I just touch the coin acceptor with coin, the pulse counter start to count without insert the coin. Please see the video and see what I mean. How can solve that issue?
- Attachments
-
- ask1.png (52.07 KiB) Viewed 133 times
-
- ask gif2.gif (4.25 MiB) Viewed 133 times
-
- ask.jpg (3.37 MiB) Viewed 133 times
Re: Coin acceptor with relay project
Check your wiring, and GND to earth connection, as you seem to be injecting some external interference.
Have you tried increasing the Debounce-time to a larger number? 200 mSec seems more appropriate to me.
And adding a small capacitor across the pulse-counter input and GND, close to the ESP, might also help suppressing the interference.
Have you tried increasing the Debounce-time to a larger number? 200 mSec seems more appropriate to me.
And adding a small capacitor across the pulse-counter input and GND, close to the ESP, might also help suppressing the interference.
/Ton (PayPal.me)
Re: Coin acceptor with relay project
incereasing debounce time not help to me, please sugget me the capacitor value to add ?Ath wrote: ↑17 Mar 2023, 16:58 Check your wiring, and GND to earth connection, as you seem to be injecting some external interference.
Have you tried increasing the Debounce-time to a larger number? 200 mSec seems more appropriate to me.
And adding a small capacitor across the pulse-counter input and GND, close to the ESP, might also help suppressing the interference.
Re: Coin acceptor with relay project
That capacitor couls be around 100 nF, I think.
/Ton (PayPal.me)
Re: Coin acceptor with relay project
You can compute the rise/fall time of the signal for a capacitor + resistor.
For example: https://www.digikey.nl/en/resources/con ... e-constant
The RC time should roughly be 10 msec...
So 10 uF and 1k resistor... or 100 nF and 100k resistor should be fine.
For example: https://www.digikey.nl/en/resources/con ... e-constant
The RC time should roughly be 10 msec...
So 10 uF and 1k resistor... or 100 nF and 100k resistor should be fine.
Re: Coin acceptor with relay project
Does this also happen when only the coin module is connected and you measure the output with a multimeter for example?
If it produce the same results, than probably the coin module is broken / has issues...
Who is online
Users browsing this forum: No registered users and 1 guest