Introduction: Pandora's Box Arcade With Raspberry Pi GPIO Controller

This instructable will show you how to gut out the original circuit board and replace it with a Raspberry Pi running Recalbox. By using the existing wiring harness to interface with the GPIO, it's much quicker to swap out the internals.

Most Pandora's boxes have a 40pin connector which is similar to the Raspberry Pi's GPIO. All that is needed for a direct plug in is to rearrange the wiring.

Step 1: Why?

The Pandora's Boxes and clones are great but they aren't perfect. They have decent controls and hundreds of games built in. If you don't want to build your own arcade system to run the games, they are ideal. Just plug and play.

However, if you want to be able to run more emulators and games at better speeds the latest Raspberry Pi will do a better job. It's just another option. The enclosures of these Pandora's Boxes are usually well made. Thick acrylic tops and metal enclosures. Even an empty enclosure without a circuit board would make most people drool. With the popularity of these Pandora's Boxes, there will be an endless supply of them in the future. They're readily available if you can't build your own enclosure.

Step 2: Parts

The Pandora's Box I used in this instructable is listed below. However, you should be able to use any since I believe most of them use a 40pin connector.

PandoraBox 5S 986 in 1 (used in video)
https://goo.gl/CNkTKo

Raspberry Pi 3
https://goo.gl/V1XesT

If your Pandora's Box doesn't have a 40pin connector

USB encoder for Sanwa buttons
https://goo.gl/hsuDoP

5pin Cable for Sanwa Joystick DIY
https://goo.gl/Hxiqhs

USB encoder for HAPP buttons
https://goo.gl/RERhRq

XM-02 Arcade To USB Controller Wiring Kit 2 Player (HAPP)
https://goo.gl/pH2j98

Step 3: Recalbox and Configuration

I prefer Recalbox on my Raspberry Pi, but RetroPie should work too.

Download the latest release of Recalbox and write to a 8GB-16GB microSD card with either Etcher or Win32DiskImager. Set it up and test it to make sure everything works before trying to install it in the enclosure.

Recalbox for Raspberry Pi 1 / 2 / 3
https://github.com/recalbox/recalbox-os/releases

Win32 Disk Imager
https://sourceforge.net/projects/win32diskimager/

Etcher
https://etcher.io/

*** VERY IMPORTANT ***

Enable GPIO controllers in recalbox.conf, you can do this via the web interface or edit it directly.

"In recalbox.conf, enable the gpio driver by setting controllers.gpio.enabled to 1 : controllers.gpio.enabled=1 and you're done ! The GPIO are configured out of the box in the frontend and systems."

Step 4: Remove Old PCB

Unplug the existing wiring and take out the Pandora's box circuit board by removing the 4 screws. Keep it incase you need to put it back in.

Step 5: Re-wire Pins

You can detach the pins from the plastic connector by using a thin needle to push the tabs to release them.

Look at the GPIO diagram to figure out where to place them so they work with the Raspberry Pi.

It's best to use a continuity tester to help you figure out where each wire goes to. They are color coded but some of them have the same color so it's best to test it to make sure.

See the official github for more information:
https://goo.gl/fSoowU

Once it has been re-wired, you shouldn't have to re-wire it again if you plan to upgrade to a newer faster Pi since the GPIO layout on the Pi's don't change often if at all.

Step 6: Test Fit

Double and triple check the wiring to the connector.

Test fit it to the GPIO pins on the Raspberry Pi to ensure a nice fit.

Step 7: Mounting

Mount it in the enclosure with double sided tape, or velco. This will also ensure that the Raspberry Pi won't get shorted by the metal enclosure.

Most of the cutouts in the enclosure should provide the necessary openings for the HDMI and microUSB port. However, if this isn't the case you can either use extension cables or drill some more holes. Hopefully, you don't have to do this. Most of the Pandora's box enclosures are very similar to mine so drilling would be very rare.

Step 8: USB Encoders

If you happen to have a Pandora's Box that doesn't have 40pin connector, all is not lost. You can still replace the internals. You'll just need to replace the wiring harness and use USB encoders. Hopefully, you don't have to go this route. The USB encoders will act as game pads in Recalbox/Retropie. Plug the joystick and buttons to the USB encoder and then plug the USB encoder to the Raspberry Pi's USB ports.

USB encoder for Sanwa buttons
https://goo.gl/hsuDoP

5pin Cable for Sanwa Joystick DIY
https://goo.gl/Hxiqhs

USB encoder for HAPP buttons
https://goo.gl/RERhRq

XM-02 Arcade To USB Controller Wiring Kit 2 Player (HAPP)
https://goo.gl/pH2j98

Step 9: Finish

Other than editing the recalbox.conf to enable the GPIO controllers, there shouldn't be anything else you need to do. The 1 player and 2 player controls should automatically work if you wired everything correctly. If some buttons aren't working or moving in the wrong direction, just double check your wiring. I had to do this a couple of times because I rushed it and placed the pins in the wrong place.

See my video for a demo of it in action.