Porta-Pi Player 2 Add-on And Upgrades
How? It doesn't certainly fit in the arcade as it is designed, so an external solution must be created. Ryan (from retrobuiltgames) pointed me to this solution. I liked the idea, but I wanted my own box.
You can always plug a USB controller and it will likely work. But what's the fun in that? I wanted to build my own. Ryan sells a fight stick, and I recommend you take that route if you want the easy way out of this challenge. You can build that one, skip the raspberry pi and connect the wires to your existing arcade. I did this, except I wanted a smaller version (the Fight Stick is designed to contain a RPi + all the buttons). I just needed seven buttons + joystick and no RPi inside.
Things I brought:
- Switches: Reyann 6x Happ Type Standard Arcade Push Button — Red — With Microswitch and Reyann 6x Black Happ Type Standard Arcade Push Button with Microswitch for Mame / Jamma / Arcade Video Games
- A Joystick: Happ Red Ultimate Joystick 8 Way with Switches
- A Male: Swellder Connector Db15 D-sub Male Plug 15-pin Port 2 Row Terminal Breakout PCB Board
- A Cable: Your Cable Store 10 Foot DB15 15 Pin Serial Extension Cable (in hindsight, 10 ft is perhaps too much, since the porta pi arcade is 10.1 inches, but if you were to use HDMI to an external (bigger) display, then you can comfortably sit a few feet apart. That's about three meters for the rest of the world.
- A Female: DB15 D-SUB VGA 15pin Female Adapter Jack Terminal Breakout PCB Board
- I didn't have a Hole Saw or Spade Drill bit, so I brought this one: DEWALT DW1583 1–1/8-Inch by 6-Inch Spade Drill Bit (more on this later). I recommend a proper (and easy) way to drill the holes, it saves time (a lot). I lost that time.
Now I needed a box to put this together… after hours of browsing Amazon, I pulled the plug on this inexpensive bamboo tea box… yes. For tea: Lipper International Bamboo Tea Storage Box
It seemed like stuff would fit (hint: it does). and it's only $13.39. And, unlike other boxes, its interior dividers were removeable. Win.
I already had cables, crimpers, etc. But if you don't, check my article about building the Porta-Pi where I link some stuff. You don't need a lot, but have some .22 gauge cable (of assorted colors unless you want to hate yourself) and means to drill on wood.
- I should have gotten a Hole saw bit (vs. the Spade). For the later is better used with a vertical mount (in my in-experience). You can see some of the arcade buttons aren't in a perfectly cut circle. They are well secured, but it looks like crap.
- The button spacing is too much, I should have copied the Porta-Pi measurements.
- The D-Sub mount I made was hard to produce (the backplate of the box is thicker than I had anticipated, and certainly thicker than the rest of the box) so even tho it's functional, it doesn't look great. I have ideas on how to improve that using the (unused) dividers that come in the box.
- I created it with six buttons in mind, but turns out that by default, RPi GPIO only has 4 buttons mapped for Player 2 (or so I think). So two of my buttons are actually unplugged. I will investigate more on this later. The cables are there anyway.
Let's see some images. Making the holes was hard. Very poorly done. Although in the final version it looks better, you can tell my first two (top-right and middle top) are really bad, then I got a better technique/bit and the others look better. They are also too far apart.
I then proceeded to route the back plate for the connector (this took me a while and I didn't do a good job. I have better ideas for a future version).
A better way to approach this problem would be to route a big cavity all the way, and then using the (discarded) separators that come with this box of tea, attach the D-Sub to that (it's a lot thinner), then you could glue that thing to the back. I'll try that for my next box :-)
Since no RPi or electronics beyond this will go inside, there's no need for DC jacks or any other buttons. However, you will notice (and I've measured this), you could technically fit a RPi on the lower left corner and 4 buttons in the front of the unit (F1, ESQ, Select, Enter), which would match a full fledged arcade (sound coming out of headphones or HDMI of course), so no need for volume buttons (but you could squeeze smaller buttons if you needed).
As you can see, there's "plenty" of space on the left side. If I would have done a better job with the buttons, there would be about an extra inch worth of space for the RPi and front buttons. Lesson learned!
Wiring was relatively easy. The blue cable is ground. It starts in the front button and is daisy chained all the way to the D-Sub connector. Then eleven individual cables: six buttons + 4 directions + 1 start. The I picked the pins based on cable proximity or whatever random reason. Nothing fancy, as long as you remember it for the "other side" :) Notice I wrote them down.
I didn't have enough colors for the cables, but it wasn't a problem because it's very easy to see where they come from.
This will go in the Porta-Pi Arcade and the pins will connect to the RPi Player 2.
And this is how it looks. Initially I thought of adding a magnet to prevent the box from opening when you're playing, but after initial tests, I haven't found this to be an issue. There are plenty of magnet for cabinets on Amazon that are 5–10 bucks if I need to.
Now the Porta-Pi needed to accept all these wires, so I wired the other side, by matching my pin numbers with what I was sending from this side. Relatively simple, but pay attention, it's very easy to make mistakes. Count the pins!
Here I discovered that, by default, the RPi seems to have only four buttons wired for player 2, so I left two buttons unplugged (not a big deal for now). I will google around when I figure out where to put these last two.
Now I needed for a way to mount this… I used the LED Marquee pieces that came with the Porta-Pi, destroyed it and made a base, which I glued together. Sorry Ryan!
In the final design I added a third layer for the routing I made in the back plate was slightly higher.
I finally glued this to the bottom of the cabinet (I didn't feel like drilling again). I did drill holes for a couple of wood screws to keep the D-Sub attached to the wood base, but the base will end up glued next to the RPi. I did sand everything a little bit to make sure the glue worked 100%.
Porta Pi Mods
I needed to modify the backplate so it would have a cavity for the new D-Sub connector. I originally did a crappy job when soldering the DC Plug Connector Socket + USB, so I wanted to redo all that. I figured I could add a power switch while I was at it, and then I remembered that one of the things my friend wanted to do, was an easy way to just use the HDMI with an external display (he has a projector!). He is going to do that mod himself, but then I thought: well, why not then have the ability to turn the display and audio off and just leave the RPi powered? After all, the RPi audio can be slightly noisier and if you don't care about it, being able to turn it off/on on demand is a nice to have. Challenge accepted.
So I devised a masterplan. Three power switches. One (the first) is the master, which will turn everything on/off; if this switch is off, nothing has power, it's the equivalent of unplugging the arcade. The RPi will be direcly connected to this, so powering this on, will turn the RPi on regardless of the other switches. The other two are independent of each other and one powers the display and the other powers the audio amplifier, but both work only if the master switch is on. This way, the first/master switch can turn the whole thing down if you're using it in a normal way, but the other two switches can independently turn the audio/display on/off.
This allows you to have the RPi alone (Switch 1 on, Switch 2 and 3 off), which is what you'd likely want if you use an external HDMI display. Or, if you wanted to turn the audio off, you could just turn Switch 1 and 2 on, then switch 3 (audio) off.
As long as you don't turn them on/off in a crazy way that may confuse the Raspberry Pi, this should work. I guess the display may be a problem, but in my tests, turning the audio amplifier on/off while the RPi is working was not a problem at all. Remember the Audio amp is not a sound card, it's just an amplifier. The RPi has no idea what happens when the audio goes through the headphone jack. I tested this BEFORE connecting anything, to make sure it worked as intended. I used these nice LED Switches with 3 different colors (E Support Car LED Round Toggle Switch Pack of 15). Red for master, blue for display and green for audio. ¯\_(ツ)_/¯
The way it works is: from the DC Socket (+) goes to the master switch (the Switches are LED switches, so they need + and — to power the tiny LED). This master splits the positive into two other switches, one for display, one for audio (the negative is daisy chained). From the middle tip of these switches, there will be a + current when the switch is on, this is sent to each device. The RPi uses a MicroUSB, the other two are standard DC Plugs.
To be fair, this is (and sounds) more complicated than what it's needed, but it was fun to do :-) And it may be nice to use (especially to turn off the Audio amp if you really don't want any noise). When my friend does the HDMI thing/mod, he can switch audio and display off and then turn the RPi alone (saving power for the RPi). Anyway, this is how it kinda looks on paper:
After testing the circuit without any soldering or device (just a multitester), I proceeded to drill and (destroy) the beautiful Cthulu that @Inconcinnus painted. While I was at it, I also routed the place where the D-SUB connector was going to be. This took measuring, clamps, marking, measuring, dremel routing, retry, remeasure, repeat, curse, be careful, curse, etc. Eventually…
And this is how it looks with the switches from the inside
And now start daisy chaining ground. I had a bunch of these, so instead of soldering, I decided to do it the fancy way.
The positives are more complicated. By looking at the diagram, there's a lot of cabling going back and forth, but eventually it all ended up ok. I used hot glue to reinforce the switches and some tape to prevent any possible short if things get pulled or wiggled. Safety third!
All those red cables go back to DC male power pigtails that connect to the Display and Audio Amp, and the black cable going down/right is the USB that connects to the RPi.
Looks better from the other side…
I also had to make the bottom hole slightly bigger (I used a dremel with a sanding roll), because by design, the Porta-Pi bottom hole is smaller than the supplied DC Power plug connector socket.
And this is how it looks when running
And this is a closeup of how it all looks connected.
And that's the end of today's mod :) It took me about eight hours to do this. If I would have had a proper hole saw, it would have been probably half :)
If I would have, instead used a Keyboard encoder (or USB joystick/pad)… well… frog that, where is the fun?