Build your very own PC keyboard

I spend too many hours coding and my main interface with the PC is definitely the keyboard. I could probably live with a crappy mouse but never with a mediocre keyboard. This is how I went from standard commercially available keyboards to a completely customized home-made beauty.

Custom keyboardMy interest in keyboards actually began when I started developing pain to my fingers. Too many shorcuts and too many combos with the modifiers. I eventually entered the very dangerous world of Mechanical Keyboards.

I tried every mechanical keyboard and every key switch I could (there are more than you may think). It’s a very complicated and interesting world dominated by factions and feuds. Who likes clicky switches, who likes light switches, who stiff switches, who capacitive Topre switches, who argues that Topres are not actually mechanical, who soft-tactile but only if carefully lubricated (by hand, one by one), and so on and so forth.

It’s a never ending quest, trying to find the Perfect combination of materials, switches, springs, controllers and it brings you to one inevitable conclusion: there’s no spoon. The perfect keyboard does not exist. Hence, build your own!

It’s easier than you think, but it takes a lot of dedication and time. Money speaking a custom keyboard goes around $150 + the keycaps.

Layout and keycaps

Custom keyboardIf you want your very own keyboard you are probably going to have an unusual layout. Mine is compact, with arrow cluster and few but important differences from a “standard” keyboard.

So the first problem to solve is where to find the keycaps in such unusual shapes. There are quite a few companies that can make keycaps, one of the most notorious is Signature Plastics, they also sell directly through their online retail store, but you may not find exactly what you need.

The solution is to participate in one of the many Group Buys that the Mechanical Keyboards community organizes. Accidentally there’s one that is running right now and that would very likely cover all your custom keyboard needs. It is called Granite Set and I personally designed it.

Switches

Next pick your switches. There are so many that I should dedicate a full post to them. Let’s limit the selection to Cherry MX. Cherry is the manufacturer, they produce the most famous switches for mechanical keyboards. They have many varieties, I like the clicky one called Cherry MX Blue, but you may prefer the light linear one (Red) or the tactile (Brown). They can be easily found on electronics stores such as Mouser or Fernell.

Plate and Case

Q11X2oGNext you need a case and the plate where the switches will be housed. The easiest way is to laser cut various layers of acrylic or aluminum and screw them together to build up your keyboard case.

You need to design all the layers with a CAD software such as Autocad or DraftSight that is free and runs on Windows, Mac and Linux. Some laser cutter also takes SVG files from Illustrator or Inkscape for example.

Here to spare some bucks I did a mixed Acrylic+Aluminum case layout. From the picture you can see the bottom plate that is aluminum (and later insulated to prevent shorts) and the sides are brown acrylics. The top plate –where the switches are actually accommodated– is again aluminum, but stainless steel or even wood also work pretty well.

The PCB

vXuQzF2The switches can be connected to the controller on a PCB or you can also hand-wire them directly. It’s a long task but it’s not too difficult and spares you the hassle of designing the PCB.

I tried both methods and admittedly the PCB is a cleaner solution, but one of my first custom keyboards was hand wired and it works like a charm.

Of course we don’t have a controller that can listen to 100 (one per switch) inputs, so we use a matrix. The switches are connected together in rows and columns instead of directly to the controller. This way we use just about 20 inputs to drive all the switches. To do so we need to add diodes to each switch; yeah, that means even more soldering. You can take any variant of the 1N4148 diode.

The controller

custom keyboard, matrixNext the controller. The Teensy is a very small USB HID compatible controller based on ATMega chip. It’s very common for custom keyboards because a nice guy cooked an incredibly good keyboard firware for it. It is called TMK Keyboard and you can find it on github. You can also probably use any of the Adafruit‘s or Sparkfun‘s controllers or even Arduino.

All rows and columns of the switches matrix have to be connected to the controller. Then you can burn the firmware, close the keyboard and enjoy your custom creation!

Happy typing

This is not a step by step tutorial but I hope it helped wetting your appetite. I personally have very little skills in electronics and my experience with CAD is limited to “draw-a-line”, but I was able to build my own keyboard from the ground up, so if I can do it nothing stops you from doing the same.

Lastly, there are few very good communities dedicated to Mechanical Keyboards where you can find inspiration and ask for help. One is Deskthority another is Geekhack or you may prefer the /r/MechanicalKeyboards sub-reddit.

Let me know if you end up building your keyboard!

71 thoughts on “Build your very own PC keyboard”

  1. Where did you get the plate/case made? I am interested in doing something similar but am having trouble finding somewhere that will do custom orders like this.

  2. Hello, Great stuff you made!
    Btw how did you wire everything up together and properly?

  3. Question, is this in therory possible to get Cherry MX green, or more potent switches into a old ibm f or m 122 key keyboard? If so, that would make almost the perfect mashup of oldschool and newschool tech?

    1. why would you want to have a cherry switch replace one of the greatest switches ever made, the buckling spring?

  4. Hi!
    Love your keyboard!
    What if I asked you to do one for me? Would you be interested?
    Thanks,
    Luis

  5. For my senior project I want to mechanical keyboard. Can you post a link to all the sites you used to get your materials?

    1. Hi Halim.
      I am also working on mechanical keyboard project at the moment. I assume that perhaps we both come from the same country, just from your name. Perhaps we can share resources and information. Let me know how can I reach you. 🙂

  6. Hi Matteo, I was just wondering what your thoughts were on using supporting screws. I can see from the pictures that you have some in your design, but, do you feel that they are essential for keeping the board from flexing while typing?

    Also, now that your project is finished, is there anything that you would do differently? I’m also bouncing around the idea of building a keyboard, and I’d like your thoughts.

    Thanks! ^_^

    1. no you don’t need the supporting screws in the middle.

      At this point I made many keyboards, I believe a gap between the arrow cluster and the modifier is a nice addition.

  7. Just found this blog post at a perfect time… I’m looking into building my own keyboard very soon. Funny thing, I’ve actually found your thread on Deskthority (well, a couple threads, actually) regarding your build of the Brown Fox. Read through it, and then stumbled upon this page, and recognized the keyboard. That thing is exactly what I was going for, with a few color variations. This is so helpful, and exciting. Thanks for this post, and your threads on the forums!

  8. Hi,
    I find this really amazing and am planning taking a try at this on my own as well. I’m curious about the custom physical layout – does teensy board + the software support any kind of configuration in the physical matrix or does it expect a certain amount of keys in certain rows/columns? I’m considering a 6×15 straight non-staggered grid of 1×1 (small/regular) keys – not having a wide spacebar, huge enter key, etc.
    Thanks for your input (heh)!

  9. Hi,

    If I would want to build a mechanical keyboard with leds that only light up when that specific key is pressed how should I do this?

    Just swapping the diod’s with LED’s?

    Regards,
    Johan

      1. Hi, yeah i got that awnser aswell, right now im probably going to try to do that, and control them via the teensy 3.1 and have them in a matrix on PWM ports on the teensy.

      2. Why would switching the diode with an LED not work for turning on the LED of the individual switch?

        1. not sure I understand your question. A full 1:1 matrix of LED would probably require an additional controller and of course PWM since you don’t have enough power from the USB to light everything up

    1. If you were wanting only the button pressed to light up, you would have to have the output of the mechanical go into the input of the LED and then into the controller.

    2. no need for firmware! all it would require is a push to make switch, (the actual key itself) wire that to an LED and you’re away! you’d need a controlled power source however but i’m sure you could get that through the USB w/ a zener diode.

  10. I was wondering what the NKRO capabilities of such a keyboard would be. Also, what would be a good place to acquire a PCB for such a thing?

    1. Matteo – Outstanding work!

      Please try the anti-ghosting technique and post results here:
      http://www.mmo-champion.com/threads/1185198-Keyboard-anti-ghosting-(NKRO)-thread

      For example, I’m using:
      IBM Model M 122 key “Terminal” scan code set 3
      Part No: 1390572
      Date: 11NOV87
      Plt No: F3 Model M

      With SOARER’s coding on Teensy++.

      Sadly, there is a short in the board that I’m tracking down.

      Here’s the results of my “hybrid” keyboard (not as fancy as a DIY, but you have inspired me!)

      http://www.mmo-champion.com/threads/1185198-Keyboard-anti-ghosting-%28NKRO%29-thread?p=18740921&viewfull=1#post18740921

  11. Hi Matteo,

    I’m in the process of designing and ordering all the parts (custom aluminium/stainless steel plate, switches, Teensy, etc) and I have to say this post was my main inspiration.

    My design is actually pretty similar to yours (still deciding between acryllic and wood for the middle ) and I would like to know what’s the ideal space between upper and bottom plate and if there’s something you’d change from your design after these months of use.

    Thanks a lot!

    1. Where are you ordering your plate?
      My biggest issue is trying to find where I can get a custom cut sheet.

  12. I have been looking at your guide for a while now. I’ve decided I want a metal backplate, like yours, but when I use Ponoko, the starting prices for steel is $180? They charge by size of metal you cut on now. It says in your guide it should be around $150-200 total price? Is there an alternative website for metal cutting?

  13. Does the diode orientation matter? As in if the whole row is pointing to the left compared to yours which is pointing to the right

  14. You should, at the very least, provide your cad file or a link to one, or even a link to the spec files necessary to create your own, rather than just tell everyone to draw it up themselves. Do you think you’d be willing to do that? Otherwise, this doesn’t so much whet the appetite as say “yes, you can do this yourself, here are some pictures. Now good luck!”

  15. Working on a 10 keypad right now but stuck on the housing. I think I’d like to do a build up design like you’ve done but I’m curious as to how you screwed all the pieces together. Did you have holes pre-cut and then just throw a screw through them and put a nut at the other end? Or do the screws physically screw into the materials?

  16. Any advice on taking an old mechanical keyboard with no built in controller (Zenith Supersport 286!) and converting it to USB? I believe I could go the Teensy route and use the TMK firmware you mentioned but not sure if the matrix will work with that setup.

    1. every matrix works .. if you have a switchplate ( else they gonna be wobbling around) .. you just desolder the switches from the pcb and wire it up manualy, optionaly you could use “enablers” ( single switch pcb for prototyping) > there are plenty guides on the internet

      making a m kb is no rocket science ..
      its more like a endless quest for the perfect feel.

    2. Hey @Kevin — I am in the same situation as you, have a Zenith SuperSport and I’ve just ordered a Teensy 2.0 to build a custom controller for it. Did you figure out how to get it working with the Alps matrix on the SuperSport?

  17. is it posslible to have keys for macros, which you could change on the fly? like those gaming keyboards usually have..

  18. You said in a previous comment that it was not necessary for supports on your particular keyboard, which is metal. What about a 1.5 mm thick acrylic backplate? Would it be necessary then? And how did you attach the screws to the case without having the keys bump into the screw head when bottoming it out?

  19. looks awesome, id love one my self as a hardcore competitive lefthanded gamer and have tried following this guide but i get stuck on the design part, i don’t understand how those cad programs work seems like you need alot of training to use those programs since all free guides sucks, they never cover the things i need or are expecting me to know certain things about the program, you know of any companys/persons i can hire to make me a design?

  20. Does anyone encounter flexibility problem with a 1,5mm plate thick and no PCB for a full keyboard?

  21. Ciao Matteo, e complimenti per questa bella guida.
    Sono alle prese con il mio personalissimo progetto di custom keyboard, e volevo chiederti dei dettagli sul diametro delle viti e dei fori relativi.
    Ad occhio sono intorno ai 2 mm. Ci ho preso?
    La piattina è spessa 1,5 mm? Hai lasciato dei margini di padding sui bordi? In quale misura?
    Grazie e ciao. 🙂

  22. Does anyone know how to do a custom keybord but with an arduino ? I’m searching for it since 2 month ago, please help me :/

  23. Matteo–
    I am an activity specialist at an IFC/IID for individuals who are multi-handicapped. I have a very intelligent individual who has spastic quadriplegia and I am looking to have built for him a keyboard with keys that are about 4 inches square as the individual does not have the coordination to hit very small keys. Are the schematics available that I could give to some voc. ed. students here in the Cleveland area to build one to these specs? Blessings, Tom Gilbert

  24. HMMMM I Have wondered about going this route as well… my main thing is I want green switches… caps to CTRL windows lock key…. and get ready for it: WIRELESS… wonder if I could make that work?

  25. Hi matteo. I was just googling ‘How to make a keyboard with arduino’ and got here.
    So surprised to know that you were the writer, since I loved your whitefox keyboard, though I couldn’t afford one this time.

  26. Do the keys have to be in a keyboard housing? That is to say, is there a limit to the wiring lengths for each key switch? I’m trying to figure out if a project I’m blueprinting will work with a mechanical keyboard setup or if I’ll have to resort to pneumatics.

  27. I suspect you are way more geek than I need here but local pc mechanics say “Buy a new laptop” and I’m pretty sure the problem is in the kb controller and a software fix is possible. Problem: d & w keys go D & W with left shift key and caps lock but not with right shift key.

  28. I think about building a keyboard myself… It is only an idea in my mind right now, there is no plan or even research yet… I’ve been thinking of using a teensy (got a few around and I know it’s easy to code it to be seen as an HID keyboard)… indeed I first though of making a custom keyboard (just a few keys that would map to adobe premiere shortcuts, and a rotary encoder that would trigger keys as well, specifically for use in premiere)… then Ive ordered a cherry mx colors test keys, and now I WANT a cherry mx blue keyboard. Thing is, i can’t find any with Apple keys.

    Anyway. I ordered one anyway, but still ordered cherry mx switches as well.

    MY QUESTION NOW: none of the teensy has 100+ io… how do you connect all keys to one teensy? The good old resistances trick?

Leave a Reply

Your email address will not be published. Required fields are marked *