Today we'll be building a mini-MAME console using Raspberry Pi. This is a single-player console, but since the USB ports on the pi are accessible, it's easy to plug in another console or USB joystick to have some multi-player action if the mood arises!
Step 1: Things You Will Need
- A large flat area to work in.
- A floor works great for this, put some plastic down to catch errant glue!
- The wooden enclosure.
- Here is a link to the parts kit on etsy: MAME Box Parts Kit
- Raspberry Pi 3 + an 8GB or larger SD card. I used 32GB..
- Here is a link to an Rpi 3 Model B: http://amzn.to/2zSh965
- Hardware Kit - Joystick, buttons, and USB Encoder. These can be purchased easily from Amazon or eBay.
- Here is a link to a Sanwa hardware kit with encoder: Easyget Sanwa Hardware Kit
- A few packs of #4-40 machine screws for mounting the Pi and Encoder PCBs
- A few packs of #6-32 machine screws for mounting the joysticks.
- Wood Glue
Step 2: Get Familar With the Parts, and Set Up the PCB Holder
Section I – Set up the PCB Holder
Get out the PCB holder, and get your PCB’s handy. Match up the mounting holes and put a 4-40 screw through the mounting holes you’d like to use. Here I’m using the RPi and Xinmo interface.
Hold the screws in place, flip the board over and apply the nuts.
We then put a dab of superglue on each nut to keep it in place so we can remove the screws in the future. It’s a pain to try to line up the screw otherwise, so this step will help you down the road. DON’T get glue on the threads, you will have a hard time unscrewing that screw later. Set the PCB holder aside to dry.
Step 3: Place the Side Panels
Once the superglue has dried, it’s probably best to remove the screws. I don’t, but it can make things easier if the screws are out of the way. :)
Next, we set up the front, back, and sides so you can get an idea of how everything goes together. The PCB plate has tabs on the front and back that fit into the front and back panels.
To glue the box together, I use Titebond II, a really nice glue at very reasonable prices. But any type of wood glue will work fine.
First, flip all 4 panels over so you're looking at the inside. Now dab a bit of glue onto the tabs at the top and sides - these surfaces will mate together with other parts, so they're really the only places that need glue.
I use a paintbrush, but you could get good results just squeezing a little drop out of the bottle and tapping it on the tab.
Protip: For extra rigidity add a drop of glue between each hole on the inside of the top panel. This will keep the box nice and tight during those hectic sessions when you're really bangin' on it!
Step 4: Bring It All Together
- First, get the back panel in place, but don’t push the tabs all the way in yet.
- Next, mesh the sides in, first lining up the side panel tabs with the back panel tabs, then line up the side panels with the top plate. After they’re all lined up, add the PCB plate with nuts facing down, and screws or holes facing up.
Finally, add the front plate. Mesh up the PCB plate and sides, then bring it all down into the top panel. Push each side down evenly, alternating corners until all the walls are well seated in the top. It may take some pressure and wiggling to get errant tabs to align, but once it’s in – it’s in!
Also, for extra rigidity you can smooth the glue dots on the inside into a continuous line.
After gluing, I usually tape the corners with blue tape to keep them tightly together while the glue dries. Masking or scotch tape would probably be fine, but I’d avoid packing or duct tape which may leave glue or other crud when you try to peel it off.
Last, use a moist paper towel to clean up any glue that squeezed out onto the top panel. And if you like, you can add the cable holders in the back panel to wind cords up onto.
Step 5: The Guts!
Once the glue has dried, get the guts ready!
I do the buttons first, then joystick. Pop them in from the top, and get a look at your color scheme before everything is mounted in. Next, put a book or the bottom plate on top of everything and flip the box over to access the inside.
Drop the screw on retaining rings onto each button body, and screw them down tight. I have found that the wiring steps are easiest if the microswitch holders are all a bit angled towards the PCB, as you see in the pic.
Next, center the joystick base and add its 4 screws. I use locknuts on that guy to make sure it doesn't wiggle free, but loctite or even nail polish will work if you don't have locknuts.
Your joystick may have come with the handle seperate. If so, it's time to put it though the base and put the actuator ring on. Wide base for a sensitive action, narrow base for insensitive action.
Next, push the stick in, and get the E-Clip on the retaining groove. Pop the E-clip on with pliers.
If your buttons do not already have the microswitches mounted, now we will add the button microswitches by first hooking the lower dot as you see in the picture, then pushing them back over the high dot until the switch snaps into place. Piece of cake if you do it one "dot" at a time
Step 6: Wiring
Add the PCB, and wire as described in the instructions for your particular hardware. There are so many different wiring configurations that I can't really show them all, but they boil down to a few standard configurations.
- Buttons and JS to Encoder, Encoder to Pi. When you're using an encoder board with a Raspberry Pi, you will wire the buttons and stick first to the encoder. Then, the encoder plugs into the Pi via USB. Often, this USB cable is quite long, so consider using the Pi board as a little winding jig to take up the extra cable.
- Buttons and JS directly to Pi. For the single player board, you can use Adafruit's tutorial to directly wire a limited number of buttons directly to the IO header on the Pi.
- Buttons and JS to Encoder, use Encoder as USB joystick. For those who are gaming on a PC or console, you may want to skip the Pi altogether and simply use your box as a USB joystick. No problem! That USB connection from the encoder can certainly plug directly to a PC or console and act as a USB joystick.
I won’t show the wiring step as it’s different for every setup, but they all follow a similar strategy:
- A single, long ground wire daisy chains from the PCB ground terminal to one of the connectors on every microswitch – hopping from one to the next. This wire is usually much longer, and has many connectors.
- Many single signal wires connect from the other (NO – Normally Open) terminal of each microswitch back to the PCB. Most PCB’s will tell you where to connect button #1, button #2, etc.
It ends up looking something like the picture here, where I am using setup #2 - direct to Pi.
Step 7: Play!
The last step is software - the home stretch!
If you're using Raspberry Pi, and you want a fairly seamless experience switching between many emulators and MAME, I personally suggest RetroPie, which is freely available here..
Download the SD card image, write it to your MicroSD card from step 1, and pop it in the pi. If this is the first time you're using Retropie, or just for a refresher, please continue with the Retropie tutorial here.
Setup takes a half hour or so, but your mini-rig will continue to deliver sweet retro goodness for years to come! Hope you enjoyed the build, and I hope you're successful in your own DIY MAME projects!