If you want to know why I am doing this, read my previous post. I stated there, that I decided to create my own keyboard, that would meet my own special requirements. I used to work as a requirements engineer a while a go, so I realized I had to come to a clear understanding of the “problem domain”. I really had no idea where that would lead me. I began researching. The first question that needed an answer was: how does a normal keyboard usually work? The Wikipedia article on keyboard technology gives a quite good summary. There were other resources – I don’t remember all of them – but I can recommend this in depth discussion about mechanical key switches.
I had a starting point: I needed to decide witch type of key switches (or key modules) I would like to use. Nowadays you often see Cherry MX mechanical switches in high end gaming keyboards as well as the Kinesis. But those are “huge” (at least for me) standard keys that I absolutely don’t like. But Cherry also has a flat mechanical key switch: the Cherry ML. It is a little more expensive and shouldn’t last as long as the MX key switch. Nevertheless I ordered 100 of them for a price of 90¢ each. Phew, a lot of money gone. Luckily those key switches were the most expensive parts I needed. The second most expensive part were the Arduino Unos, I needed one for each side, but thats the content of a later post.
Back to the ML key switches. They do have a very special “foot print”. Nothing that would fit without drilling holes of different sizes on any prototyping board I found. At this point I had no idea, how to solve this problem. I decided to postpone a solution to this problem until I had the key switches in my hand. Another problem were the keycaps. I couldn’t find any retailer with acceptable conditions to deliver as few as around 100 pieces to Germany. Moreover it was unclear how I would mount and arrange the keys: how big should the key caps be? It became clearer and clearer that it would be impossible to make a detailed plan. There were simply so many unknowns and a quite restricted budget that I couldn’t afford to many trials. Buying expensive tools and order self designed PCBs – I’m no electronics expert, so I didn’t felt able to design the circuit upfront – from Fritzing Fab or similar was no option either. I decided on a rough concept and took a more incremental approach.
The cornerstones were:
- Use two Arduino Unos one for each side, I didn’t even check in depth if it was technically possible to create a keyboard with them, but as it turned out it was indeed possible.
- Be wireless, to circumvent crawling on the floor every time I had to connect the keyboard to my computer.
- Communicate by Bluetooth with the host. I stumbled upon the BlueSmirf HID. That seemed a nice fit.
- Avoid a hardware driver at all cost (I use Linux, Mac and Windows and writing keyboard drivers for each operating system was no option for me). Use a standard key layout on the host machine and map key presses to NEO2 on the fly (with the Arduino). So I don’t have to install anything.
- The left side will send key presses by simple RF communication to the right side and the right will pick up those and send the whole keyboard state to the computer.
- The case and the key caps should be made of wood. It is easy to work with it compared to plastic or metal. And I already had the basic parts and tools, at least I thought at that time.
- Each part is powered independently with a LiPo battery and charged via USB. I had no idea how high the capacity of a battery should be.
- Use things you already have and be pragmatic.
As the key switches arrived and I understood which pins are relevant (on one side there are three – all connected to each other – and on the other side is only one) and how the switches as a hole are working I had an idea how to mount them. I took a TriPad stripboard and cut it in stripes of a few holes width. The top three pins were mounted in the lower holes of one stripe and the lower pin in the upper holes of another stripe. So the switch hangs a little in open air. But I was able to circumvent drilling holes for the switches and with a few extra supporting wooden slats it should be stable enough. This design was the reason for some headache later: the distance between the holes in the stripboard doesn’t meet exactly the distance of the pins from the key switches. And I learned that mechanical key switches sometimes are somewhat intolerant regarding tension on the connecting pins. So in the end I had to drill a few holes to release the tension on some keys.
After calculating a reasonable distance – so that in the end I would have keys the size of around 2 x 1.8cm – between the keys switches, I decided how many holes high the stripboard stripes should be and how many holes away the key switches should be positioned. In regular distances I glued supporting slats to the stripboard stripes. What else is needed to get a keyboard matrix working, what the overall key layout would be and how to poll the matrix with Arduino will be the topic of a next post.