First choices
In the previous post we touched on the various choices available to us to build a custom keyboard. I’ve decided to first try with:
- Cherry MX Brown switches. They are the ones I use with my home and work keyboards and my favorite for typing. They can be readily bought from mechanicalkeyboards.com, and are available in plate-mounted or PCB-mounted flavors. Plate-mounted is especially interesting for us since we’re not planning to design a PCB yet.
- The Teensy++ development board. Its wide community support, simple tools for firmware upload, and the fact that the powerful and widely-used QMK firmware is compatible with it makes it a great candidate.
I had some keycaps left from a previous keyboard so I could start with a simple 9-key, 3×3 matrix prototype.
The key matrix
The first instinct one would have to assemble switches and the development board would be to connect each switch to the +5V pin and to one of the I/O pins of the board. However, keyboards can have more than 100 keys, and very few controllers have that number of pins. It simply would not be possible, especially with a Teensy.
The solution is to have the keys form a matrix, and have the controller activate columns (or rows) one by one, and read the rows (or columns) to know which keys are active. Here is a very good explanation of how to make a key matrix, what ghosting is and how to get rid of it.
For the diodes, the “classic” choice for keyboards are 1N4148, which can be found dirt-cheap on Amazon or online electronic stores (my favorite: Mouser.com).
The soldering
Since I do not yet have access to a laser cutter to experiment with the plate, I decided to test making the matrix itself, free hand. Let me tell you, without a support to hold the switches together, this was no easy feat.
Here is what the underside of a Cherry MX switch looks like. I started by preparing a ball of solder on all terminals of my 9 switches to facilitate soldering the diodes and columns on later.
And here’s how the diodes are arranged to form the rows. I feel like I will need to pre-bend them when I need to solder 100 of these.
And… first row done!
I don’t think I’ve ever soldered components pin-to-pin before, especially with loose components…
Times 3, here are my 3 rows:
Now for the columns, the wires will need to go over the rows, so they need to be insulated. I did not want to go through the trouble of cutting and stripping 9 wires, so I opted for this strategy:
Unfortunately, without the proper measurements, this is not an easy solution to work with. Some segments will be too short, others too long, the plastic insulation melts, etc. Multiply this by 2 for 6 rows, it’s a bit too complicated. I may have to be more precise the next time or just use a multitude of small  wires. Anyway, here’s the final product (please don’t be too harsh on the soldering job, I hadn’t done any in a while and this is not the easiest way to work with components. But I love challenges 🙂
And now we have a fully functional matrix.
And here’s what it looks like from the front. I’m quite happy with it, the diodes and wires keep the switches together in a solid piece.
The Teensy’s pins
When the Teensy++ 2.0 arrives without headers, this is what is looks like:
And to make it easy to prototype on a breadboard, I soldered wires to every pin on the sides:
Looks like a weird metallic spider…
Next up: working with the software, uploading it to the Teensy, and wiring the rows and columns accordingly.