Building a custom keyboard

2020/01/01

Long time dream

My journey to this keyboard began with a birthday gift. I had got a Microsoft Sculpt Comfort keyboard and finally learned the proper 10 finger typing method. Then I got into spacemacs and fell in love with the idea of using Spacebar as a leader key. And as a newly adopted emacs user I began using Ctrl and Alt heavily. Reaching for Ctrl required unnatural wrist movement and I got to know that the solution is to remap Caps as Ctrl. I was using this hack for a while until I learned a better idea - to remap LCtrl with LAlt. That’s when I started looking for the keyboards with a shorter Spacebar, so that LCtrl would be easily reachable by the left thumb. Eventually I stumbled upon a world of DIY keyboards and started dreaming about Ergodox. It was too pricey and the layout was not that good, so I decided to build my own keeb. I had a rough understanding of what I was aiming for - a handwired split keyboard with an orthogonal layout and a thumb cluster. I started ordering the parts - switches and caps. When the switches were delivered, I started to design a layout for my keyboard which fits my hands perfectly.

Table 1: Bill of Materials
Name Qty Price, $
Diodes 1n4148 100 0.78
Keys Gateron Brown 50 21.00
Keys Gateron Red 10
Keys Gateron Other 5
Keycaps PBT DSA 65 17.90
Atmega32u4 1 2.88
Atmega32u4 1 3.22
Wires 1 set 2.2
3.5mm plug 2 0.9
3.5mm cable 1 1.58
encoder 5 1.78
knob 10 1.40
petg filament 1kg 1 30
petg leftover -24
soldering paste 1 2.29
soldering wire 100g 1 11
soldering wire left -10
tent screws 8
plastidip 1
tent fixing nuts 4
tent nuts M5 4
total 62.93

Designing the layout

I took a sheet of cardboard and draped it with a masking tape, so that the glue side was up. Then I placed my relaxed wrist on the board and marked where the fingertips are. These points defined the home row of the layout. Then I attached caps at the marked points and formed columns by putting one cap above and two below the home row. Last part was to figure out thumb cluster position, which I did by trial and error. Masking tape made it easy to twiddle with the layout, as the caps held firmly but could be easily removed.

Figure 1: Layout

Figure 1: Layout

Figure 2: Cardboard prototype v1

Figure 2: Cardboard prototype v1

Figure 3: Cardboard prototype v2

Figure 3: Cardboard prototype v2

Desiging the case

When the layout had been decided and I measured it accurately and designed it in OpenSCAD. Essentially all I did was that after I’d defined all the keys/controller/jack connector/legs positions and sizes, I calculated a sort of convex hull around all those. The resulting 2d shape was extruded, hollowed and all the required holes were made.

Making the case

I had two options. In the beginning I was sure that I’d just order a PCB and would use it as a frame. But as I have shared my plans with a friend, he offered to do a 3d-print for me, given that I’ll provide the plastic.

Before doing the actual print, I decided to make a test print. I designed a small plate with 4 keyholes of slightly different size. After the print I chose the best-fitting one and adjusted the main OpenSCAD model.

Wiring

Soldering was pretty straightforward and given the TS100 iron it was just a joy to do.

IMG_20200903_161421.jpg]]

Firmware

QMK has extensive documentation and a detailed tutorial specifically for the hand-wired keyboards. I just followed it and in fact all I had to do was just to define controller pins configuration and assign layout to the keys. Then I did qmk compile && qmk flash and my keyboard came to life.