Step 1: Stumble upon mechanical keyboards. Fall in love with them. Find out that Raspberry Pi 2 is released. Get an idea. Build a computer inside a keyboard.

Step 2: Google around the Internet, someone has done something quite similar. “Idea is validated”, as we say at my workplace.

Step 3: ???

Step 4: Profit! Not really. But that’s how the story begins.

So, I got an idea to build a computer inside a mechanical keyboard. After doing some research about mechanical keyboards and the new power of the Raspberry Pi 2 Model B, I decided that it would be a nice project for me to build. Okay then.

First phase: Gathering components

Raspberry Pi

The Raspberry Pi 2 was the easiest part to get. We already had ordered a couple of them with my friend Tomi. Next step: The keyboard.

Keyboard

I have been interested about mechanical keyboards (you know, those oldschool clicky ones) since I was a kid – heck, we used those regularly back in the day. The clicking noise has burned into my memory, and I just loved the tactile feel of those buttons. Nowadays my everyday keyboard is the integrated one on a Macbook Pro. It’s not bad for a laptop keyboard, so I really haven’t had any excuse to buy a mechanical one to carry around with my Mac.

That’s related to how the idea was born. I needed to have an excuse to buy one of those marvellous keyboards, and to find some use for the new Pi. Combine those two things together, and, well… you know.

What keyboard should I pick then? I have two main attributes I look for: The keyboard should be relatively compact, and it should have a familiar layout. I decided to go with a tenkeyless keyboard since I use the tenkeys rarely, and I want to have a small keyboard. I also wanted they keyboard to have a Finnish/Swedish layout. So after a bit of googling, I found a Filco Majestouch-2 Tenkeyless keyboard with Finnish layout and brown switches (Brown switches do not make so much noise, but still have the same feel as the old clicky ones).

Next step was to find out if there was enough space inside the keyboard to fit the Pi. I don’t naturally have that keyboard, so I asked Reddit. Reddit has an active community of mechanical keyboard enthusiasts, so I got my response quickly, with images! You can always trust the Hive Mind of Reddit. It seemed that there is only 8mm clearance inside the keyboard, which would be a too tight fit, I thought. It could be done by stripping off almost all of the connectors, but I would rather not sacrifice the ethernet port. So, let’s find another keyboard instead!

I came across the wonderful company WASD Keyboards, which also sold a similar keyboard, WASD V2 88-Key. It looked like it would have more space available. I contacted the customer care, told them about my project and asked some measurements. They responded very fast, told me that there is enough space for some AA-batteries at least, and that there should be enough space for the RasPi. The guy was even interested about hearing more about my project! Only problem was that there is a cable channel which can cause some trouble fitting the Pi, but I figured it can be removed and filled, if the Pi doesn’t fit. We’ll figure something out. I had found my keyboard!

Planning

Because I will be buying a great keyboard, I want to be able to use it as a regular keyboard too. I decided to implement a mode changing switch, for the keyboard to have two modes:

Mode 1 – “KB-mode” will make the keyboard work as a regular keyboard, so that the Pi will not be connected in any way.

will make the keyboard work as a regular keyboard, so that the Pi will not be connected in any way. Mode 2 – “Pi-mode” will input power the Pi with the keyboard’s usb cord, while the keyboard itself will be connected to the usb port of the Pi.

These modes will give me the total freedom to choose how to use the keyboard. Here are the basic schematics I whipped up how to connect the whole mess:

Luckily I got my old friend Ville, an electrical engineer, to check these out. We both think that it should work, if the Pi’s usb ports are “dead” when powered off. I have to test this out. [EDIT: They are not. This wiring does not work. Tested.]

About ports

I decided that two usb ports in the back of the keyboard is enough, because I plan to hardwire a small WiFi dongle inside the keyboard and use one of the four usb connectors for that. I will wire the dongle directly on the board to save space. Second usb port will be used to connect the keyboard in Pi-mode.

I would like to keep the ethernet port, if at all possible, because there’s not WiFi in every place. Gives me more opportunities to hack, too. I may have to rip out or move some components for the Pi to fit in the keyboard.

To be continued…

So, I still have to actually buy the keyboard and see what I need to do with the Pi for it to fit, but I have finally found all the parts I need. Now it’s just making the thing :) Stay tuned for more.

Useful links: