coin acceptor/Power and wiring/04. Wire it in this order
Power and wiring · 04 of 11

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

Six connections, in this order
nothing connected yet
Six connections, and one of them is last on purpose. Press the button to put them on in 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 wireModule pin
Red12V
BlackGND
WhiteCOIN
GreyCOUNTER (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 pinYour board
GNDGND
COIN or COUNTERthe GPIO your sketch names
VCC5V 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

Nothing happens at all when I drop a coin

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.

My board resets, or the USB port on my computer complains

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.

I set the module to 5 V and now my ESP32 misbehaves

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.

Which GPIO should I use?

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.

Where this goes next

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

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

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.

Browse Modules and blocks on the forum