Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesFor a cabinet that must work with both a PC and a Raspberry Pi, use a USB arcade encoder. Wire the joystick and button switches to the encoder, plug its USB cable into the host, and configure the controls as a keyboard or gamepad. Direct GPIO wiring is a practical Raspberry Pi-only alternative: each switch goes to a GPIO input and a shared ground. A legacy DB9 joystick can also be adapted, but its pinout is hardware-specific and must be verified before power is applied.
Choose the connection method before wiring anything
Arcade controls are simple electrical switches, but the way those switches reach the computer determines compatibility, software work and expansion options. Decide whether the cabinet will move between hosts, how many inputs it needs, and whether it will include unusual controls such as a trackball or spinner.
As an Amazon Associate I earn from qualifying purchases.
| Connection | Host compatibility | Wiring approach | Software work | Capacity and special controls | Best fit |
|---|---|---|---|---|---|
| USB encoder | PC and Raspberry Pi through USB | Switch wires terminate on labeled encoder inputs; common wires connect as the encoder documentation specifies | Appears as a keyboard or gamepad; no separate GPIO driver is needed on a PC | Ultimarc I-PAC2 provides 32 inputs and a dedicated trackball/spinner connector | A portable or mixed PC/Raspberry Pi cabinet |
| Direct Raspberry Pi GPIO | Raspberry Pi only | One switch terminal to a GPIO input; the other terminal to a shared ground rail | Requires a GPIO input method or front end, followed by emulator mapping | Available inputs and driver support depend on the Pi model and software | A Pi-focused project where avoiding an encoder is important |
| Legacy DB9 joystick | Depends on the adapter and host wiring | Identify the exact DB9 pinout, then map each signal to GPIO or an interface | Requires hardware-specific mapping and emulator configuration | Signals are limited to what the original joystick exposes | Reusing a known, compatible vintage joystick |
The USB route is generally the least fragile choice for a first build. The encoder handles the electrical interface and presents familiar USB input events to either operating system. GPIO can reduce parts and cost, but it ties the control panel to a particular Pi header and software stack. DB9 conversion is reasonable only when you can document the connector’s pinout.
Parts and electrical basics
Controls and interface
- Arcade joystick with four directional microswitches.
- Push buttons for action, start and coin functions, plus any cabinet-specific controls.
- A USB encoder for a cross-platform build, or a Raspberry Pi with an accessible GPIO header for direct wiring.
- Switch harnesses and jumper wires. The MakeCode Sanwa-style harness example uses a five-pin joystick, jumper wires and a mini breadboard.
- A USB cable for an encoder connection, or a suitable ground wire and jumper leads for GPIO.
How a switch is wired
A microswitch has a common terminal and a signal terminal. Pressing the button closes the circuit between them. For direct GPIO, all common terminals can share a ground rail connected to a Pi ground pin; each signal terminal gets its own GPIO input. A Sanwa-style joystick normally exposes one common connection and four directional switch lines, but do not assume a wire color or connector orientation. Check the control’s documentation and identify the common wire with a continuity test if necessary.
#1 Best Overall
- 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.
Keep Raspberry Pi GPIO at the board’s logic level. Never apply 5 V to a GPIO input. The cited Adafruit setup connects controls directly to GPIO and ground without external pull-up resistors, but that does not establish a universal rule for every board or driver. Follow the electrical guidance for the exact Pi model, harness and software you are using.
Method 1: connect the controls with a USB encoder
A USB encoder is the recommended architecture when one control panel must operate on a PC and a Raspberry Pi. Ultimarc describes its I-PAC boards as interfaces that connect arcade controls to a host USB port. The I-PAC2 has 32 inputs, supports keyboard and gamepad modes, works generically over USB, and supports Linux and Raspberry Pi systems.
1. Prepare and label the harnesses
- Unplug the PC or Pi and place the joystick and buttons where the wiring will reach without tension.
- Separate the joystick’s four direction leads from its common lead. For each push button, identify the signal terminal and the COM terminal.
- Keep a written map of the physical control and the encoder label it will use—for example, “left joystick → LEFT input” and “player-1 button 1 → A input.” This prevents a later software mismatch.
2. Connect each switch to the encoder
- Attach the joystick direction wires to the encoder terminals labeled for up, down, left and right.
- Attach each button’s signal wire to the labeled encoder input you want to use.
- Connect common or ground wiring as required by the encoder documentation. I-PAC inputs are referenced to ground, so every switch circuit must have a reliable common return.
- Inspect every terminal for a loose crimp or a strand that could touch a neighboring input. A loose common connection can make several controls fail at once.
3. Connect USB and check that the host sees it
- Connect the encoder’s USB cable to the PC or a Raspberry Pi USB port.
- On a PC, the encoder can operate as a keyboard or gamepad. On a Pi, the operating system should enumerate it as a USB input device in the same way as other controllers.
- Test each direction and button in the host’s input settings before opening an emulator. If a switch activates the wrong input, correct the terminal assignment or remap it in software rather than rewiring an otherwise sound harness.
4. Map the controls in RetroPie
When RetroPie starts with a newly detected controller, follow its controller-configuration prompt. Assign the joystick directions, action buttons, Start and Coin when asked. The prompt establishes the global layout used by the front end and emulators; it does not guarantee that every individual game uses the same defaults.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #2
- 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.
- Start the Pi with the encoder connected.
- At the controller setup screen, hold or press the requested control for each direction and button.
- Assign Start and Coin explicitly. These inputs are often needed to enter and leave a game even when the action buttons work.
- Save the configuration, launch a game and test movement, all action buttons, Start and Coin.
5. Correct per-game layouts in MAME
MAME and other emulators can have game-specific input assignments. Open the game’s input configuration when a title uses a different button order, a two-player layout or a special service control. An I-PAC’s default MAME-oriented key assignments can provide a usable starting point before custom programming. Preserve a dedicated escape or menu function so the cabinet can be operated without connecting a full-size keyboard; I-PAC shift functions can provide those commands.
When a USB encoder needs more than ordinary buttons
Check the encoder’s expansion connectors before buying a trackball or spinner. The I-PAC2 includes a dedicated trackball/spinner connector, while a basic encoder intended only for digital switches may not have the required inputs. Analog or quadrature controls need the correct interface and emulator support; do not assume an unused button terminal can replace a dedicated connector.
Method 2: wire arcade controls directly to Raspberry Pi GPIO
Direct GPIO is useful when the cabinet will remain attached to one Raspberry Pi and you want to avoid an encoder. The MakeCode harness example and Adafruit’s wiring guidance both use the same basic circuit: switches connect between GPIO inputs and ground. The software layer then reads those inputs and exposes them to the emulator.
Rank #3
- 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.
1. Confirm the Pi and software support
- Use a Raspberry Pi model with the GPIO header required by your wiring plan.
- Choose a software image and GPIO input method that support your Pi model and operating system.
- Decide whether your software identifies pins by physical header number, BCM GPIO number or another scheme. Write down the scheme before assigning controls; confusing physical and GPIO numbering can put a switch on the wrong input.
2. Build a common ground rail
- Join the COM terminal of every push button to a common ground rail.
- Connect the joystick’s common wire to that same rail.
- Connect the rail to a ground pin on the Pi header.
- Use a separate wire from each remaining button terminal and each joystick direction terminal to a distinct GPIO input.
The five-pin Sanwa-style joystick arrangement normally contains one common and four direction lines. Verify which pin is common and which four are directional rather than relying on a color convention. A reversed connector can make every direction appear stuck or inactive.
Free tools Windows power users keep installed
One-click scans. No signup required.
3. Keep the signal voltage safe
GPIO inputs are not tolerant of arbitrary voltages. Keep the wiring at the Pi’s logic level and do not feed 5 V into a GPIO pin. The direct-switch examples use the Pi’s ground reference; they do not provide a blanket wiring rule for every joystick board, illuminated button or third-party harness. Treat LEDs, lamps and powered accessories as separate circuits unless their documentation explicitly supports the Pi’s GPIO electrical limits.
4. Configure the input driver and emulator
- Enable or install the GPIO input method required by your chosen image.
- Assign each GPIO input to a logical direction or button in that driver or front end.
- Use RetroPie’s controller setup as the model for mapping directions, action buttons, Start and Coin.
- Launch a game and open its input configuration if the title needs a different layout.
Unlike USB, GPIO input support is not automatic across every Pi image. A wiring diagram can be electrically correct while the emulator sees nothing if the driver is disabled, uses a different numbering scheme or expects active-low inputs. Confirm the software’s expected polarity and pin names before changing hardware.
Rank #4
- 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.
Method 3: adapt a legacy DB9 joystick
DB9 connectors are not a universal arcade-control standard. The same nine-pin shell can carry different signals on different joysticks, so identify the exact model and verify its pinout with documentation or a continuity test before connecting it to a Pi.
A Raspberry Pi Magazine example for a Competition Pro-style joystick assigns DB9 pin 1 to up, pin 2 to down, pin 3 to left, pin 4 to right, pin 6 to fire and pin 8 to ground. That mapping belongs to that hardware example; it must not be treated as a generic DB9 rule.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →- Identify the joystick model and obtain its pinout.
- With power disconnected, map each DB9 signal to a corresponding GPIO input and map the confirmed ground pin to Pi ground.
- Check for shorts between signal pins and ground before applying power.
- Document whether your software uses physical header numbers or BCM GPIO numbers.
- Configure the GPIO driver and test one direction at a time.
If the connector’s pinout is uncertain, stop and verify it. A wrong ground or signal assignment can create unreliable input or expose the Pi to an electrical condition it was not designed to handle.
Best Value
- 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.
Configure controls so the cabinet is usable without a keyboard
Assign the controls people actually need
- Directions: up, down, left and right from the joystick.
- Action buttons: map the number required by the game system, then reserve a consistent order across emulators.
- Start and Coin: give each a dedicated physical button rather than relying on a keyboard shortcut.
- Exit or menu: reserve an encoder key or shift combination for leaving a game and reaching the front end.
- Player two and service inputs: add them only after player one is stable, and record the mapping in the cabinet documentation.
Use a written mapping sheet
Record the physical label, encoder terminal or GPIO pin, logical input name and emulator action. This is especially important when a cabinet is serviced months later. For GPIO, include the numbering convention; for a USB encoder, include whether the host is using keyboard or gamepad mode.
Test outside the emulator first
Verify that every switch changes state at the operating-system or input-driver level before troubleshooting a game. A failed test there points to a connector, ground, pin assignment or driver problem. If the host sees every input but a game does not, adjust the emulator’s mapping instead of rewiring the panel.
USB encoder versus GPIO: practical trade-offs
Choose USB when portability matters
- The same control panel must move between a PC and Raspberry Pi.
- You want the host to recognize the controls as a standard keyboard or gamepad.
- You prefer labeled encoder terminals over maintaining individual GPIO assignments.
- You may add a trackball or spinner and need a dedicated connector.
Choose GPIO when the project is Pi-specific
- The cabinet will stay with one Raspberry Pi.
- You are comfortable selecting and maintaining a GPIO driver.
- You want direct switch-to-ground wiring and do not need USB compatibility.
- The available input count and software support on your Pi are sufficient.
Use DB9 only with verified hardware
A legacy joystick can be a good reuse project when its pinout is known. It is a poor choice as a generic wiring template because connector appearance does not establish signal assignments.
Troubleshooting by symptom
No controls work
- For USB, check the cable, try another host USB port and confirm that the encoder is enumerated.
- For GPIO, confirm that the selected driver is enabled and that the software is using the same pin-numbering scheme as the wiring.
- Check the shared ground first. A disconnected common return can disable every switch simultaneously.
One button or direction is dead
- Inspect the crimp and terminal at both ends.
- Test the microswitch by closing its common and signal terminals directly with power disconnected from the wiring under test.
- Move the signal temporarily to a known-good encoder input or GPIO input. If the control then works, the original input or mapping is the issue.
Several controls activate together
- Look for a missing or miswired common connection.
- Check for a short between adjacent encoder terminals or jumper wires.
- On GPIO, verify that no two signal wires share a pin and that the ground rail is not accidentally connected to a signal rail.
Directions are reversed or stuck
- Confirm the joystick connector orientation and identify the common wire.
- Swap only the incorrectly assigned direction leads or correct the software mapping.
- For a DB9 joystick, re-check the exact pinout; never infer it from another DB9 device.
The controls work in the front end but not in a game
Open that game’s input configuration and assign its directions, action buttons, Start and Coin. Per-game mappings can differ from the global RetroPie configuration. Keep the cabinet’s escape or menu function available while testing.
The Pi behaves erratically after wiring
Disconnect power immediately, remove any suspected 5 V feed to GPIO, and inspect for shorts. Reconnect only after confirming the ground and signal wiring against the exact board documentation. Illuminated buttons and other powered accessories should not be tied to GPIO without an appropriate, documented interface.
A safe commissioning sequence
- Choose USB, GPIO or verified DB9 based on host and expansion requirements.
- Draw the pin or terminal map before making connections.
- Wire the shared ground and one control first.
- With power disconnected, check continuity and look for shorts.
- Connect the host and test that first control.
- Add the remaining directions and buttons one at a time, testing each.
- Configure RetroPie or the relevant emulator, including Start, Coin and an exit/menu command.
- Test several games and document any per-game remaps inside the cabinet.
Following this order isolates wiring faults from software faults. It also leaves you with a serviceable map rather than a cabinet whose behavior depends on undocumented terminal choices.
Quick Recap
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.

