A coin mechanism is what turns a bartop into a real cabinet. This page explains how to connect a comparative coin mechanism to a Recalbox, making it act as the SELECT button (the "insert coin" key in arcade games).
A comparative coin mechanism compares the inserted coin with a reference coin permanently held inside the unit: it reads the electronic signature of the coin and matches it against the reference. If the two are close enough, the coin is accepted; otherwise it is returned.
When a coin is accepted, the mechanism sends an electrical pulse. That pulse is what we turn into a SELECT press: the game then grants a credit.
You can perfectly well use metal tokens instead of real coins — on a home cabinet it is even preferable.
A typical comparative coin mechanism has four wires:
SELECT button;The "insert coin" wire must never go straight to the Raspberry Pi GPIO or to a USB encoder: the mechanism runs on 12 V and would destroy the input. A relay is mandatory.
The relay's job is simple: the mechanism's 12 V pulse closes a dry contact, and that dry contact simulates a button press on the Recalbox side. The two circuits stay electrically isolated.
Parts:
Once the board is built:
SELECT button.Test your relay board before connecting it to the Raspberry Pi: a multimeter in continuity mode across terminal 2 is enough to confirm the contact closes on every inserted coin.
Refer to your Raspberry Pi model's documentation to locate the GND and GPIOxx pins on the header precisely.
The coin mechanism needs no specific configuration: it behaves exactly like the button it is wired to.
SELECT input is the one defined by the mk_arcade_joystick_rpi driver.SELECT button, or to a spare input that you will assign to SELECT when configuring the controller.