Reverse Engineering a keyboard

...To be used as an Arcade Emulator Control Panel Interface...

!!!WARNING!!!
I am not responsible for any damages, death or burns on hardware/software/flesh/pets or anything, anything at all which may or may not occur by following the instructions here within this document. (((YOU are responsible for your own actions))). Under no circumstances will I be held liable for anything. I don't guarantee this to be 100% accurate. Just because it worked for me does not mean it will work for you. You are more than welcome to try this at home BUT do so at your own risk. ps: BEWARE of the solder iron! The solder iron! Hot! hot! hot! :)

First you need a basic understanding on how a keyboard works and what this project is about.

  • About the keyboard: Keys on a Keyboard work like switches. You press a key and it closes a circuit just like a switch. Depending where in the matrix this circuit is closed, a character will be generated.
  • About the project: I want to design a control panel, layout the switches where ever I want them and then rig the switches to the keyboard's circuit. When a button is pushed on our control panel, this will close a circuit and depending where in the matrix of the keyboard this circuit was closed a character will be sent to the computer. Simple ;) Imagine it like extending your keyboard's keys. Or never mind...

    Status: Hot Progress!

    keyboard 1:
    I bought the keyboard for $4.00 + tax at a thrift store in Athens Ohio. It happened they were having a 1/2 off sale. I actually ended paying $2.00 + tax.

    IBM
    Part no. 1391401
    S/N No 2051477
    Date 12 mar 87
    Plt No F2 Model M Matrix: 16x8
    Connector: ps2

    First thing I did was use a program called keyscan to find out how many keys I can press at once without ghosting or blocking. My result was 19 keys. I wrote down the keys on a piece of paper. I kept this paper safe because I would need it later when I go to map/find The Matrix.

    I opened the keyboard casing keeping everything intact. This keyboard uses maylar to connect keys to a small printed circuit board (pcb) in a 16x8 matrix. I disconnected the maylar from the PCB noting its previous position. I removed the pcb from the keyboard casing and set the casing aside intact.

    Since the PCB uses maylar, it had a pinch type terminal which needed to be changed to a pin strip terminal in order for me to use ribbon/IDE wire.

    I changed the original pinch type terminal to a single row pin connector ( pic-1, pic-2, pic-3)

    I could not find any other wire that would fit in the single row of pins other than IDE. All I had laying around was an ide cable. Because of the way ide cables are made I had to pick what wires worked and what wires didn't.

    IDE Connector:   <-count direction
    Top pin holes:          9 7 5 3 1
    Bottom pin holes:      10 8 6 4 2
    

    I chose the top row and I needed to discard the wires from the bottom row. On the flat ribbon IDE it goes like:

    1 wire keep, next wire cut.
    1 wire keep, next wire cut.
    1 wire keep, next wire cut.
    <--Look

    It would have been easier to buy a single row wire adapter (which i didn't do) or to solder the wires to the board (which I do not plan to do.)

    After striping the other end of the wires I connected them to the three Dual Terminal Barrier Strips I got from Radio Shack Cat.#: 910-3197. I named two bariers 'Alpha' (the barriers that are close together in the picture) and the other one 'Numeric' (the single barrier you see in the picture. The part number varies according to the Radio Shack Web site so does the price.

    Beseech The MatriX

    To map the matrix I mean to draw an X/Y table and fill in the blanks according to what happens when you join X with Y. So in my case, I drew a table with its columns named A1 through a16 and its rows named b1 through b8 making my a16xb8 matrix. Example:

                      a#                   
    
          0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 
        b1                                  
        b2                            
        b3                             
        b4                              
     B# b5                             
        b6                              
        b7                             
        b8                            
    

    I then took a 9v battery, a test light, and an aligator clip and made a "poor mans continuity tester to be used on the maylar (not the pcb)

    I took the end of the maylar (the part that connects to the PCB) and set an aligator clip on what would be known now as b1. (see illustration.) Then I took the continuity testor and poked at a-1. I proceeded to press every key until I got a light :) then I wrote down that key that generated the light.

    If you look at my matrix you will see that by shorting a2+b2="Left control". If none turned on the light, I move on to a-2 leaving the aligator clip on b-1. While the gator clip is on b-1 you must test a-1 through a-10. Then you move the gator clip to b2 and test from a-1 to a-10 again. you do this until you run the gator clip through all b#'s.

    (((1 bag of doritos, 24oz of dr.peper and 2 hours later)))
    At last! What I have been looking for! Muhahah! The Matrix in which the Keyboard operates. Match a# with b# and your result is a character.

    For example:

  • Touch terminal b5 with terminal a3 and the output character is: Q
  • Touch terminal b5 with terminal a4 and the output character is: W

    Remember the Multiplication cheat table? Its that simple.

    16 X 8 IBM Keyboard Matrix (columns are marked 'a' to 'p' and rows are marked '1' to '8')
    a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16
    b1 esc F4 G F5 H F6 " #0 #. Arrow up L Alt
    b2 L Shift Tab Cap Lock F3 T Bk Space Y [ F7 #4 #5 #6
    b3 L Ctrl ~ F1 F2 5 F9 6 = - F8 Del Ins Page Up Home
    b4 1 2 3 4 F10 7 8 0 9 F11 F12 Page Down End Prnt Scrn
    b5 Q W E R U I P O #7 #8 #9 #+ Scrol Lock
    b6 A S D F \ J K ; L #1 #2 #3 #Enter
    b7 R Ctrl R Shift Z X C V Enter M , \ . #num Loc #/ #* Pause
    b8 B Space N / Arrow Down Arrow Right Arrow Left R Alt

    So now I have the matrix in my claws. I have already done the button layout and woodwork necessary for the control panel. This took one day. Now its time I proceed and wire the control panel.

    Each switch requires 2 Wires. The switches them selves have 3 tips and two settings which are NO (normally open) and NC (normally closed) I want the NO setting. So I Connect the two wires accordingly. Now at the other end of the wire we connect one wire to numeric terminal and one wire to alpha terminal. This has to be done with all switches. So it might take a while.


    It is done and working!!!...with a few minor bugs which need worked out. I should have ordered 2 more buttons for some extra features. O'well. (you can see a temporary solution in the picture above. Its the "o/k" buttons)

    Links of interest:

  • http://www.starbase74.com/mame/solder_prnt.htm (Tutorial about soldering.)
  • http://www.arcadecontrols.com (Here I learned everything I know about this project.)
  • http://www.arcadeathome.com/ (This place has more examples and misc stuff. Look under 'cabinet pics')

    Back to main page.




  • DigitalPuppy
    Email address: digita1puppy(a)msn.com
    ...best if viewed with video resolution of: 800x600...