Skip to content

Instantly share code, notes, and snippets.

@IanOfGit
Last active January 21, 2024 02:49
Show Gist options
  • Save IanOfGit/fb416d625906017c992cbd1b3726aada to your computer and use it in GitHub Desktop.
Save IanOfGit/fb416d625906017c992cbd1b3726aada to your computer and use it in GitHub Desktop.
How to Assemble a Custom Mechanical Keyboard

This is a detailed, but generalized guide to the assembly of a custom mechanical keyboard designed around the Cherry MX standard.

Authored by IanOfEarth with editorial input from the members of the Relay.FM Members-Only Discord Server Keyboards Channel: "The most exclusive keyboards community on the internet." - Jaicob, Co-Founder Mode Designs, 2022-06-11

Inspired by MattVortex, my love, my muse.

Pre-Build

Prepare Switches

  • Many modern switches, particularly linears, come pre-lubricated from the factory and do not need any further work done to them. However, if you have determined your switches do, this is the approximately correct order to perform the possible preperation steps in. Select which you choose to perform to taste.
    • Break-In
      • Many switches, particularly Cherry-made, will see some benefit in smoothness from being broken-in.
      • There are many machines that do this task, and many schools of thought behind method, here is mine:
        • Install dry switches in break-in machine, mine is a 4x4 from DingKey.
        • Perform ~100k cycles on-center.
        • Perform ~100k cycles off-center in each cardinal direction, for a total of ~400k off-center presses.
        • Perform a further ~100k on-center cycles, for a total of ~600k presses over-all.
      • More cycles can be better, but it can also be damaging. Therimingoat has many well written spec sheets for how different, popular switches react to various levels of break-in on their GitHub found here: https://github.com/ThereminGoat
      • If you do not have a break-in machine, it is not uncommon for people to install switches dry, use them for a while, and then take them out to lubricate them. (Thanks, Xi)
        • Note: This may not lead to a consisent break-in due to some letters appearing more frequently than others in most languages, but is a cheap and easy way to take the edge off very scratchy switches.
    • Spring Replacement
      • Many people like to replace the springs in their switches with something more to taste; Longer, shorter, lighter, heavier, etc.
      • This is easily done by:
        • Opening the switches.
        • Removing the stock spring.
        • Installing the new one.
      • If you are going to lubricate your switches, I would do all of this at the same time.
    • Lubrication
      • In general, this can be a very visual process, and there are lots of great tutorial on YouTube on this process. We will present the steps in text form here though:
        • For Linear switches:
          • Disassemble all of your switches with a switch opener, I like the Gateron one that looks like pliers. The Kiiboss one is also great. There are lots of different ones out there.
          • Place all the parts in bins with their like parts.
          • From here I do all these steps in batches of 50, as that is what my lubrication station holds, find what works best for you:
            • Place all of your springs in a baggie with some Krytox 105 oil or similar.
            • Shake the baggie for ~1-2 minutes to evenly spread oil to all the springs in the baggie.
            • Open the baggie, dump the springs out, and spread them on a paper towel to absorb excess oil.
            • Install your springs in to your bottom housings.
            • Lubricate the side rails and legs of your stems with Krytox 205g0 or similar, place the stem in the proper orientation on top of the springs sitting in your bottom housings.
            • Snap on the top housings of your switches.
              • If you are filming your switches now is the time.
          • Editorial Note: Many modern linears are smooth enough from the factory or pre-lubricated that all they need is their spring oiled and swapped if relevant to your tastes.
        • For Tactile switches (Thanks, Matt):
          • It is much more important with tactile switches to consider what lubricant you are using and which parts of the switch you are lubricating.
          • General wisdom says to use a thinner lubricant like Tribosis 3203/3204 and to only lube the rails of the stem and not legs that rub against the leaf as this can greatly diminish tactility of the switch.
          • It is also common to put a dab of lubricant on the back side of the leaf to reduce pinging in loud switches.
        • For Clicky switches:
          • Don't.

Prepare Stabilizers

  • Disassemble your stabilizers in their component parts, some stabilizers come already in their component form.
  • Optionally: Balance the stabilizer wires. This process is out of scope of this guide.
  • Lubricate the stem of your stabilizers with Krytox 205g0 or similar on all four sides.
  • Insert the stem in to one of the housings, attending to orientation of the stem relative to the housing.
  • Lubricate the short ends of the wires with Krytox XHT-BDZ or 205g0 or similar to taste, including approximately 3mm around the bend in the wire.
  • Insert the wire in to the inner hollow of the stabilizer stems through the front hole of the housing.
  • Clip the wire in to the small clips located just outside the front hole of the housing.
  • Repeat for the other end of the wire.

Take Inventory of Keycaps

  • Ensure your have all the keycaps you need to cover your keyboard in your desired layout.
  • There is no one standard way to do this, but most keycap sets will have what is called a "kitting image" where all of the keycaps in the box are in a single image. You can use this to cross reference an image of your board or cross reference with the layout image most keyboard also have availble.
  • Notably tricky configurations to check:
    • Bottom row layout.
    • Right Shift size.
    • Non-ANSI/International Layouts

Mise En Place

Equipment

  • Computer with relevant software installed:
    • VIA, Vial, etc.
  • Insulated Tweezers
  • Appropriate Screw Drivers (Many modern keyboard kits include the needed drivers.)
    • Hex sizes 1.5mm-3mm are common.
    • Philips Size #1 is common for stabilizers.
    • Torx is less common but also frequently seen.
  • Optional:
    • Plate Forks

Parts

  • Printed Circuit Board (PCB)
    • Technically optional, but if you're handwiring a keyboard you are massively out of scope of this guide.
    • Not always present, by commonly is, will be a daughterboard. This is a smaller circuit board about the size of a postage stamp or less that connects to the main PCB with a short cable.
    • NOTE: If your keyboard is "o-ring mount" hotswap is not advised. Some keyboards are hotswap and o-ring but have made specific design decisions to make this work and will be clear about it. (Thanks, Matt)
  • Stabilziers Prepared to Taste
    • Attend to the thickness of PCB they are specified for and the length of the wires, particularly the spacebar.
    • NOTE: Similar to the PCB warning, screw-in stabilizers are not advised for o-ring builds due to the height of the screw post. (Thanks, Matt)
  • Switch Plate
    • Technically optional, but plateless keyboards are always marketed clearly as such.
  • Switches Prepared to Taste
    • Ensure you have enough to completely populate the keyboard you are building plus a safety margin of ~3% extra. It is rare for MX switches to fail, but it is possible and if you are building a soldered board accidents happen.
  • Keyboard Chassis
    • This will take many forms. Reference the keyboard's build guide or packing list to ensure all parts and, importantly, screws/fasteners are present.
  • Keycaps
  • Optional:
    • PE Foam
    • Plate/PCB Foam

Build Process

PCB Prep

  1. Test PCB's functionality by:
    1. Connecting the PCB to a computer with software intalled capable of showing what keys are pressed (VIA, Vial, etc).
      • If your PCB has a daughterboard the connection is: Computer -> USB Cable -> Daughterboard -> Daughterboard Cable -> PCB
    2. Open the software.
    3. Touch a conductive object between each pair of contacts on the PCB. Commonly used is a set of tweezers, but a bent paper clip can also work.
    4. Once all contacts have been verified, disconnect the PCB from your computer.
  2. If applicable place a layer of PE foam on the PCB.
  3. If applicable install the plate stand offs to your PCB.
  4. Install your prepared stabilizers on to the PCB. These may screw or clip on depending on model.
    1. Take care to make sure the stabilizer housings are completely flush with the surface of the PCB or PE foam.
    2. Attend to the screws or attachment clips as well. The housing of the stabilizer should not wiggle relative to the PCB when correctly installed.
    3. Note that some keyboards use plate-mounted stabilizers that clip in to place. This is rare, but if it is the case for your keyboard wait until your plate is in-place before installing them.
  5. Important, this step is very hard to go back to:
    1. Before installing the plate:
      1. Place a switch in each placement where a stabilizer is present.
      2. Attach the appropriate keycap.
      3. Lightly, rapidly press the key to listen for ticking.
      4. Press the key normally to check for sluggishness.
      5. If your stabilizers require troubleshooting, perform it now.
      6. Once stabilizers are verified good, make sure to remove the keycaps.
  6. If applicable place down the plate/PCB foam.
  7. Attach the plate to the PCB. If you are building a plateless keyboard there is attention to detail required that is out of scope of this guide.
    1. Snap a switch in to the two most distantly placed 1u holes in your plate. These are typically the Esc key and right arrow key, however this does vary between board and layout.
    2. Fully seat these switches in to their corresponding placements on the PCB.
    3. If applicable screw the plate to the PCB.
    4. Continue installing switches until all placements are populated.
      1. Attend to switch orientation and placement, espcially in the bottom row there there is often multiple options.
      2. If you are not using plate foam and your plate is particularly flexible, plate forks are helpful to make the process easier.
        1. Plate forks are placed betweent the plate and PCB to fill the gap between them. This allows the latches on the switches to fully clip in to the plate. If you do not have plate forks, placing the switches in such a pattern that allows you to pull up on the plate using the surrounding holes until ~50% of the switches are in will also provide the support needed to the plate to ease the process.
    5. If building a hotswap keyboard continue to the next step, if building a solder keyboard follow these sub-steps:
      1. Solder the two metal contacts of each switch in to place.
      2. If you are not using 5-pin/PCB mount switches pay careful attention to the alignment of the switches. Best practice is to:
        1. Solder one contact to the PCB.
        2. Visually assess the alignment of the switch.
        3. If correction is needed, torque the switch in the correcting direction with one hand.
        4. With the other hand solder the other metal contact in to place.
        5. Visually reassess the alignment of the switch.
        6. If correction is still needed, torque the switch int he correction direction with one hand.
        7. Heat one of the metal contects with your soldering iron in the other hand, and let cool.
  8. Re-connect the PCB to your computer and test each switch to verify all solder joints and switches are working as expected. Disconnect the PCB.
  9. Once all switches are seated (if needed soldered and aligned) and verified functional you are done preparing the PCB.

Assembly

Many keyboards either come with a build guide, or more commonly have one avaible online. It is best to follow this as from here these instructions will be very general as there is so much variety in how different keyboards are assembled.

  1. If not already present, install the feet on your keyboard's chassis.
  2. Separate the parts of the chassis.
  3. Install the Plate/PCB assembly created in the previous section to the relevant part of the chassis. This will vary greatly depending on mounting style. Some do not directly mount at all.
  4. If applicable install the daughter board and cable.
  5. Reassemble keyboard chassis with Plate/PCB assembly inside.
    1. If your build uses a daughterboard, attend to the cable to make sure it is not pinched or under tension. Many builds with daughtboards have a small channel or pocket for it to sit in.
  6. Re-connect your keyboard to your computer and once again test the switches.
  7. Re-install the stabilized keycaps and once again test your stabilizers.
  8. Install the remaining keycaps.
  9. Enjoy your keyboard.

Post-Build

  • Tune Stabilizers
    • Stabilizers, particularly lubricated ones, will often change in sound and feel over the first two weeks of use.
    • If your stabilizers do not sound or feel as you would like them to there are a few common things that can be done depending on the undesireable condition:
      • Stabilizers develop a ticking sound:
        • Using a small syringe inject a small amount of lubricant in to the inner hollow of the offending stabilizer stem. A little bit goes a long way.
      • Stabilizers become sluggish:
        • Remove keycap and verify housing has not come loose. If it has:
          • Disassemble chassis.
          • Remedy by tightening screw or verifying housing is appropriately clipped in.
        • Stabilizer issues can often require a full teardown of the board, this is why testing early and often is so important.
  • Replace Substandard Switches
    • You may discover after completing and using your build that some switches do not feel or sound like the others, or develop issues like missed strokes or double-strokes.
      • If Solder:
        • Disassemble the chassis, desolder the switch, and replace with a new one.
      • If Hotswap:
        • Disassemble the chassis, inspect the leafs of the hotswap socket:
          • If leafs are making good contact with switch contacts, replace switch.
          • If leafs are not making good contact with switch contacts, gently pinch leafs together with tweezers, test again.
  • Common Tweaks
    • There are a few common mods performed to keyboards to modify characteristics that may be undesirable.
      • Keyboard sounds exceptionally metallic during use:
        • Ensure chassis fasteners are not loose, most metallic pinging is caused by metal parts resonating together.
        • If screws are all tight, the Force Break mod may be of interest:
          • Disassemble chassis.
          • Where the metal parts of the chassis touch, particularly near where the screw points are, place small, double-thick pieces of masking/painters tape.
          • Reassemble the chassis.
        • These piece of tape create small breaks in the metal on metal contact that will give the chassis places to disperse the energy of your typing.
      • Keyboard sounds exceptionally hollow or boxy:
        • Open the chassis of the board and if there is space between the PCB and bottom housing of the keyboard install thin layers of foam or a small amount of polyfill to take up the space.
        • This is certainly a matter of taste and may take some tuning.
        • If your keyboard is particularly flexy or bouncy this may change how that manifests.
@XiXora
Copy link

XiXora commented Jul 7, 2023

re: break-in, some people install switches, use them for a few months and then uninstall and do the lubing etc

@mzsnelling
Copy link

mzsnelling commented Jul 7, 2023

  • For the lubrication section, it might be worth speaking in general terms about the parts of the switch that can be lubricated (eg stem faces, legs, leaf front, leaf back, pole, hole, top), then provide some recommendations for different kinds of switches
  • Recommended lubes for different kinds of switches too
  • Something has happened with the formatting of section 7 of the PCB prep section, maybe Github isn't happy that the numbering starts with 2 after "Continue installing switches until all placements are populated."
  • In the Parts section, and the PCB prep section (including the testing part), probably best to mention daughterboards for boards that have one

@JasDhaliwal
Copy link

👏 I wish you had signed off with, "this was written on x board, using x switches" for all the nerds who read everything

@IanOfGit
Copy link
Author

re: break-in, some people install switches, use them for a few months and then uninstall and do the lubing etc

Added!

@IanOfGit
Copy link
Author

  • For the lubrication section, it might be worth speaking in general terms about the parts of the switch that can be lubricated (eg stem faces, legs, leaf front, leaf back, pole, hole, top), then provide some recommendations for different kinds of switches
  • Recommended lubes for different kinds of switches too
  • Something has happened with the formatting of section 7 of the PCB prep section, maybe Github isn't happy that the numbering starts with 2 after "Continue installing switches until all placements are populated."
  • In the Parts section, and the PCB prep section (including the testing part), probably best to mention daughterboards for boards that have one

Fixed all of these! Thanks!

@IanOfGit
Copy link
Author

👏 I wish you had signed off with, "this was written on x board, using x switches" for all the nerds who read everything

Damn, now I wish I had too.

@mzsnelling
Copy link

Add a note that gummy o-ring mounted keyboard probably shouldn't be hotswap, and should use clip-in stabs because the screw posts can get in the way of the o-ring

@IanOfGit
Copy link
Author

Add a note that gummy o-ring mounted keyboard probably shouldn't be hotswap, and should use clip-in stabs because the screw posts can get in the way of the o-ring

Done, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment