in which keyboard science goes further

My last post documented my initial exposure to the wild world of custom keyboards and the numerous ways it's possible to improve on the conventional design. As I dug deeper into the topic, I was struck with the simplicity of the underlying concepts. While the Ergodox is a notable and admirable achievement of engineering, the techniques used in its design and construction are remarkably approachable to anyone with a bit of electronics experience, some DIY spirit, and access to a laser cutter. A few weeks ago I decided to try my own hand at keyboard design, and the Atreus is the result.

Update: I have started selling kits if you want to build your own.

atreus keyboard

Since I already have an Ergodox, I thought about what kind of board would complement it. I have a few minor ideas about how its overall design might be improved[1], but the main thing that bothered me about the Ergodox is that it made me really dissatisfied when I wasn't using it—going back to my internal laptop keyboard drove me nuts. I found the split halves and relatively large size (which are fantastic for stationary use at a desk) make me reluctant to use it on the lap, at a coffee shop, or on the couch, so that's the primary use case I've targeted with the Atreus. It still has most of the other characteristics that make the Ergodox stand out, like mechanical Cherry switches, staggered columns instead of rows, heavy usage of the thumbs, and a hackable microcontroller with flexible firmware, but it's dramatically smaller and lighter[2].

atreus acrylic layers


Layered acrylic is a popular material among DIY keyboard hackers, and for good reason. After taking a short workshop down at Metrix, I was able to design the case for this board in Inkscape and get it cut in acrylic for only about $33 including materials. My first attempt used 6mm acrylic for the middle two layers, and with the laser at high power, a few of the key hole cuts got hot enough that they melted back together. They graciously offered to re-cut it and suggested something thinner, so I ended up with a 4.5mm switch mounting plate.

Once I got the switches and keycaps mounted, I started to get a better feel for what it is like to use. It was apparent there were a couple minor mistakes in the case design: the two innermost thumb keys' caps rubbed together when pressed, and the bottom-most thumb keys of the thumb column didn't have enough clearance against the next key up; pressing one would cause the one above it to depress. I have modified the case file to correct for this, but rather than re-cutting the switch plate I simply sanded out the top layer and middle keycaps a bit.

If the heart of a keyboard is its microcontroller, then the matrix is its circulation system, connecting every key to the ones adjacent to it. Because a microcontroller has a limited number of pins, it takes a bit of cleverness to read every key. Each row of the matrix is wired into an output pin, and each column is wired into an input pin. The microcontroller cycles through the rows one-by-one, reading the state of each column to know which keys of the currently-active row are down. In my wiring below, I use red wires for the rows and black/grey down the columns, and then the bottom of each column is brought back to the microcontroller with ribbon cable.

atreus matrix

The wiring of the matrix for me took just under four hours, but I made a number of silly first-timer mistakes that slowed me down. Each switch needs a diode to prevent ghosting when multiple keys are pressed at once. My first attempt resulted in diodes wired in series in each row, but they need to be parallel down to each switch. When I was wiring the matrix back into the microcontroller, I flipped the board over, but I didn't flip the schematic in my head correspondingly. So I wired the right side of the board into the pins for the left. Once I realized what had happened, I was able to adapt the firmware to the new layout without rewiring the matrix, but I felt pretty foolish.

z on the atreus


Typing prose on the board feels wonderful; it sits neatly in the lap with no fuss, and the keys are mostly reachable[3] without much stretching. Punctuation-heavy texts are still noticeably slower for me right now, which I'm sure is a mix of unfamiliarity and the heavy reliance on the fn key. I can't yet tell how much of the slowdown to attribute to each factor, but it will take a while to get up to full speed for non-letters. However, none of the punctuation needs both fn and shift, so it's not as drastic as it might sound at first. In fact, the parentheses, brackets, and curly braces can all be hit on the home row with fn, which is arguably more convenient for programmers than a conventional layout.

The top three rows contain letters in Dvorak layout plus a few bits of punctuation, with modifiers etc. on the last row.

   '     ,     .     p     y       ||       f     g     c     r    l
   a     o     e     u     i       ||       d     h     t     n    s
   ;     q     j     k     x       ||       b     m     w     v    z
  esc   tab  super shift bksp ctrl || alt space  fn     -     /  enter

The second layer is accessible with the fn key.

   !     @     {     }    |        ||      pgdn   7     8     9    *
   #     $     (     )    `        ||      pgup   4     5     6    +
   %     ^     [     ]    ~        ||       &     1     2     3    \
  L2  paste  super shift bksp ctrl ||  alt space fn     .     0    =

It does go more smoothly with a few behavioural adjustments. For one, I've started relying on the tab key less given its position on the lowest row under the ring finger. In a terminal, tab literally sends a ctrl-i keycode, so I've started to train myself to prefer that when coding. A few tweaks to my dotfiles allowed me to use the same approach for my browser. Enter is a bit further than I'd like, and Emacs lets you use ctrl-m instead, so I'm toying with that. I've also modified my window manager so I can change workspaces without using the number keys. But my usage patterns revolve almost entirely around Emacs and Conkeror, an Emacs-like browser with great support for rebinding keys on the fly. Some might have a more difficult time adapting, but on the other hand Vim users might actually have a better time given the reduced reliance upon modifiers.

I'm trying to ensure my steps are documented in detail so that others can replicate the design. The whole timeline for my build was about a week and a half from initial commit to working board[4], but much of that was spent waiting for staggered shipments to arrive. Probably the biggest open question around making it easy for others to replicate my work is that of access to a laser cutter. I'm fortunate to live in Seattle where there are three or four hackerspaces in town offering their services, but I'm not sure how difficult it is to get that sort of thing done elsewhere. For those that would need to order the case online, Ponoko seems to offer this, but it costs a fair bit more, and you can't just bring in your own materials.

Obviously there's no keyboard that's perfect for everyone. I still think the Ergodox may be a more balanced design, but this feels like the right set of trade-offs for a board that doesn't sit in one place. If anyone else tries their hand at putting one together I'd love to hear how it goes; it should be a lot of fun.

Update: a few other intrepid hackers have documented the process of building their own Atreus keyboards from my designs.

Update: I've also constructed a wooden variant that turned out nicely.

[1] The only thing I would change about the Ergodox is the fact that the thumb cluster is on the same plane as the rest of the board. It would fit human opposable thumbs better if it were angled down like this remarkable design, but that raises some pretty serious challenges in case and PCB design since you can no longer use layered acrylic with a single circuit board per side.

[2] The case measures 25x11cm. My build weighs 380g, though building it with acrylic layers of different thickness or even other materials entirely would change that.

[3] The exceptions being the bottom row keys that aren't under the thumbs. The outermost two on each side are a bit of a stretch for the ring and pinkies, and the next one in can be hit with the thumb, but not as conveniently as the other thumb keys.

[4] I documented my progress as I went on this GeekHack thread. I got a lot of good suggestions both from there and the #geekhack channel on freenode, so thanks to those good folks. More photos are on Flickr.

« older | 2014-02-26T08:13:51Z | newer »