2022-07-30

DIY Mechanical Keyboard

 Greetings friends,

Early in 2021, I decided it would be fun to design and build a mechanical keyboard. My goals for this project were primarily to learn more about circuitry and get some practice soldering small components. In the process of building the keyboard, I ended up designing my own circuit board and doing a lot of the work from scratch. Luckily there were a lot of resources available online that I used to make some of these steps easier. I'll link these resources where I can! I will also provide the relevant files for this project at the end of this post in case anyone wants to recreate it.

I started by deciding on the keyboard layout I wanted. I knew I wanted to use the German QWERTZ layout, but still keep it compact and portable. I used an online layout editor to play around with different layouts, and eventually decided on this layout:

With the layout decided, I created CAD files for the switch mounting plates for building the case, and ordered them from Laserboost, opting for stainless steel with a tumbled finish. This style of assembling the keyboard is called a "sandwich", because it consists of several layers stacked together to make the body of the keyboard.

While waiting for the plates to be produced and ship, I got to work designing the circuit board for the keyboard. I familiarized myself with KiCad, a free software suite that allows one to design circuits, and assists in converting schematics to circuit boards. While easy to get the hang of, this software seems to have an enormous amount of features, and I won't be going into great detail on the process of designing the schematics or PCB, but the main resources I followed to do this can be found here and here. To keep the wiring description short, here is the keyboard layout again, this time with lines drawn representing the rows and columns that were wired together in the circuit.

I used a small arduino called Teensyduino as the controller. It allows the keys to be programmed easily using third-party software. This was a great option for me since I'm not big into programming and wanted to finish this without having to learn any. I added some mounting holes into the PCB for the controller, and ordered 5 boards from JLCPCB. The minimum order was 5 boards, but not too bad given that they were only a few dollars each.

With all the design aspects complete and the plated and PCBs ordered, it was time to select switches and keys. I only had a few options as far as keys for the German layout, so I decided on a simple off-white/beige key, mixing with keys from another set in a dark blue. The combo ended up looking very nice. I somewhat arbitrarily ordered Cherry MX White switches, based on reviews for their nice sound and firm feel.



The completed circuit boards looked very nice, and as you see in the picture above, have all the holes for the switches pre-drilled so everything fit right into place. The top plate came out looking amazing too! This the the top piece of the sandwich, and an identical piece without the switch slots is the bottom piece. The switches press-fit into the slots on the top plate, and the PCB slides onto the solder tabs on the back of the switches, which are then soldered into place from the back side of the board. A single diode is soldered to the PCB for each key as well.

Switches in place, but these blue keys are not the ones used in the final product..

Once all the components were soldered into place, the keyboard was essentially finished, just needed to be programmed. I used the software Teensy to flash the HEX file (the file that tells the controller the layout) to the controller, and I was done! At this point the keyboard was functional and ready to use!


I decided to finish a few more details to complete the look of the keyboard, primarily closing the sides of the sandwich so none of the internal components would be exposed. I had some extra scraps of walnut from a woodworking project, so I decided that would be a nice accent around the sides of the keyboard. The keyboard connects to a computer via USB, so I cut a small notch in the walnut to accommodate the connector.

Finished, with walnut trim!


Thanks for reading,

Juju



My files:

DXF files for top plate and bottom plate

PCB Gerber Files

HEX File for Teensy


No comments:

Post a Comment