Wire it in this order
Six connections. Five of them can go on in any order and the sixth cannot: VCC is an output, and connecting it while your microcontroller is still plugged into a computer puts two supplies on one rail.
The order
Press the button and the six connections go on one at a time. The order matters at one place only — the last step — but it is worth following the whole way through, because it means you never have the acceptor live while you are still poking at wires on the microcontroller side.
The three wires from the acceptor
| Acceptor wire | Module pin |
|---|---|
| Red | 12V |
| Black | GND |
| White | COIN |
| Grey | COUNTER (optional) |
The acceptor's own socket is printed DC12V, COIN, GND, COUNTER, which
is the same order as the module's COIN ACCEPTOR header. So the harness runs
straight across and does not cross over.
You do not need the grey wire unless you are using COUNTER mode. COIN or COUNTER is the page that decides which.
The two or three wires to your board
| Module pin | Your board |
|---|---|
| GND | GND |
| COIN or COUNTER | the GPIO your sketch names |
| VCC | 5V or 3V3 — last |
Ground is not optional and it is not implied. A pulse is a voltage, and a voltage only means something measured against a shared zero. Two boards that do not share a ground read noise, or read nothing, and the wiring looks perfect.
3.3 V or 5 V
The module leaves the factory set to 3.3 V. There is a selector on the back for 5 V, and it is the setting to change before anything else if your board is an Arduino UNO or another 5 V part.
Get it wrong in the safe direction — 3.3 V pulses into a 5 V UNO — and it may read them, may read some of them, or may read none. An UNO wants about 3 V for a HIGH, so a 3.3 V signal is only just over the line and there is no margin left for a long wire. Get it wrong in the other direction — 5 V into an ESP32 — and you are back to the problem the first page is about, just less dramatically.
Why VCC is last
VCC on the MCU header is power out. It lets the module run your
microcontroller from the same USB-C adapter, so the finished thing is one cable
and no separate supply.
While you are still uploading code, your microcontroller is powered by your computer over USB. Connect VCC as well and two supplies are driving one rail against each other. So: leave VCC off, get the sketch working, unplug the computer, then connect VCC. And in reverse every time you go back to uploading — take VCC off first.
When it does not work
Check in this order. Is the module's GND wired to your board's GND — that one silently produces nothing. Is the signal wire on the pin your sketch names. Is it on COIN when your sketch wants COIN, or COUNTER when it wants COUNTER. And has the acceptor been trained yet, because an untrained acceptor rejects every coin and never pulses anything.
VCC is connected while the programming cable is also in. Take the VCC wire off, upload, unplug the computer, then put VCC back. The module and the computer are both trying to drive the same supply pin.
5 V pulses into a 3.3 V input is the fault the module exists to prevent, so set it back. The selector is on the back of the module; 3.3 V is the factory setting and is what every ESP32 variant and the Pico want. Only a 5 V board such as an UNO needs the other position.
The library names one per board: D2 on an UNO, GPIO27 on an ESP32, GPIO17 on an ESP32-S3, GPIO4 on an ESP32-C3. Those are the ones its interrupt handling has been tested on. Other pins often work, but some cannot take an interrupt and the library falls back to polling without telling you.
How long a pulse lasts, and the one switch position that makes the library's default wrong.
The two switches →Edit this page — content/books/coin-acceptor/wire-it-in-this-order.mdx
Questions about this product
See what other owners have asked, and read their solutions.
Arcade Coin Acceptor Module Kit, USB-C Powered
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.