arcade kit/Power/03. Two USB sockets
Power · 03 of 11

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

Two USB sockets, two different jobs
Board USB only
Plugged in
Buttons
work
Coin acceptor
off
Serial monitor
yes
The buttons and joystick work and the power LED stays dark. The development board powers itself and hands its own supply to V(MCU); the diode stops it reaching the rest of the mainboard, so there is no 12 V and the coin acceptor is dead. This is enough for the first two chapters.

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 arePlug inWhy
Testing buttons and joystickBoard USBV(MCU) comes from the board
Testing coinsBoth12 V from USB-C, messages over the board's USB
Running a finished machineUSB-COne 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

The power LED is off but the buttons 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.

My computer does not see the kit on USB-C

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 board restarts when a coin goes in

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.

The acceptor lights nothing and takes no coins

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.

Where this goes next

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

Community

Questions about this product

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

Ask a question ↗

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.

Browse Modules and blocks on the forum