Like many others, I started looking into better keyboards when my fingers and wrists got tingling and stiff after a full day of programming. I learned about RSI and bought ergonomic keyboards like Microsoft Sculpt and Kinesis Freestyle. The keyboards do help but they still have some issues. One day at work, I experienced a pain in the base joint of my left index finger so I paid attention to its movement. The next time when I felt the pain, the finger was bending left to reach the R key while other fingers were resting on the home row. It was a poor typing technique but I didn’t need to do that if the R key was positioned straight above. Then I knew what I needed was the so-called ortholinear layout.
After sketching some radical layouts on paper/screen, I decided not to deviate too much from what I’m used to. The layout below is basically ortholinearized Freestyle, with two columns of shortcut keys removed from the left split. The shortcut keys can be convenient sometimes but more often they are in the way of my left-handed mousing. Curved Frames
Initially I wasn’t sure that I would like a curved keyboard, so I built a prototype with Bananagrams. Each Bananagram tile happens to be 19x19mm2, perfectly matching the 19mm key distance. The tiles are glued to a piece of paper at the back. When flipped over, the right split becomes the left split and it can be bent in many ways.
I tried a thumb cluster and didn’t like the feel of it, because my thumbs are not as flexible as other fingers. One thumb can handle at most three keys in my test. Besides, a thumb cluster complicates the design when the keys need to be rotated for better reach.
Eventually I settled on a simple design: no curved columns. The keycaps I got are sculpted so they will provide some curved feel for columns. Curved rows are divided into three sections: two columns for the thumb and index finger, one column for middle finger, and four columns for the ring and pinky fingers. (The extra two columns of the right split are for all fingers after a major elbow movement.) The angular difference between neighboring sections is 10 degrees. The frames are 12mm thick and the wiring holes are 6mm in diameter, permitting up to six 22AWG wires to go through. In the actual build, I ended up needing just four wires through some holes in the bottom row of the right split, after some effort of distributing wires to other rows.
3D printers cannot print hangover structures without supports, so I cut each split into three pieces and printed them separately. The left split took seven hours and the right split nearly nine hours, roughly one hour per column. The three pieces are connected by two thin pieces, which are inserted into wiring holes and super-glued to the top and bottom sides of the frame, as shown below. My 3D printer came with two spools of filament of random colors, red and white. I originally planned to have red for the left split and white for the right. Later I found out that the middle pieces of the splits were interchangeable, so I swapped them to make each split a little more inviting to the eyes.
There are holes for stabilizers beside 2x1 and 1x2 keys but I ended up leaving them empty. The keys are already very easy to press without stabilizers and I don’t want to make wiring harder with stabilizers in the way.
On my first prototype, I found that keys would get stuck on each other because 19mm of key distance is not enough to clear raised keycaps on a curved frame. The picture below shows the failure. Since then I’ve added keycaps in 3D modeling and made sure that they were sufficiently spaced out.
Controller and Firmware
For the controller, I highly recommend Teensy 3.2. PJRC has done a great job of integrating Teensy into Arduino IDE, i.e. Teensyduino. Writing and testing code for Teensy 3.2 was a breeze in Teensyduino. On my commute, I learned serial, keyboard and mouse programming from tutorials on the PJRC website and examples that come with Teensyduino. Then in a weekend, I developed my own firmware and tested it on a 2x2 keyboard. The firmware may not be as feature-rich as TMK, but it works for me and it’s a lot of fun to write.
Below is a picture of the initial test setup. Nothing was soldered. I dreamt of building a full keyboard without soldering at all. However, since then, I have given up on the idea, for even the 2x2 was too unreliable. It would be no fun typing on a keyboard that kept dropping keystrokes. Here is a snippet of the firmware defining the left split. It is straightforward to support a full keyboard or a different layout.
Code: Select all
constexpr int R = 6, C = 7;
const int row_pins[R] = { 1, 0, 2, 7, 9, 22 };
const int col_pins[C] = { 3, 8, 19, 23, 18, 20, 21 };
Layer<R,C> layers[] = {
{ "qwerty", l0, l1,
{
{ cap, prt, f1, f2, f3, f4, f5 },
{'\\', '`', '1', '2', '3', '4', '5' },
{ esc,'\'', 'q', 'w', 'e', 'r', 't' },
{ tab, 0, 'a', 's', 'd', 'f', 'g' },
{ lsh, 0, 'z', 'x', 'c', 'v', 'b' },
{ lgu, fn, lct, 0, lal, bks, 0 },
}
},
{ "qwerty-fn", l1, l1,
{
{ l0, l2, f1, f2, f3, f4, f5 },
{'\\', '`', '1', '2', '3', '4', '5' },
{ esc,'\'', 'q', 'w', 'e', 'r', 't' },
{ tab, 0, 'a', 's', 'd', 'f', 'g' },
{ lsh, 0, 'z', 'x', 'c', 'v', 'b' },
{ lgu, fn, lct, 0, lal, bks, 0 },
}
},
};
According to the stats, it seems possible to run the firmware on Teensy LC since it has 62KB of flash and 8KB of RAM. Maybe I will try LC to reduce the cost of my next build.Sketch uses 21,996 bytes (8%) of program storage space. Maximum is 262,144 bytes.
Global variables use 6,576 bytes (10%) of dynamic memory, leaving 58,960 bytes for local variables. Maximum is 65,536 bytes.
The Wiring
Wiring turned out to be the most labor-intensive part of the build. I started with the right split, which is bigger with six rows and nine columns. It took me about twelve hours to finish in a span of four nights. Soldering is not exactly my forte, and working in a tight 14x14mm2 space with shaky hands certainly made it worse. Often the iron touched the plastic walls and burned black spots on them. Soldering points kept coming loose due to wires being pulled or bent as well.
Eventually I got better at it. The left split, which has six rows and seven columns, took me six hours in a weekend to complete. Below are the pictures of the left split before and after wiring. The grid forces the wires to be cleanly laid out but it makes wiring harder too. Maybe I will make it more open for the next design.
It turns out to be quite hard to connect the two splits into a single logical piece. I thought about running 13 wires from the left split to the right, but that would look ugly. Besides, I don’t really have much space to work with under a split. I had to settle with two Teensys. That way, each split can be programmed and used independently. The downside to this is that the Fn key only works within a split. I think my next design will have an empty row at the top of the frame for housing Teensy and running wires to it.
Look and Feel The keyboard is not yet finished but it’s fully functional. As a matter of fact, this article was produced on the new keyboard entirely. The splits are currently supported by Lego pieces so weight doesn’t fall on the Teensys. Later I will print a housing for the Teensy, which also supports the keyboard. To prevent the splits from moving around while I’m typing, I applied the best high-tech solution I had access to, rubber bands. I assume this can be easily fixed by gluing a few rubber feet to the bottom of the frame.
The left split is still missing a few 2x1 keycaps so it looks a bit weird. I need to be careful not to jam my pinky in the wide gaps. The right split looks decent and feels right to type on. I will probably just buy another set of blank keycaps and mirror the same keycaps from the right to the left.
Gateron Red switches are really easy on my fingers so I’m extremely happy with my choice. The ortholinear layout takes some time getting used to. At the beginning, I kept messing up on ‘m’ and ‘n’ but now I’m as good as on any other keyboard. I really like having backspace on my left thumb because it’s much easier to correct mistakes. The split and the tent keep my wrists straight and in natural positions, so in the long run, I hope this keyboard will help relieve my RSI symptoms.
Cost Rundown
Here is a rundown of things that I purchased during the course.
- FlashForge Creator Pro: $900
- 3D print removal tool: $10
- 2 Teensy 3.2: $50
- 100 Diodes: $5
- 100 Gateron Red switches: $43
- 120 PBT blank keycaps: $40
- 6-color 22AWG hookup wires: $20
After all, one-of-a-kind keyboard just for me: priceless!
Acknowledgment
I have learned a great deal from others who ventured into the fun world of custom keyboards before me. Frequently I found myself going back to these sites when I was stuck.
- How keyboard matrix works: http://www.dribin.org/dave/keyboard/one_html/
- PCB mounted split keyboard by wyager: http://yager.io/keyboard/keyboard.html
- Brownfox by matt3o: workshop-f7/brownfox-step-by-step-t6050.html
- Custom mechanical keyboard by topoly: workshop-f7/custom-mechanical-keyboard-build-t9146.html
- 3D printed Dactyl keyboard by Matt Adereth: http://www.3ders.org/articles/20160223- ... azing.html
- Teensyduino at PJRC: http://www.pjrc.com/teensy/teensyduino.html