Close

Rebirth 1: Hardware

A project log for USB Apple Extended Keyboard

An upgrade of the Apple Extended Keyboard I USB-ised in the mid 2000s

julian-calabyJulian Calaby 01/04/2022 at 05:400 Comments

At the time of writing this, I'm considering this project fundamentally complete:

This post is going to cover the hardware side of this latest round of progress.

The Matrix

The original matrix was designed to replicate the matrix of a cheap membrane USB keyboard and as such was just point-to-point connections between switches with some flying leads to the USB keyboard's PCB. QMK can support this sort of matrix, so I could have just gotten away with replacing the original USB PCB with the Teensy LC, but that wouldn't have produced the result I was after.

Adding a diode to every key took 4 days of work.

The plan was pretty straight forward:

  1. Remove the original controller
  2. Add diodes
  3. Add in the Teensy LC
Original matrix after the controller was removed

This is what the original matrix looked like after the controller and all it's flying leads were removed. You can see the leads in a pile in the bottom half of the case.

I also took the opportunity to label the connection point of every column and row, these are the big "C11" and "R5" labels. Note the thick sharpie marks next to some pads, this was to make it obvious exactly which pad was the connection point as there was already a lot of sharpie marks on the keyboard from the original matrix. (I believe I used these to mark connections in the original matrix once I was sure it "dealt with": either connected to the correct keyswitches or cut)

And this is what the board looked like when I was finished. I got into the groove and didn't take any progress shots.

Each keyswitch got it's own diode, however actually adding those diodes to the matrix required some level of creativity:

Using all of those options together resulted in an even more confusing matrix than it was originally: due to how all of this fit together, every keyswitch has at least one diode, and some have two or more connected to them. There was a lot of work required to decide which technique to use on each keyswitch, keeping in mind both the column and row nets and their particular requirements. I also took the opportunity to "weave" the hookup wires together so they kinda held each other down to the PCB, and after 4 days of effort, more solder joints than I can count, and a bit of frantic work to disconnect two nets that somehow became hooked together, it was finally complete, and to my immense surprise, worked correctly first time with all diodes in the correct directions and no shorts or mistakes.

I then found an empty part of the board near the top to glue down the Teensy LC, hooked it up with coloured wire (white for columns, black for rows) and started working on the QMK build for this keyboard. I'll cover that in the second post.

USB Hub

The original keyboard had a built-in USB 2.0 hub to drive the two USB ports on the right of the keyboard, I kept that, but replaced the hard-wired connection to the original controller board with a short USB micro-B cable. The idea here was that I could then glue the hub into the base of the keyboard's case and be able to disconnect the keyboard when disassembling. I ended up glueing the plug to the keyboard with hot glue during final assembly, so it's possible but not likely that I'll be doing that -  the micro-B plug there is particularly cheap and doesn't hold onto the socket particularly well.

LEDs

I'd chosen the pins used on the Teensy LC such that the columns were all in order and on a single bank of pins in the hope that this would allow QMK to do something optimal - I don't believe it does - and forgot to check the current ratings of the column pins when I wired them up. Consequently I ended up with 4 pins left over: 13 which has the LED hooked up to it - which I wanted to leave alone - and 24, 25 and 26, which are really the "extra" pins which really should get used for other stuff and frustratingly all have 5mA current limits.

I therefore made the decision to use some of the huge stack of BC547s I had lying around to allow for a higher amount of current on the LEDs. One of the problems with the original keyboard was that the very old LEDs on the AEK weren't particularly bright when driven by the original USB controller board, so the mistake I made - using 5mA limited pins - ultimately gave me an opportunity to fix another minor problem with the original board.

The circuit here is pretty trivial: a 240 ohm resistor between the LED and +5v, and a 1K resistor between the base and the IO pin on the Teensy.

Those who know AEKs well will notice that the LEDs are hooked up backwards. When I was labelling the LED pins while removing the original controller, I incorrectly assumed that the common pin was negative and then designed my structure above with the LEDs backwards. When testing I quickly found that the LEDs weren't working, so I removed them and reversed them.

Final Touches

Once the entire thing was tested, working and all the keyboard wiring was finalised, I added hot glue to every "free" joint on the board:

As discussed, the USB connection to the Teensy LC was marginal at best, so a blob of hot glue was added to keep the USB plug from falling out (it was approximately where the blue and red wires cross)

I also firmly glued the hub to the bottom case of the keyboard, positioned so the remaining USB socket faced into the body of the keyboard. I've thought seriously about adding a Logitech Unifying dongle to that socket, but I primarily use this keyboard with a Bluetooth mouse, so it would be of limited use.

Despite all the modifications I made to the lower case of the keyboard when originally modifying the keyboard, the new location of the cable pressed against one of the remaining stiffening ribs, so that had to be modified to allow it space to move around the post that goes in the hole to the left of the connector.

At this point the hardware was complete: I could close it up, flash it with QMK and be done.

However actually getting QMK working here required a surprising about of effort, so I'll cover that in a separate post.

Discussions