Computers

Restoring an IBM Model M 1394324 Terminal Keyboard

DSCN4422A while ago I became interested in mechanical keyboards and now use them both at home and at work. These days most of the mechanical keyboards on the market use a switch made by Cherry, but there is a huge amount of support amongst enthusiasts for a much older keyboard, the IBM model M.

It is still very much possible to find one of these keyboards as the construction of the keyboard makes them incredibly durable, even against prolonged use and abuse. The other reason that they are available is that the range of IBM model M keyboards were in production from between 1984 right up to the current day albeit under 3 different manufacturers (IBM, Lexmark and Unicomp). I recently purchased a 122 key terminal keyboard, an unusual version of the Model M. Here is the steps that I took to bring it into it's second career as a USB 121 key keyboard.

The keyboards typically supplied with use on modern PCs tend to use rubber dome key switches. When the user hits a key on the keyboard, the key pushes against a dome shaped piece of silicon rubber which collapses allowing the bottom of the key to contact with a set of contents on a membrane. The advantage of this system is cost, it is very cheap to manufacture even if the typing experience is less than optimal. The key registers when the key reaches its full extension and the user knows that the key is pressed when they feel the bottoming out of the key.

Some Buckling Springsclip_image001What is unique about the IBM Model M keyboards is the key mechanism that they employ. It uses what is described as a buckling spring key. A buckling spring key works differently to the more common rubber dome keyboard. Each key is inserted into a plastic tube and pushes against a metal spring fixed to a lever. As the springs are depressed, the spring eventually bends and collapses, in doing so it pushes the lever which then contacts with a membrane.

Sourcing an IBM Model M Keyboard

So where do you find one of these beasts?  Well I managed to find mine on E-bay.  General advice from the Model M aficionados is that you should not  buy one of these without at least seeing pictures.  This is probably sage advice as these machines can see some pretty heavy service.  I certainly trawled through various sorry looking examples whose owners were looking for a premium price.  However when my keyboard came up I decided it buy it blind.  The seller described it not as a model M but as “IBM 1394324 TERMINAL KEYBOARD”.  This particular version of the Model M family was not documented in the usual resources and so with no photo and no clue in the sellers description I was doubtful that it was a true bucking spring keyboard.  I Google searched the model though and managed t find an old e-bay listing with a damaged one.  The glimpse of the innards in the e-bay photo told me what I needed to know. (The first four digits of the model number were a massive clue).  The seller did describe it as:

“Seller refurbished: An item that has been restored to working order by the eBay seller or a third party not approved by the manufacturer. This means the item has been inspected, cleaned and repaired to full working order and is in excellent condition. This item may or may not be in its original packaging. See the seller’s listing for full details.”

So I went ahead and purchased it and a couple of days later i received what appeared to be a keyboard in pretty good condition.  Outwardly it was clean and their was no obvious damage at all.  Even typing on the keyboard there appeared to be no damaged keys though one or two of the keys felt a little less tight than the others (I suspected the springs were a little worn as it was the most commonly used keys where the action was slightly looser.

The Restoration

Even though the keyboard was in very good condition to begin with, I had a few jobs that I wanted to get done to restore and modernise it, namely:

  • Convert the keyboard to work on USB.  The 1394324 TERMINAL KEYBOARD uses an RJ45 connector and is designed to work on old IBM terminals.  A USB conversion seemed like the best way to ensure it had a future career
  • Update the keyboard layout.  This keyboard had been designed to work on computer equipment that was built before the layout that we are familiar with now was settled on.  While it was pretty much the same there were plenty of little differences that make typing difficult and unfamiliar.  Really I could  just replace some key caps though my number pad had a different layout from modern keyboards
  • Convert the keyboard to 121 keys
  • Replace the worn springs.  To do this is not so easy on the IBM Model M keyboards.  Though new replacement springs are very much available to buy.
  • Bolt Mod.  This is a modification frequently required on IBM Model M keyboards simply to repair damage that accrues through age.  It is also essential if you wish to replace springs or alter the layout of the keyboard.

Assessing the State of the Keyboard

The first job for me was to disassemble the keyboard.  If you intend on working on the IBM Model M keyboards then the first tool you are going to need is a 5.5mm socket driver  for the hex screws that hold the case together.  The internal circuit board inside uses a smaller hex bolt to secure it to the keyboard.  I ended up buying a ROLSON PRECISION SOFT GRIP SWIVEL CAP NUT SPINNER TOOL 6 PIECE SET KIT NEW set from Maplin though you can get them from Amazon.  It has both the sizes needed to work on the keyboard

Fluffy DebrisOpening up the keyboard I was pleasantly surprised.  Despite it’s age the keyboard was relatively clear of all the nasties that you might expect to have fallen between the keys.  Either this keyboard had a very pampered previous life or the E-bay seller had done a very good job cleaning it out.  There was some dirt trapped inside, some fluffy oose and the sticky kind of dust that you try very hard not to think about too much when you are cleaning it.

To remove the dust I pulled out all the keys from the keyboard (The pull right out with a gentle leaver from a flat edged screw driver).  Initially I just used the vacuum cleaner and a brush attachment to clear the most visible dust.  This would do until I completely disassembled the keyboard later on.

There was no other nasty surprises inside the keyboard.  All the case plastic was in tact, even those annoying plastic tabs that seam to break whenever i look at them.  The coiled cable was showing definite signs of age. The once flexible rubber was looking dull and brittle in places.  I was not overly concerned with this.  It would have been nice to save it and convert it to USB use, but a USB cable the same colour would make a suitable replacement in the end.

The construction of an IBM Model M keyboard is interesting.  On the top side is a black ABS plastic tray which has all the fittings for the Keys and contains the mechanical parts that make the keys work.  Next comes a membrane layer which is key mechanisms contact with when a key is depressed.  Lastly is a metal plate.  Cleverly the Front plate and metal plate at the rear are held together by plastic rivets which are really part of the ABS front plate.  It is common on IBM keyboards to find that poor care and old age has led to these rivets breaking.  On my example all rivets appeared to be in tact.  However I was going to remove these rivets with a sharp chisel so that i could take my keyboard completely apart.  That would mean that i could replace the most used of the springs and alter the layout of the keyboard to modernise it slightly

Disassembly

DSCN4332Removing the rivets was a pretty easy job.  I found a photo guide here, which I pretty much followed.  When all the rivet heads had been chiselled off, I was able to prise the front and back  of the keyboard apart.  All the mechanical parts of the keyboard become loose at this stage, I was carefully not to let any of the springs leave their settings.

DSCN4367The next thing that I did was to systematically remove the bucking springs from their settings.  Each spring was placed into a zip seal bag into groups based on Letter Frequency  in normal English.  My plan was to rotate the springs from the least used keys to the most used keys.  The very most worn or damaged springs would be thrown out and replaced with new components from Unicomp.  In all I replaced around 12 springs.

Once the keyboard was completely stripped of it’s springs the plastic front panel received a warm soapy bath and a careful drying to remove the most stubborn remaining dirt. 

Bolt Modification

DSCN4366When dry I then used a Dremel rotary tool in a drill press to drill holes where the rivets had once been.  When all the Rivets were drilled out (There were 60 odd of them),  I was ready to start reassembly.  I began by replacing all the springs, the new replacements went in first in the places where the enter keys, space bars, control keys etc. had once been.  Next in went the most frequently used key placements with the springs removed previously from the rarely used keys.  This continued until all springs were replaced.  On the number pad, I had to place a slider piece (A hollow tube of plastic used to stabilise larger keys) in one of the key places that had previously held a spring.  This was because i wanted to use a double sized plus key where previously there had been two single sized keys.

DSCN4380All of the bolt modifications that I have seen documented online use pretty standard machine screws and bolts.  Some of the people that have performed this modification have then painted the silver screw heads black so that they do not show up on the keyboard.  I opted for a slightly different setup.  I purchased M2 Black Zinc Wafer head M2x8 Machine Screws.  These are the kind of machine screws tat you normally see used to bolt laptop computers together.  The wafer head has a much lower profile than a normal machine screw and together with the black zinc coating, where screws are visible between the keys they are near impossible to see.  Although these machine screws are quite a bit more expensive than most M2x8 machine screws I think that they make a worthwhile refinement to the IBM Model M bolt modification.

DSCN4373DSCN4369DSCN4370DSCN4372DSCN4374The bolt modification is relatively easy to perform, but in my case I initially found finding that it was fiddly to get just the right amount of tension in the bolts.  Every so often my space bar was getting stuck. 

In the end I had to remove all of the bolts and redo inserting them.  This time I was a little more methodical in the order that I inserted the bolts working from the bottom to the top of the keyboard.  This seemed to do the trick as now the keyboard is performing reliably and has done so for a good amount of time.


Layout Changes

DSCN4305The M122 terminal keyboard that I received had a layout that differs from a keyboard you may buy in the shops today.  Most of the keys exist in the same places, though some of the braces and other symbols keys were in slightly different locations.  There are of course a few more keys, 24 function keys as opposed to the normal 12.  There is also a group of 10 additional keys on the left of the keyboard.  The number pad on the right hand side was of a different layout.  On most number pads available in the UK we have 17 keys with the plus, enter and  0 keys being double sized. My M122 keyboard came with 18 keys the plus key being single sized and the layout of the keypad differing.  Being an Excel enthusiast and a regular user of the number pad I though the keyboard would be more useful to me in a more standard configuration.

DSCN4422The solution was to purchase a full set of keys designed for a 101 key UK layout.  Unicomp in the US produces replica Model M keyboards and sell these keysets in the original IBM colour schemes.  With their replacement keys I could modernise the layout. in the set of keys was also a more modern number pad set. 

DSCN4456I was also able to order from Unicomp a stem support that was required for the larger plus key.  The Stem supports occupy one of the barrels of the keyboard and work as stabilisers for the larger keys on the keyboard.  IBM themselves used similar stem supports in the original construction for keys such as the enter keys and 0 key on the keypad. 

Although I would end up with a lot more keys than I actually needed to complete the conversion it was cheaper and easier to just buy a set and use what I needed from it.  I may sell off other keys on e-bay to owners of IBM model Ms who have lost a key or two in the future.

The replacement key set was a pretty close colour match to my twenty year old keyboard, though the fonts differed in a number of places.  If you sit an original key next to the modern replacement there are small differences. What I tried to do was use the new replacement keys as much as possible.  However I had to use the original function keys as there are 24 of them. 

DSCN4387I also opted not to use the modern replacement keys for the number pad numerals.  The modern keys have inscriptions on them for use when Num Lock is switched off.  I never switch Num Lock off intentionally so I used a blank key in the Num Lock Position.  The blank key that normally operates as the Number lock now opens the calculator program in Windows for me.  Much more useful! I prefer the simpler look of the old number keys.

DSCN4419 (2)For the 10 extra function keys on the left hand side of the keyboard I used a mixture of command keys and letters from the old keyboard.  The letters A-E I am using as Extended keys to open Explorer.  I have not yet programmed macros for two of them, but I will have one open One Note.  In the second column I have the ESC key and other command keys.  At the bottom I used a custom GeekHack key purchased from Unicomp as my Windows key.  I did try and order a windows key from them, but they sent the wrong size for my purpose.

The USB Conversion

A lot of the IBM Model M keyboards are compatible with the PS2 standard so getting them to work with a modern PC is just a matter of finding the correct PS2 to USB adaptor.  Apparently not all work because these keyboards use a bit more current than a normal keyboard in operation.  The M122 versions on the other hand were not designed for use with PCs but rather for dedicated terminals. Both the normal keyboards and the terminal keyboards use a serial connection to the computer they are attached to, but the terminal machines use a  different set of scan codes.  They generally will not work simply by using a PS2 to USB converter.

Happily other people have already conquered this issue using microcontrollers in order to convert scan code 3 keyboards to USB operation.  I used firmware developed by someone going by the name of Soarer that I found here at GeekHack.org.  Soarer designed his firmware to be loaded on to a Teensy 2.0 development board.  I opted to  use a different development board for my conversion.  The board I used is the MT-DB-U4 from MattairTech.  It uses the same ATmega32U4 micro-controller as the Teensy board but including shipping to the UK works out a bit cheaper.  The second reason I went for this board is that I have used it before in another project and liked it.  Thirdly Justin Mattair was very communicative in the past when I was working on a previous project so I knew I could be confident of his support if I needed it. 

DSCN4418The MT-DB-U4 development board is a really neat board.  There was plenty of space to install it in the IBM Model M case.  I managed to find a grey USB cable that goes well with the keyboards colour scheme and cut it up to use as my new keyboard cable.  I would have liked to have re-used the IBM’s original curly cable as my USB cable (it had enough wires inside) but the plastic outer sheath had perished with age.


The original keyboard had a moulding on it that mates with the case and provides strain relief.  I managed to remove that from the original cable from the strain relief piece using a sharp hobby knife.DSCN4411

Next I used a drill to enlarge the hole and make it match the circular profile of a grey coloured USB cable retrieved from a parts bin

 DSCN4412

I then fed the new USB cable through the strain relief and used tie wrap to make sure that the USB cable would not accidently be pulled out. It would have been nice to keep the keyboard close to original but in the end I decided that this project was not about creating a museum piece but a functional classic.

 DSCN4415

Soarer supplies the hex file for the keyboard converter.  I loaded it onto the MT-DB-U4 using a USBtiny programmer using the ISP pins on the circuit board. 

I love Soarer’s firmware.  The keyboard works now as a native USB device on my PC.  What is best about Soarer’s firmware is that it allows the Keyboard to be re-mapped via PC based software.  I have only just begun to make use of this feature, but it allows me to make the most of all those extra keys that I now have at my disposal. The firmware allows me to create key stroke macros or additional modifier keys to the keyboard.  I am looking forward to adding macros that work with Visual Studio key chords.

The Results

So how does a restored IBM M122 keyboard feel to type on?  For many keyboard enthusiasts IBM are the unchallenged masters of the mechanical keyboard world.  It is easy to see why these antique (Well in the world of IT, 20 years is antique) have garnered such a loyal following.  Clicking a Model M key is a very definite affair. What I mean by definite is that there is absolutely no doubt in your mind when you have clicked the key.  The keys require a level of force to activate them that does take a little getting used to. When you do activate a key you get a satisfying clack sound with the slightest metallic ping from the buckling spring.  It is loud, very loud.  Through your fingers there is a definite feel from the keys.  As the spring buckles you feel the give occur which matches perfectly the characters appearing on screen. 

Initially it took a little time to make my mind up if I liked it.  After a bit of use I am growing to love the feel of this keyboard and find that it is a very easy machine to type on despite the extra actuation force require. However i really like the feel of the Cherry MX browns and blues that I have on my other two keyboards.  They definitely feel like they require less effort than the IBM M122. 

What cannot be argued is that the IBM is a far more tactile machine than either of my other keyboards, or indeed any keyboard that I have ever used.  If you own a mechanical keyboard and enjoy typing on it, you have to try an IBM model M.  It may or may not end up being your favourite keyboard, but it certainly will be your reference point for comparing every other keyboard that you type on. 

This project has been an incredibly satisfying one.  Thanks to the previous efforts of others, updating an old IBM keyboard, even a terminal one is relatively easy, and almost certainly going to be a successful one.  However the satisfaction is not diminished by this fact.  These devices are the work of modern craftspeople, giving one a second lease of life is a great thing to do.  The build quality is such that the keyboard will repay you over and over again! 

Future Plans

  • Secondly i plan to make the most of Soarer’s firmware by reprogramming the keys.  The function keys from F17 to F24 are pretty much useless in Windows applications, so I will create macros that will speed up my programming activities. 
  • In the future I may consider some discrete additions to the keyboard.  I have purchased an engraving machine, so some custom badging may be in order.
  • The keyboard does not have LED indicators for the Caps Lock, Scroll Lock or Number Lock on it as standard.  Soarer’s converter allows pins on the development board to be used for this purpose.  At the moment I am not missing the LEDs but in the future I may add a panel if that changes.