Two USB sockets
The development board's USB socket carries your program and its messages. The mainboard's USB-C carries power and nothing else, and it is the only thing that makes the coin acceptor's 12 V. Which you plug in decides what works.
Two sockets, two jobs
The development board's own USB is how programs get in and how
Serial.print or MicroPython's print gets out. It also powers the
development board, and through the adapter it powers V(MCU), the rail every
button hangs from.
The mainboard's USB-C has no data contacts at all. It feeds the mainboard's 5 V, which does three things: lights the power LED, feeds a boost converter that makes about 12 V for the coin acceptor, and passes through a diode to the adapter's 5 V pin so the development board can run from it.
The diode between them
That diode, D7, is why plugging in both is safe for the mainboard. Current can go from the mainboard to the development board and not back, so a development board on its own USB cannot try to run the coin acceptor through the mainboard's circuits. It is also why the power LED stays dark when only the development board is plugged in: the LED is on the mainboard's side of the diode.
Which to plug in, and when
| You are | Plug in | Why |
|---|---|---|
| Testing buttons and joystick | Board USB | V(MCU) comes from the board |
| Testing coins | Both | 12 V from USB-C, messages over the board's USB |
| Running a finished machine | USB-C | One supply for everything |
The 12 V rail
The boost converter is an MT3608. Its feedback divider, 51 kΩ over 2.7 kΩ against a 0.6 V reference, sets the output at about 11.9 V. Nothing but the acceptor socket's +12V pin is on that rail. It never reaches the header, so no development board pin can see it; the next two chapters show how the acceptor's signals are kept to your board's own voltage.
When it does not work
That is correct with only the development board's USB plugged in. The LED sits on the mainboard's own 5 V, which only the USB-C socket feeds. The buttons run from the development board's supply through V(MCU), so they work without it.
It never will. The mainboard's socket has power contacts and no data contacts. Plug the computer into the development board's own USB socket to upload code or read the serial monitor.
The supply sagged when the acceptor's coil moved. Use a real 5 V, 2 A adapter on the USB-C socket, not a laptop port or a thin cable, and keep the cable short.
It has no 12 V. That rail is made on the mainboard from the USB-C socket, so the development board's USB alone cannot power it. Plug the USB-C in as well.
V(MCU), the resistor on every input, and why the kit needs no level shifter.
Why pressed reads HIGH →Edit this page — content/books/arcade/two-usb-sockets.mdx
Questions about this product
See what other owners have asked, and read their solutions.
HotSwap Arcade Kit: Buttons, Joystick and Coin Acceptor for ESP32-S3, Nano, Pico and Zero 2 W
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.