Text 21 Mar 3 notes Classic Arcade controls PS/2 keyboard hack

MY PS/2 Keyboard/ arcade controller hack

Here’s my project, which evolved from a full arcade cabinet, to an arcade panel that my sons helped me build and I used as a chance to get my oldest 10 year old interested in electronics.  I’m not brave enough and didn’t document it properly enough to make an instructable, so I’m putting it here.  The steps were as follows:

1.  Buy the controls.  I got a present from myself on my birthday of ordering real arcade joysticks and buttons from Happ http://na.suzohapp.com/ , a distributor/manufacturer (not sure which exactly) of arcade parts.  This was less than $100 dollars, but I can’t remember how much.  I originally wanted to make a Street Fighter 2 style cabinet, so I needed 6 buttons for each player, plus 2 joysticks, plus a 1-player and 2-player button, plus buttons for coins, etc.  But I was very happy with Happ - they came, they were beautiful.  In fact, all I did for the first 6 months was look at my parts and procrastinate starting my arcade machine.

2.  Give up building the arcade.  The kicker here was when my various bits of plywood that I was ‘saving’ for this project was commandeered by my father in law who innocently cut them all up and built shelving out of them.  It turned out to be good, cause I was never going to build that dumb thing anyway.  My son really wanted me to build something, though, so I got going.  I guess technically, this step isn’t necessary, and lots of folks on the internet have built full cabs.  Just not me (for now).

3.  Break a PS/2 keyboard.  From googling, I discovered that many folk make arcade buttons talk to computers by buying an interface device or, to be more of a hack, break a keyboard and wire it in there.  I thought that sounded fun, so I tried that way.


 I found this in an office basement.  This is what it looked like before I opened it.

Keyboards it turns out, use a matrix to trigger keys.  There are columns of usually 1-18, and rows, usually 1-9 or so, and by connecting a current through from one column to one row, the chip in the keyboard knows what button you’re trying to push.  For example connecting 4 across, 2 down, might trigger a ‘z’ button, but every keyboard is different.  So, to use the keyboard as a controller, you have to determine what the map is, either by trying to trace it down looking inside the keyboard, or just plugging it in and go crazy with a wire, which could potentially lead to a blown fuse/keyboard controller/etc.  I went with tracing down the keys with a multimeter when the power was off.

The inside.  There are two sheets of plastic with conductive traces, and pressing a key physically pushes them together to touch, causing a connection to be sent to the upper right hand corner, where the keyboard controller board used to be before I pulled it out.

This corner is where the board was, with the ribbons connecting into the board. 

4.  Build a box.  I had a bunch of old lumber around, so I just, out of no other ideas, put it together in a simple plywood box, with a 2x4 frame.   In order to get the holes, you’ll need a drill and a ‘hole saw’, which you can get at a hardware store for less than $10 dollars.  You need 1 1/8 inch size to fit standard arcade buttons.  DON’T GUESS!!  (yes, I had to run back and exchange obviously-used bits once or so…)

Kids tip:  They LOVE using the hole saw.  We mapped out where the buttons should go and my boys each took turns drilling the holes.  Awesome.

5.  Secure the controller/ Install Barrier Strips.  The really tricky part of this plan is to somehow connect switches to tiny tiny connection areas on a tiny controller that was never, ever intended to do that.  Also, you’ll have to secure it somehow in the box.  I had one hole already in it, but I had to carefully drill another one.  The internet also recommended instead of trying , somehow to wire the switches directly to the board, that I use a ‘barrier strip’, or a device that allows connections to be made through easy spade style connections and a screwdriver instead of soldering everything.  This was a REALLY GOOD IDEA.  It made the whole thing possible, actually.  I got mine at Radio Shack, and they have different lengths, but I ultimately needed to buy several different lengths to get 18 x 9, but eventually I got what I needed.  Then, I set about carefully soldering a wire to each tiny lead on the circuit board.  It would have been difficult without some way to hold the tiny little metal connectors to the wire, but I ended up using alligator clips to hold the wire to the board while I soldered it.  You can buy them cheap in little packs at Radio Shack and they come in handy for holding all kinds of things.  Then I shrink-wrapped heat shrink with my wife’s hairdryer on each lead to keep them from touching.  (shrink wrap courtesy of radio shack as well, which is why I had 3 different colors.  Multipacks…)

What the keyboard controller looked like after its surgery.

A note on supplies.  To make a little end attach to a wire, you must either solder it on, or use little terminal ends.  These come in different flavors.  There are the ones that connect by simply crushing the end onto an exposed wire with crimpers, or stab-crimps, which have little points that pierce the wire.  I needed a ton of little spades, so I ended up using some of both.  To use the terminal strips you need a LOT, which I got in packs at Radio Shack.

When I got done attaching it, the inside looked something like this.

Step 6.  Connect the switches to the correct combination of keys.

This took a LOT of time and patience, but was fun for my son.

First, we learned about continuity.  Each switch has 3 connectors, one ground and the other two are alternative ways to hook up the switch. 

Connecting the top lead and the ground always allows current to flow, but pushing the button interrupts it.  The middle connector never allows current to flow, but pushing the button allows current through, so that’s the one we need to connect the row and column to create a keypress.

NEXT Problem - figuring out which keys to use.  In reality, you want to set up something that you can use like a keyboard, so the one side should probably be mapped to the arrow keys.  Also, a lot of internet/flash games use space, so I made a main button a space key.  It’s a matter of finding the correct column/row and then connecting wires to the correct terminal.  My son enjoyed this part.  He also liked attaching the multimeter to the end of the switches and seeing how the current changed when the button was pushed.  Here’s my map:


The internet will tell you not to bother with keyboard controllers, but to buy a ready-made controller.  You’d still have to make the box, terminal strips, etc., but you wouldn’t have to map things above.  The most popular is probably something called the I-Pac, by Ultimarc http://www.ultimarc.com/ipac1.html  , which is 40 bucks, so possibly worth the money and has some neat software too.  But I did things the hard/dumb way just because I wanted to.

So, the giant warning involves something called key BLOCKING.  This is a problem with every matrix controller like the above.  Basically, when you press down keys that form a right triangle on the hypothetical grid, for example, ‘w’ ‘x’ and ‘r’ on my grid above, coordinates (7,2) (11,2) and (11,4), the keyboard controller BLOCKS the third keypress, whatever it was.  You can push down ‘w’ and ‘x’, for example, but then pushing ‘r’ will block - nothing will happen.  The same would happen in reverse.  Why?  Just because.  There’s some interesting theory explaining it (google is your friend, if you care), but sufficeth to say, that just happens. 

Solutions?  You cannot pick a set of keys that won’t ever block and you shouldn’t bother trying.  Just make sure the main two joysticks and the main three buttons on each side are chosen so that there is only ONE PER COLUMN.  If a button is the only one in its column, it cannot be blocked.  I didn’t think this was that big of a deal, but I can testify, it happens.   Another reason why the iPAC might be a good buy.

So, after all the keys were hooked up, the board was a mess of wires, and I didn’t care, since for several keys, we needed to attach them to the same terminal.   

Here’s the final chaos of wires that connect all the buttons. 

STEP 7.  Play!  So once all the buttons are connected, all you need to do is plug it in and configure your software, whatever it is, to use the buttons that you’ve set your board up to use, and you are ready to play!  Basically, the computer still thinks it is a keyboard.  Now, this one uses a PS/2 controller (the round one).  I’m using an old office box as a computer, but newer ones may not have that input.  I’m investigating PS/2 to USB adaptors.  Anyway, our arcade box has gotten TONS of use since we finished it, and my sons are very proud of helping ‘make’ it.  I made the dimensions such that you can sit on a couch next to someone with the panel on your laps comfortably and play.  There’s something visceral about hammering a physical arcade button instead of a gamepad. 

Anyway, we enjoy it.  It is the HEAVIEST gamepad ever made, but I’m thinking about handles.  Also, I’d have finished the surface, or added a plastic overlay, since plywood starts to disintegrate with heavy use, but for the most part, we haven’t had problems.  I enjoyed building it, but even more, I enjoyed doing it with my kids and now watching them play it. 

  1. scramtronic posted this

Design crafted by Prashanth Kamalakanthan. Powered by Tumblr.