Wireless MAME part 3 – Electrical Design and Construction

Hopefully you found the discussion about the mechanical design of my MAME setup informative, but the thing that – for better or worse – sets this apart from most of the others on the internet is the fact that it uses a wireless keyboard for control.  One could probably use a wireless game controller (or possibly two)  with similar or better results.

wireless keyboard and mouse Microsoft Model: 1014 keyboard and 1028 receiver

wireless keyboard and receiver (before) ===>

finished Wireless MAME controller

Finished Product (after)

 

 

 

 

 

 

 

The first thing to consider when using a wireless keyboard (or wired keyboard for that matter) for this purpose is how to imitate a keystroke with a button and joystick.  At its core a button is simply a switch and a joystick is four switches.  A key on a keyboard is a switch as well.  Unfortunately it’s not as simple as just replacing the key switch with an arcade-style button.

The challenge with keyboards is that each key doesn’t go to one discreet input on the controller, instead there is an array of positive or signal connections and grounds that must be connected in a certain way to activate each keystroke.  Unless you can get a spec sheet from Microsoft or Logitech you’ll have to figure out the combination for each key yourself.  If you happen to be using the exact keyboard that I did (Microsoft Model: 1014 keyboard and 1028 receiver), I’ve provided a list of the keys at the end of this article that I mapped so there’s a small chance that this article could help you.

Keyboard wiring (ground side)

So how do you map the keys?  The first step is to take the keyboard apart (obviously).  Inside you’ll find 3 sheets of plastic.  Two will have printed circuits on them where the third separating them will not.  The way this works is that two sides have contacts separated by another thin sheet of plastic.  When the key is pressed the signal and common sides are connected.  There are a number of signal wires coming from the controller and a number of grounds (8 grounds and 16 signals in this case).    If you connect them in the right combination it equals a letter, number, or symbol.  If you look at the upper-left side of the keyboard sheets above you’ll see where the sheet connects to the wireless chip.

Wireless keyboard chip and PCB

Wireless keyboard chip and PCB

So what you will need to do is use a voltmeter to trace out the wires from the place the key would need to be to the place it connects to the main circuit board.  Once you trace this out for the signal and commons, if you connect them together (with a button or joystick) that will give you a signal for the corresponding keystroke.  That’s the basic idea, but there are some good tutorials on youtube if you need more insight.  One thing to keep in mind is that if you’re trying to trace it with an audible signal, sometimes the connection isn’t that great and won’t give you a total short.  Look a the display and this will show the poorer connections if you don’t hear the “beep.”  Also, I wrote the actual letters on the plastic sheet from the keyboard and the numbers on the wireless PCB.  This will probably help, and it’s not like you will need to use the keyboard again.


In order to hook everything up you’ll need to following parts:

  • perf board line pattern – ecs-4 – $6.25 – allelectronics.com
  • IDE cable – cbl-48 – $3.65 – allelectronics.com
  • snappable headers 2×40 pin – dhs-40 – 1.25
  • small (around 22 ga) wire from Radio shack – approx $5.00
  • 2 AA battery holder from Radio shack – approx $2.00
  • .24 inch black poly spot (100/sheet) – rf-52 – $2.00 allelectronics.com (for the bottom of the cabinet – technically mechanical but you don’t want to put in 2 orders)
  • And of course you need the keyboard that this is all based off of

As for tools, you’ll need:

  • Soldering iron and solder
  • Voltmeter
  • Cutting tool
  • File or Dremel tool
  • Vise

Once you get it all traced out (or actually before, it doesn’t really matter) solder each connection on the keyboard circuit board to an IDE 40 cable that you would use for a hard drive.  The link listed before does a pretty good job of explaining it, but an old-style IDE 40 cable has 40 conductors as you’d expect.  The newer IDE/ATA cables actually have 80 conductors, but every other one is linked to ground.  This is what I used, but it’s somewhat of a pain because you’ll have to go through and separate out the ground wires which should be every other one.

separating a cable into signal and ground wires

Also helpful to label which way you’re going

The connection at the other end of the ribbon has two sides of which I used one for signal and one for ground.  Every other signal goes to a different side of the connector in order and given that I was using an IDE/ATA cable this meant there was a ground in between every signal.  Trace it out with your voltmeter, but the pattern that resulted was: ground, signal, ground, common, ground, signal, ground…  on and on and on until you reach 80 wires.  I separated each and marked the signal and grounds with red and blue markers so I didn’t get them mixed up.  If you can get a true IDE 40 pin cable that would probably be much easier.

soldering started to board

Attaching the board to a solid surface will help you solder it.  I’m not sure that this is the correct way to hold your iron, however.

You’ll also need somewhere for the cable to connect to, so this is where the line pattern perf board and 2 x 40 snappable headers come in.  Cut a piece big enough for the connect each lead to a pin as shown below, then file the connector in two so that each side is electrically isolated.  Solder the header on as shown, snap the IDE cable on and you’ve got something to solder your button leads to.

perf board about to be cut with rag

Step 1 – setup the perf board and cut to size – a vise and hacksaw works well for this.

filing the perf board

File the perf board as shown. Again, a vise is a good tool to use with this, also a Dremel Tool would work well.

perf board connection severed

Go ahead and test that you don’t have a connection from one side to another

perf board with connector

put the header (set of jumpers) on and solder.  Jumpers should actually be on the other side to solder, but you can see the position here.

At this point you’ll also want to hook up a 2 AA battery pack to power it.  You should go ahead and test your setup at this point.  With voltage on you should be able to produce symbols and letters by attaching the appropriate signal and common together.

soldered ready to go

Everything soldered together, ready for button connection.

Once you’ve got this, the only thing left to do is test the keys that you have decided to use and solder them to the appropriate buttons.  This is not an easy task and you may find that some “keys” don’t work the way you wanted them to.  Don’t be too much of a perfectionist about this, it’s acceptable to do some experimentation and possibly skip some keys that don’t work as you expected.

Also, you may find that your soldering skills aren’t up to par or that you’ve just wasted quite a bit of time hacking together a controller that you could have bought for around $40.  With my setup, I was only able to get the joystick working with 3 buttons and some of the buttons didn’t work together well.  For simple games like Galaga or Pacman, this would work well, especially if you absolutely need it to be wireless (I haven’t found an encoder to buy that is wireless, but they may be available).  However, in terms of time and how well it works, after doing this, I would say go with a purchased encoder.

If you really want to set up your system like I did, this is the way to do it.  I eventually decided to use an encoder for control of this device with good results so check out that build here.  Also, I did end up making the outside look better using contact paper, so be sure to check that out for some possibly new techniques.

As promised, here is a pinout on Microsoft wireless keyboard model 1014.

Ma output list

Output list for Microsoft keyboard model # 1014

Leave a comment ?

11 Comments.

  1. MAME using an encoder | - pingback on January 12, 2011 at 5:44 pm
  2. Wireless MAME – part 1, introduction | JCOPRO.NET - pingback on September 22, 2011 at 2:52 pm
  3. Turn your Wireless Keyboard into a MAME Controller! - Hack a Day - pingback on September 27, 2011 at 12:04 pm
  4. Did you have any trouble soldering the wires to the circuit board from the keyboard? For some reason, my solder will not stick to the board.

    • The whole soldering operation was not easy, but I think I may have actually had to file the wireless board to allow the solder to flow well onto it. It’s been a while since I did it though.

  5. I’ve just finished my project using using a keyboard controler (same 8/16 contacts) and found that using inputs that are connected to the same “common” wire avoided conflict in simultaneous use. Unfortunately there were a max of 14 of them (on the common n° 4 for my logitech Deluxe 250), so, 2 short of what I needed (other non critycal inputs picked in combination with the other commons). I finished using a broken (still clicking) 5 buttons (2 main clicks, wheel click and 2 side-clicks) usb mouse.

    Other more systematic/fast methods to find out keys/wire association are available using software such as “xev” (on linux, monitor and print in a terminal X input events), I guess such programs are also available on other plateforms.

    To Bruce Wayne : On my keyboard, some graphit (dark blobs) were covering the contacts, I had to hetch them before soldering. like there http://clind.aimao.org/fofo/arcade/soudure.jpg

    • Congratulations on finishing the project! I feel like the whole keyboard thing could work, especially for simple games like Pacman or Galaga, but in the end, the encoder was much easier!

  6. you could send me photos of the circuit wireless keyboard please, is that I need to see as the antenna and the receiver as usb

    • Hmm, probably the best photos of the circuits that I have are on that post. I didn’t take the receiver side apart if that’s what you need. Feel free to poke around my MAME projects, but most of the info I have is on there. Maybe I don’t understand your question though…

  7. Old School Update: November 2010 - pingback on July 31, 2012 at 8:50 pm
  8. "Helping Hand Unboxing and First Use | JcoPro.net - pingback on April 26, 2014 at 9:21 am

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks and Pingbacks: