Hack It Better: Apple Extended Keyboard II

I’m lucky enough to own an Apple Extended Keyboard II, which belongs to my Macintosh SE. Unfortunately, it wasn’t doing much good connected to my rarely-used SE. So, I figured it would find a better home on my desk at work, where I spend the day pounding away on a crummy keyboard anyway.

The Apple Extended Keyboard II is a dream to type on because it uses mechanical switches. And I lucked out: Apple made a lot of revisions of this keyboard with cheap switches, but it turns out that I got one of the good ones. Mine is a USA model with authentic Alps Cream key switches.

The biggest stumbling block to the project was the computer’s interface. The Apple Extended Keyboard II is from the days of ADB, or Apple Desktop Bus. The internet revealed two possible solutions: An expensive and sometimes-hard-to-find adapter by Griffin, or a $16 microcontroller and some DIY elbow grease. Naturally, I chose the latter.

Building It

All that’s in this project is a Teensy 2.0 microcontroller and the keyboard. The process is as simple as connecting the proper 3 pins to your ADB keyboard and then programming the microcontroller. I chose to enclose the entire converter inside my keyboard, as I didn’t want a little dongle hanging out to break and I also didn’t have the proper connecters to mate with the keyboard’s.

The most technical step is to compile and install the firmware. A simple task; though on my Mac I had to install CrossPack to compile for the Teensy and TeensyLoader to flash code to it. Here I must give a shout out to the awesome folks who developed the code – they also have support for a bunch of keyboard types.

~$ git clone git://github.com/tmk/tmk_keyboard.git
~$ cd tmk_keyboard/converter/adb_usb
~$ make

Then use the TeensyLoader app to flash the .hex image onto the microcontroller.

Connect ADB pin 1 (data) to Teensy pin F0, pin 3 to Teensy vcc (5v), and pin 4 to Tesny gnd (ground). You could wire up a DIN-4 (“s-video”) connector if you wanted (female to use an authentic Apple cable, male to make your own cable), or you could completely enclose the Teensy into the keyboard like I did.

Here’s a gallery:

Apple Extended Keyboard hack
The microcontroller, soldered up and connected to a mutilated mini-USB cable. I have since thoroughly cleaned the keys. They were pretty dirty, as you can see!
Apple extended keyboard hack
The microcontroller is all tucked in, out of the way.
Apple extended keyboard hack
I tacked wires onto the existing ADB solder joints so I can still use the keyboard with ADB macs.
Apple extended keyboard hack
The connector fits neatly back into place.
Apple extended keyboard hack
All done, ready to be buttoned up.
Apple Extended keyboard hack
The USB cable comes in through a slightly widened existing hole in the case. It passes out on the inside of the edge, so the cable just seems to appear.
Apple extended keyboard hack
The ADB ports are still there, ready to be used. The USB cable comes out from under the raised keyboard.
Apple extended keyboard hack
The end result: It works great with my MacBook Air.

 This article was also published on Scott’s blog, Scott the Robot.