The first mechanical keyboard I bought was the Das Keyboard 4 Ultimate. I made the leap from regular rubber dome keyboards during my first summer in college after trying out some of my friends’ keyboards and decided I liked the Das 4. I thought the $130 I paid then was already pretty high, but I was in for a shock when I saw the keyboards which had two halves, one for each hand. They claimed to be ergonomic, and must have been hard to manufacture as well given the 3D shape the circuit board had to accomodate! Nevertheless, $300+ keyboards were not for my taste and I decided to make my own.

How does a keyboard work?

Let us start with the basic switch. A keyboard consists of a number of keys, 101 in standard keyboards. Each key has a switch underneath which detects when you depress the key. Most of the cheap keyboards today use rubber dome switches, which look like this when you take the keycap off.

an image of rubber dome

You can see how the black conductor under the rubber domes will contact the black conductor fingers on the circuit when the domes are depressed.

There are also other kinds of switches, most notably the Cherry mechanical switches. If you’ve heard of MX Blue or MX Brown, these are the ones. Mechanical switches are larger and more complex but provide better feedback when depressing keys.

WIP image here.

So there’s 101 of these switches. Add a microcontroller so the keyboard can communicate over USB. But each switch can’t be individually connected to the the microcontroller (most microcontrollers have less than 50 pins, and the ones that have >100 pins are super expensive and are loaded with other stuff).

thinking image

One solution is to use a matrix. Switches are connected to rows and columns, and each row or column is scanned one by one to see which keys are depressed or not.

WIP put some matrix image here.

One issue with using matrices is the ghosting problem. Ghosting is when keys show up as being pressed even though they were not, due to the physics of the matrix.

circuit image of matrix

The green keys here are depressed. Say we scan the first row, and the columns are being read.

matrix normal operation

So the first row was scanned, current is running through the second column, so it looks like the switch in the first row second column was pressed, which is what is expected! But here’s what else could happen.

matrix ghosting issue

Current can also flow backwards through the row to get to the first column, so it looks like the key in the first row and first column is being pressed! This is the root of the ghosting problem. Current flows backwards through a path where it shouldn’t be able to.

The ultimate fix is to have a diode with every switch to prevent any backwards current.

ghosting issue fix

And now things are working as intended. With this in mind, I set on designing my own keyboard.

What I wanted to build

A sub-$300 split keyboard with Cherry mechanical switches. Would be ergonomic for my hands, with a USB hub to connect peripherals.

Designing the board

I used Altium Designer to design both halves of my split keyboard. The two halves would be mirrors of each other, with the left side also having a USB hub. I used the ATMega32u4 microcontroller, which has built-in USB support.

Here is an image of the left side. left pcb render

And an image of the right side. right pcb render

Of course, one does not simply type on a bare PCB. I needed to design a case. After a few hours in front of Solidworks, I ended up with this.

left case bottom render left case top render

The two halves would sandwich the PCB in the middle, with the switches and keycaps popping through the holes in the top half.

Making it a reality

WIP