IBM Model M USB interface
The IBM Model M keyboard is a beast: weighing roughly 2kg, the buckling spring mechanism provides a unique feel (and a loud clicking sound that will drive your co-workers nuts). I learned to love these keyboards quite some time ago, when people started throwing them out to get new, “modern” keyboards. Unlike these, a Model M is nearly indestructible – the one I am typing this text on has “copyright 1985” printed on the bottom label, and the IC datecodes are from 1989.
While my current PC setup with the accompanying KVM switch still has PS/2 connectors, USB-only machines are coming up.
PS/2-to-USB converters exist, but they are like a box of chocolates – you never know what you’re gonna get. Some don’t work at all with a Model M, some work fine most of the time but get flaky occasionally.
This is a replacement PCB for IBM Model M keyboards. Instead of using an external converter, we replace the complete electronics of the keyboard with a new one with a USB socket:
This gets us reliable operation, plus some extras: changeable and extensible keyboard layouts, a macro recording function, all those extra keys that a modern multimedia keyboard has plus all the other features that the Quantum Mechanical Keyboard Firmware has to offer.
There are multiple versions of the original PCB, this replacement should fit most keyboards that have a detachable cable. Keyboards with a fixed cable probably have a PCB where the keyboard matrix is heat-bonded directly to the PCB without a connector, making a replacement difficult.
I wanted to achieve the following goals:
- The PCB should be a drop-in replacement for the original PCB and be compatible with as many variants as possible (at least those I had access to). Since there are keyboards with clamps for the smaller 150mm*37mm PCB in the bottom housing, the new PCB could not be bigger than that. No modifications to other parts of the keyboard should be necessary so that the modification can be reversed.
- Use a sturdy USB connector (ie. a standard type B socket) that is placed directly in the original cutout in the housing. I don’t like SMD connectors – I accidentally ripped the micro connector from the pro micro board on which my prototype was built, and I have similar experience with other SMD connectors. A big, heavy device like the Model M deserves a connector that does not break if you move the keyboard. Also, the smaller connectors make it difficult to fit them in a back plate with 1-2mm thickness while still matching standard cables.
- Use a moderately modern controller chip – STM32 or ATmega32u4. Software support for the AVR looked better, so I chose that – however, the available I/O pins required some port extension which is easily provided by two cheap 74HC165 chips.
- Provide a bootloader and a means of entering it to upload a new firmware, without opening the case. I decided to have a separate push button that activates the bootloader when it is pressed during power-up (QMK’s bootloader does not support hardware with port extenders). It was possible to put the button on the side of the USB connector in the original cutout, with the (transparent) rod doubling as a lightpipe for a status LED, giving a nice overall look.
- As an optional add-on, replace the 3 green LEDs with WS2812 RGB LEDs.
I think the overall design achives these goals well.
Complete design documentation and build instructions are available on https://github.com/mschwingen/hardware/tree/master/modelm-usb