Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
VGSOURCES
Get listed

arcade cabinetsPATCH 2026.10.19

How to Connect Arcade Controls to a PC or Raspberry Pi

By VGSources Team 12 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The simplest way to connect arcade buttons and a joystick to both a PC and a Raspberry Pi is a USB arcade encoder. Wire each switch to the encoder’s labeled input, connect the encoder’s common ground, then plug it into the host. The operating system sees the cabinet as a keyboard or gamepad, so you can configure it in RetroPie, MAME, or another emulator without writing GPIO code.

Direct Raspberry Pi GPIO wiring is also possible and can reduce hardware, but it is Pi-specific: every switch needs a GPIO input, all switches share a Pi ground, and your software must support the chosen GPIO method. Legacy DB9 joysticks require an exact, hardware-specific pinout check before any signal is connected.

As an Amazon Associate I earn from qualifying purchases.

Choose the connection method first

Your host, the number and type of controls, and how much wiring and software maintenance you want determine the right architecture. A USB encoder is the practical default for a cabinet that may move between a Windows, Linux, or Raspberry Pi system. GPIO is useful when the controls are permanently attached to a Pi and you are comfortable configuring input software. A DB9 adapter or direct wiring is a special-case project, not a universal standard.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Connection Best use Host compatibility Wiring and software Important limits
USB arcade encoder One cabinet used with a PC and Raspberry Pi PC and Pi with a USB port; the encoder may present as keyboard or gamepad Switch wires go to labeled encoder terminals; no separate GPIO driver code on the PC Input count and special-control support depend on the encoder
Direct Raspberry Pi GPIO Pi-only builds and projects that need direct switch access Raspberry Pi only Each switch line goes to a GPIO input and a shared common goes to ground; software configuration is required Pin availability, GPIO numbering, and driver support vary by Pi model and image
Legacy DB9 joystick Existing vintage or Competition Pro-style hardware Only after the exact connector pinout and an interface method are verified Signals must be mapped individually to GPIO or another interface DB9 wiring is not universal; a wrong pin can damage hardware or produce incorrect inputs

Why a USB encoder is usually the portable choice

An encoder translates the electrical state of arcade microswitches into ordinary USB input events. The host does not need to know that the input came from a Sanwa-style joystick or a cabinet button. Ultimarc describes its I-PAC range as interfaces that connect arcade controls to a host USB port. The I-PAC2 provides 32 inputs, keyboard and gamepad modes, generic USB operation, and Linux/Raspberry Pi support. It also includes a dedicated connection for a trackball or spinner, which matters if your cabinet needs more than digital buttons.

#1 Best Overall
Sale
LAPGEAR Home Office Pro Lap Desk - Black Carbon, Fits 15.6” Laptops | Built-In Mouse Pad & Phone Slot, Wide Cushioned Wrist Rest, Dual-Bolster Microbead Cushion, Carry Handle
  • Spacious Design: Measuring 21.1" wide and 14.1" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
  • Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy ergonomic support with the integrated cushioned wrist rest.
  • Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
  • Durable Surface: Work with confidence on our lap desk's solid surface, featuring a sleek black carbon color, ensuring optimal air circulation to prevent your laptop from overheating.
  • On-the-Go Convenience: With an integrated handle and lightweight design (2.8 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.

Because the encoder is USB, the same harness can be moved from a PC to a Pi. You still configure the controls in the operating system or emulator, but you do not rewrite GPIO code each time the host changes.

When direct GPIO is the better fit

GPIO wiring can be appropriate for a Pi-only project, an educational build, or a design where you want complete control over the input driver. A switch is electrically simple: one terminal is the signal and the other is common. The Pi reads the signal on a GPIO input and detects the switch closing to ground. The software layer then turns those readings into joystick or keyboard events.

The trade-off is that GPIO is tied to the Pi’s header and to the software image you select. Moving the cabinet to a PC means adding a separate interface. GPIO also leaves less room for unusual controls unless your board, driver, and available pins support them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Parts and safety checks

Prepare the parts before mounting anything. For a typical digital cabinet, you need:

Rank #2
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
  • A joystick with four directional microswitches.
  • Push buttons for the action, start, and coin inputs you plan to use.
  • A USB arcade encoder and its wiring harnesses, or jumper wires and a breadboard for a GPIO build.
  • A USB cable for the encoder route.
  • A Raspberry Pi with the required GPIO header if you are wiring directly to GPIO.
  • A multimeter or continuity tester for unfamiliar connectors and legacy hardware.

Sanwa-style harnesses commonly expose one common connection and four directional switch lines. Do not assume a wire color or connector orientation is universal. Identify the common wire and each direction from the joystick’s documentation or by testing continuity while moving the stick.

Raspberry Pi GPIO inputs are logic-level connections. Do not apply 5 V to a GPIO pin. The cited direct-wiring setups connect switches between GPIO inputs and ground; they do not establish a universal rule for every joystick harness, so verify the exact board and connector documentation before powering the Pi.

Connect arcade controls with a USB encoder

This procedure works for a mixed PC/Raspberry Pi cabinet. The terminal names differ between encoder models, but the wiring principle is the same: every switch signal goes to its labeled input and all commons are connected as the encoder documentation requires.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Plan the inputs. Identify the joystick directions, action buttons, start, coin, and any service or menu button. Leave one convenient button for an escape or menu function so you can operate the cabinet without a full-size keyboard.
  2. Mount the controls. Install the joystick and buttons in the control panel. Make sure each microswitch is firmly seated and that the lever’s up, down, left, and right positions match the physical layout.
  3. Connect the joystick. Attach the harness signal terminals to the encoder inputs labeled Up, Down, Left, and Right. Attach the joystick common or ground to the encoder’s common connection. If the harness has a five-pin connector, verify its orientation and which pin is common rather than relying on a color convention.
  4. Connect the buttons. Run each button’s signal terminal to the matching encoder input, such as Button 1, Button 2, Start, or Coin. Connect every button COM terminal to the encoder ground/common circuit. Some harnesses provide a daisy-chain ground; use it only if it is wired for your encoder.
  5. Inspect for shorts. With the host disconnected, check that no signal terminal is touching an adjacent input and that the common chain reaches every switch. A continuity test can confirm that an unpressed switch is open and a pressed switch closes to common.
  6. Plug in USB. Connect the encoder to a PC or Raspberry Pi USB port. An encoder that supports keyboard mode will generate key presses; one in gamepad mode will appear as a controller. The I-PAC family can operate in either mode, and its default MAME-oriented assignments can be used before custom programming.
  7. Verify each input. Use the host’s controller or keyboard test screen, or an emulator’s input display, and press one control at a time. If two controls activate together, inspect the ground chain and the two signal terminals before changing software settings.

Configure RetroPie after the encoder is detected

At first startup, RetroPie presents a controller-configuration prompt. Hold the requested button and assign directions, action buttons, Start, and Coin as the prompts appear. A keyboard-mode encoder may need to be treated as keyboard input rather than a conventional gamepad, depending on the image and configuration you installed.

Rank #3
Sale
Yilador Webcam Cover 3 Pack, 0.03 inch Ultra Thin Laptop Camera Cover Slide | Camera Blocker Slider for iPhone iPad MacBook Pro Computer iMac Cell Phone PC Laptop Accessories, Great for Privacy, Black
  • Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
  • 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
  • ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
  • ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
  • ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.

Record the assignment you choose. If you skip an optional control, hold a button as instructed by the configuration screen to continue, then test the result in a game. Configuration at the front end does not guarantee that every arcade title uses the same layout.

Remap controls in MAME or another emulator

Open the emulator’s input configuration when a game has a different control scheme, extra buttons, or a two-player layout. Map the physical control to the game’s named action rather than assuming that “Button 1” always means the same thing. Keep a dedicated escape, menu, or quit input. I-PAC shift functions can provide cabinet commands such as menu access without adding a keyboard, but the exact key combination depends on how the encoder is programmed.

Wire arcade controls directly to Raspberry Pi GPIO

Direct GPIO does not use a USB encoder. The Pi reads each switch on a header pin, while a shared ground completes the circuit. The MakeCode harness example uses a Sanwa-style five-pin joystick, jumper wires, and a breadboard. Adafruit’s setup likewise connects controls directly to GPIO and ground without external pull-up resistors in that particular configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Confirm the Pi and software. Use a model with the GPIO header required by your project and an operating-system image that supports the GPIO input method or driver you intend to use.
  2. Choose and document GPIO pins. Make a table before wiring: physical control, GPIO number, and software name. Decide whether your software uses physical header numbers, BCM GPIO numbers, or another numbering scheme; mixing these systems is a common cause of wrong inputs.
  3. Create a common ground rail. Join the joystick common and every button COM terminal to one ground rail. Connect that rail to a Pi ground pin, not to a 5 V pin.
  4. Connect the joystick signals. Run the four directional switch lines to four separate GPIO inputs. Verify which line is Up, Down, Left, or Right with the joystick documentation or a continuity test.
  5. Connect button signals. Run each remaining button signal to its own GPIO input. Do not place two independent controls on the same GPIO unless your input design deliberately supports that arrangement.
  6. Check voltage and shorts. Inspect every connection with the Pi powered off. Ensure the wiring exposes only Pi logic levels and that no 5 V source can reach an input.
  7. Enable the input method. Configure the GPIO driver or front end required by your software image. The driver must know which pins are inputs and how a switch closure to ground is interpreted.
  8. Test one control at a time. Confirm each direction and button in the driver’s test screen before launching an emulator. A permanently active input usually indicates a swapped common/signal connection, an incorrect pull-up or pull-down setting, or the wrong GPIO number.
  9. Map the controls in the emulator. Use the same logical mapping process as with a USB controller. RetroPie’s first-start configuration flow is a useful model, but individual games can still require their own input remap.

Understanding the Sanwa-style five-pin joystick

The five positions normally represent one common connection plus four directional switches. The connector is convenient because it can carry all five lines together, but the pin order and orientation must be verified for the particular joystick and harness. If the common line is placed on a GPIO input and a direction is placed on ground, the Pi may report a permanently active or inverted control. Test the harness before inserting it into the header.

Rank #4
AboveTEK Portable Laptop Lap Desk w/Retractable Left/Right Mouse Pad Tray, Non-Slip Heat Shield Tablet Notebook Computer Stand Table w/Sturdy Stable Work Surface for Bed Sofa Couch or Travel
  • Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
  • Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
  • Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
  • EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
  • Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.

GPIO limitations that affect cabinet design

The number of usable inputs is not a single universal figure. It depends on the Pi model, pins reserved by other peripherals, your numbering scheme, and the input driver. A USB encoder with a stated capacity gives a clearer expansion target; direct GPIO requires you to count available pins and leave room for any display, audio, shutdown button, or other hardware in the same project.

Use a legacy DB9 joystick only after checking its pinout

A DB9 plug describes the connector shape, not a universal joystick standard. Identify the exact joystick model and its wiring before connecting it to a Pi or an adapter. A Raspberry Pi Magazine example for a Competition Pro-style joystick assigns DB9 pins 1–4 to Up, Down, Left, and Right, pin 6 to Fire, and pin 8 to Ground, then maps those signals to Raspberry Pi GPIO pins. That assignment applies to the example hardware; it must not be treated as a general DB9 rule.

  1. Identify the joystick’s model and connector orientation.
  2. Obtain or measure the pinout with a continuity tester.
  3. Write down every signal and its intended GPIO or interface input.
  4. Confirm the Pi’s GPIO numbering scheme and ground pin.
  5. Connect signals with power removed.
  6. Power the system only after checking for 5 V exposure, shorts, and reversed ground.
  7. Test each direction and fire input separately before mapping an emulator.

If the pinout cannot be established confidently, stop and use a known encoder or a documented adapter instead. Guessing on a DB9 connector can produce incorrect controls and may damage the Pi.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Configure the host and emulator

PC workflow

After a USB encoder is connected, let the operating system enumerate it. In keyboard mode, open a text editor or keyboard-test utility and verify that each switch produces the intended key. In gamepad mode, use the operating system’s controller panel or the emulator’s input screen. If the device is not detected, try another USB cable or port, inspect the encoder’s power indicator if present, and recheck the common connection.

Best Value
Sale
LAPGEAR Home Office Lap Desk – Pink, Fits 15.6” Laptops | Built-In Mouse Pad & Phone Slot, Integrated Device Ledge, Dual-Bolster Microbead Cushion, Carry Handle
  • Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
  • Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
  • Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
  • Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
  • On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.

Open the emulator’s global input settings and assign the controls in a consistent order. Then open a representative game and check its per-game settings. Arcade emulators often preserve original machine layouts, so a global assignment may not cover a title with a spinner, trackball, separate service controls, or a different number of action buttons.

Raspberry Pi and RetroPie workflow

Connect the USB encoder before the first controller setup if you are using the encoder route. Follow the startup prompt to assign directions, actions, Start, and Coin. For GPIO, make sure the driver is active before opening the same configuration flow. Test in the front end, launch a game, and remap that game if its original controls differ.

Keep an accessible escape or menu function. A cabinet that can start games but cannot leave them is difficult to maintain. With a programmable encoder, reserve an input or shift combination for this purpose; with GPIO, assign a dedicated service button and configure it in the front end or emulator.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot the symptoms you see

Symptom Likely cause What to check
No controls respond USB device not enumerated, missing ground, or GPIO driver not active Try another USB port or cable; verify the encoder appears to the host; check the shared ground; confirm the GPIO software is enabled
One control is always active Common and signal reversed, wrong GPIO numbering, or incorrect input bias Power off, test continuity, compare the pin table with the software configuration, and verify the input’s pull-up/pull-down setting
Two buttons trigger together Shorted signal wires or an incorrectly daisy-chained ground Separate adjacent terminals and test each switch independently
Directions are swapped Harness orientation or labels do not match the physical layout Identify each microswitch by continuity and remap the logical direction
Front end works but a game does not Per-game arcade layout differs from the global mapping Open that game’s input configuration and assign its individual actions
Pi resets or behaves erratically Unsafe voltage, a short, or inadequate power wiring Disconnect power, remove any 5 V source from GPIO, inspect for shorts, and reconnect only after the logic-level wiring is confirmed
DB9 controls do not match the labels The joystick uses a different pinout than the example Stop guessing; verify the exact model’s pinout with documentation or a meter

Plan for trackballs, spinners, and extra controls

Buttons and joystick directions are digital switches. Trackballs and spinners are different: they generate movement information and may need a dedicated interface. The I-PAC2 documentation lists a dedicated trackball/spinner connector, while direct GPIO capacity and driver support depend on the Pi model and software. If your cabinet includes an analog-style control, check that capability before choosing an encoder or committing to a GPIO pin budget.

Also count service, test, pause, and menu inputs, not only the controls visible during play. A 32-input encoder gives a defined expansion ceiling; a GPIO design must reserve pins for every planned function and any other electronics in the cabinet.

Decision checklist

  • Choose USB encoder when the cabinet must work on both a PC and a Raspberry Pi, when you want keyboard/gamepad compatibility, or when you prefer to avoid GPIO driver code.
  • Choose direct GPIO when the project is Pi-only, you need direct switch access, and you can document the pin map and maintain the input software.
  • Use DB9 wiring only for a known, tested legacy joystick with a verified pinout and a safe interface plan.
  • Check input capacity against the total of joystick directions, action buttons, Start, Coin, service controls, menu functions, and any trackball or spinner requirements.
  • Document everything with a wiring diagram and a table of logical names, physical pins, and emulator assignments before closing the control panel.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

arcade cabinetsarcade controlsGPIOMAMEPC gamingRaspberry PiRetroPieUSB encoder

Leave a reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.