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 glitchesiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
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 microswitch to the encoder, connect the encoder by USB, and configure the resulting keyboard or gamepad inputs in your operating system and emulator. Direct Raspberry Pi GPIO wiring is also possible when you want a Pi-only build, while legacy DB9 joysticks require a verified, hardware-specific pinout.
This guide explains all three architectures, shows how to wire them safely, and covers controller mapping, input capacity, special controls, and the faults that most often make an arcade panel appear dead.
Choose the connection architecture first
Your host computer and the type of controls you are installing determine the best wiring method. A USB encoder is the most portable option: the same panel can move between a Windows, Linux, or Raspberry Pi system without writing a GPIO driver. Direct GPIO removes the encoder but is tied to a particular Raspberry Pi and software stack. A DB9 joystick is not a universal standard; its signals must be identified before any connection is made.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →| Architecture | Host compatibility | Wiring pattern | Software work | Capacity and special controls |
|---|---|---|---|---|
| USB arcade encoder | PC and Raspberry Pi with USB; the I-PAC family supports Linux and Raspberry Pi | Switch wires terminate on labeled encoder inputs; common wires follow the encoder’s ground scheme | Appears as a keyboard or gamepad; no separate PC GPIO driver | An I-PAC2 provides 32 inputs and a dedicated trackball/spinner connector |
| Direct Raspberry Pi GPIO | Raspberry Pi only | One switch side to a GPIO input; the other side to a shared ground rail | Requires a GPIO input method and emulator mapping | Available inputs and driver support depend on the Pi model and software |
| Legacy DB9 joystick | Only after confirming the exact joystick and adapter or GPIO map | Map each connector signal to the intended input and ground | Depends on the adapter, GPIO front end, and emulator | Pin assignments are hardware-specific; do not assume a standard layout |
For a cabinet that may alternate between a PC and a Pi, use a USB encoder. Choose GPIO when the project is deliberately Pi-specific and you want the shortest electrical path. Use a DB9 approach only when preserving an existing joystick is more important than convenience and you can verify its documentation.
#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.
Parts, preparation, and electrical safety
Parts for a USB encoder panel
- Arcade joystick with its four directional microswitches or a Sanwa-style harness.
- Arcade push buttons with microswitches, including start and coin buttons if your cabinet uses them.
- A USB arcade encoder and the wiring harnesses specified by that encoder.
- A USB cable long enough to reach the PC or Raspberry Pi.
- A mounting panel, strain relief, and cable ties so wires cannot pull on switch terminals.
Parts for direct GPIO wiring
- A Raspberry Pi model with the required GPIO header.
- A software image and GPIO input method that support your chosen emulator.
- Jumper wires and, for a temporary build, a mini breadboard. The MakeCode harness materials use a Sanwa-style five-pin joystick, jumper wires, and a breadboard.
- Arcade buttons and a joystick with accessible common and signal terminals.
Before applying power
- Disconnect the USB cable or Pi power supply while making changes.
- Label every wire by function rather than relying only on insulation color. Harness colors are not a universal standard.
- Confirm which terminal is common (COM) and which terminals are normally open switch outputs. A joystick normally has one common and four directional lines, but verify the connector orientation on the exact part.
- Keep Raspberry Pi GPIO at the Pi’s logic level. Never apply 5 V to a GPIO input.
- Plan a shared ground rail for GPIO wiring and check continuity with a meter before powering the board.
Connect arcade controls with a USB encoder
A USB encoder translates physical switch closures into USB keyboard or gamepad events. 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. Lay out and label the controls
Place the joystick and buttons in the panel, then identify each microswitch: up, down, left, right, the action buttons, start, coin, and any service or escape button. Decide which button will perform an emulator menu or exit function before you close the cabinet. A dedicated escape/menu control is more useful than having to attach a full-size keyboard later.
2. Wire each switch to the encoder
- Turn off the host and unplug the encoder.
- Connect the joystick’s up, down, left, and right signal wires to the encoder terminals labeled for those directions.
- Connect each button’s signal terminal to the encoder input labeled for that button. Use one input per independent switch.
- Connect the common or ground wiring according to the encoder documentation. I-PAC inputs are referenced to ground, so a switch closure pulls the selected input to that reference.
- Secure the harnesses and leave enough slack for the panel to open without stressing a connector.
Do not infer a terminal’s function from its physical position alone. Read the encoder labels and the joystick harness orientation. If a button has two terminals, one is the switch signal and the other is common; reversing them normally does not change the switch electrically, but it can make a harness layout confusing.
3. Connect the encoder to the host
Plug the encoder into a USB port on the PC or Raspberry Pi. In keyboard mode, a press produces the assigned key event; in gamepad mode, the operating system exposes controller buttons and axes. Start with the encoder’s default assignments, especially if they were designed for MAME, and change them only after confirming that every physical input is detected.
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.
4. Configure RetroPie on first start
- Boot the Raspberry Pi into RetroPie with the encoder connected.
- Follow the controller-configuration prompt that appears during startup.
- When prompted, press the joystick directions, action buttons, start, and coin controls you wired. Assign an unused input to any optional function or skip it when the interface allows.
- Save the configuration, then test the controls in the front end.
RetroPie’s first-start mapping establishes a general controller profile. It does not guarantee that every arcade title uses the same layout.
5. Remap individual games when necessary
Open the emulator’s input configuration while the affected game is running when its controls differ from the default layout. Map the physical buttons to the game’s own actions rather than changing the entire front-end profile for one title. Keep a dedicated escape or menu function available; I-PAC shift functions can provide cabinet commands without adding more visible buttons.
Wire arcade controls directly to Raspberry Pi GPIO
GPIO wiring is a Pi-only design. Each switch is read as an input, and closing the switch connects that input to ground. The exact GPIO software, numbering scheme, and available inputs depend on the Pi model and the image you install.
1. Prepare a common ground
- Identify the joystick common wire and the COM terminals on the push-button microswitches.
- Join those commons into a ground rail. A breadboard can serve as a temporary rail; a soldered distribution point is preferable for a permanent cabinet.
- Connect the ground rail to a Raspberry Pi ground pin.
Adafruit’s direct-control setup states that controls can connect to GPIO and ground without external pull-up resistors in that setup. Follow the input method’s instructions rather than adding pull-ups or pull-downs indiscriminately, because the software and board configuration determine how an unpressed switch is sensed.
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.
2. Connect individual switch signals
- Connect the remaining terminal of the joystick’s up switch to one GPIO input, down to another, left to another, and right to another.
- Connect one terminal of every action, start, coin, and service button to its own GPIO input.
- Check that no input is accidentally connected to a 5 V rail or to another input.
- Write down the GPIO number and the physical control at both ends of every wire.
A Sanwa-style joystick commonly exposes one common and four directional switch lines through a five-pin connector. Verify the connector orientation and ground wire on the exact joystick instead of trusting a color convention.
3. Configure the GPIO input software
Install or enable the GPIO input driver or front end supported by your Raspberry Pi image, then assign the GPIO numbers to directional and button actions. The driver must present those inputs to the emulator as a usable controller or keyboard device. Once that layer is working, map the controls in RetroPie or the emulator using the same sequence used for a USB controller.
4. Test one input at a time
With the Pi powered, test up, down, left, right, and each button separately in the input utility or configuration screen. A single test is more informative than launching a game with several miswired controls: it reveals whether a fault is electrical, a GPIO-numbering mistake, or an emulator mapping problem.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Use a legacy DB9 joystick safely
DB9 is only a connector shape, not a guaranteed arcade-control pinout. You must identify the exact joystick model or adapter before connecting it to GPIO. 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 that example, not to every DB9 joystick.
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.
- Find the documentation or a reliable continuity map for the exact joystick.
- With the joystick unplugged, use a meter to confirm which pin closes to ground when each direction or fire button is pressed.
- Record the connector’s pin numbers, signal names, and ground before selecting GPIO inputs.
- Build the adapter or jumper harness so each signal reaches only its intended input.
- Verify the Pi’s GPIO numbering convention in the software configuration; physical header positions and GPIO numbers are not interchangeable labels.
- Power the system only after checking for shorts and confirming that no 5 V signal can reach a GPIO input.
If the joystick behaves unpredictably, stop and recheck the pinout rather than swapping wires while powered. A wrong DB9 assumption can connect a signal to ground or to a voltage source.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Map controls on the PC and in emulators
Keyboard mode versus gamepad mode
Keyboard mode is convenient for older emulators and games that already expect key presses. Gamepad mode is preferable when software offers a controller configuration screen and you want distinct button identities. An encoder that supports both lets you choose per host, but changing modes may change which assignments the operating system reports.
Front-end mapping
Map the four directions first, then the action buttons in the order shown by the configuration screen. Assign start and coin explicitly; an arcade cabinet often needs both even when a modern controller profile does not. Save the profile and test navigation in the front end before opening a game.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Per-game mapping
Arcade titles can use different action names, button counts, or player assignments. Enter the emulator’s input configuration for a game that does not respond correctly, map the physical controls to that title, and save the game’s profile. Do not overwrite a working global profile to fix one unusual machine layout.
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.
Input capacity and special controls
Count every independent switch before choosing an encoder: four joystick directions, action buttons, start, coin, service, test, and any second-player controls all consume inputs. The I-PAC2’s 32-input capacity covers a broad two-player digital panel and includes a dedicated trackball/spinner connector. Direct GPIO capacity is not a fixed arcade specification; it depends on the Raspberry Pi header, reserved pins, operating system, and input driver.
Trackballs and spinners are not ordinary push buttons. They generate movement signals and may need the encoder’s dedicated connector or a separate interface. Confirm that your chosen hardware and software can read those signals before drilling the panel. A USB encoder that handles only digital switch closures cannot automatically provide analog or quadrature support simply because spare terminals remain.
Troubleshoot a non-working arcade panel
No controls register at all
- For USB, try another cable and USB port, then check whether the operating system detects a keyboard or gamepad device.
- For GPIO, confirm that the Pi image has the intended GPIO driver enabled and that the ground rail reaches a real Pi ground pin.
- Check that the encoder or Pi is powered only after all wiring is complete.
One direction or button is permanently active
- Inspect for a short between the signal and ground, a bent microswitch tab, or a connector installed one position off.
- Disconnect that switch and test the input with a temporary jumper or the software diagnostic screen.
- On GPIO, verify that the configured input number matches the physical wire and that the input method’s pull configuration is correct.
Directions are swapped
- Recheck the encoder labels against the joystick’s actual switch positions.
- For a five-pin harness, verify orientation and common wire rather than assuming the red or black conductor is ground.
- For DB9, compare every signal with a continuity test and the documented pinout.
Controls work in the menu but not in a game
The hardware and front-end profile are probably functioning. Open that game’s input configuration and assign its actions, including coin and start, to the mapped controls. Check whether the game expects a different player or button order.
The Pi resets or becomes unreliable
- Remove any connection that could feed 5 V into a GPIO input.
- Look for loose ground connections and wires touching adjacent header pins.
- Power down before changing a DB9 or GPIO harness; hot-swapping can create shorts and makes diagnosis harder.
A practical selection checklist
- Need one panel for both PC and Pi: choose a USB encoder.
- Building a Pi-only project and comfortable configuring GPIO: direct GPIO can reduce hardware, but plan the driver and numbering scheme first.
- Reusing an old DB9 joystick: identify and test its exact pinout before selecting an adapter or GPIO map.
- Installing many buttons or two players: total the required inputs and compare them with the encoder’s capacity; the I-PAC2 provides 32.
- Adding a trackball or spinner: select hardware with the appropriate dedicated connector or interface rather than treating it as another switch.
- Operating a cabinet without a keyboard: reserve an escape/menu or service function during the initial wiring and mapping.
Once every switch has a documented signal, a verified common ground, and a saved emulator mapping, the panel is portable and maintainable. Keep the wiring diagram inside the cabinet so a future control change does not require guessing at GPIO numbers, encoder terminals, or DB9 pins.
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.

