Handwiring Mechanical Keyboard Switches: A Comprehensive Guide

Handwiring a mechanical keyboard might seem daunting, but it’s a rewarding project that allows for complete customization and a deeper understanding of how keyboards function. This guide provides a refined, step-by-step method for handwiring your own mechanical keyboard, ensuring a robust, clean, and user-friendly build. Whether you’re a seasoned DIY enthusiast or a newcomer to the world of custom keyboards, this Switch Wiring Guide will walk you through the process, enhancing your keyboard building skills and knowledge.

Before diving in, for those seeking more in-depth knowledge on design considerations and material choices, refer to this comprehensive addendum on design and materials.

Let’s get started on your handwiring journey!

The Finished Product


Completed handwired mechanical keyboard showcasing clean wiring and a compact design.

Essential Materials and Tools for Switch Wiring

Before you begin the switch wiring process, gathering all necessary materials and tools is crucial for a smooth and efficient build. Here’s what you’ll need:

  • Plate: The foundation for your switches. Inspect it for any imperfections like warping or misaligned switch holes.
  • Mechanical Switches: Your choice of switches. Ensure they are in good working order by testing a few before starting.
  • Diodes (1N4148): Essential for preventing ghosting and ensuring accurate key input.
  • Soldering Iron and Solder: For creating electrical connections. A temperature-controlled soldering iron is recommended for precision.
  • Solid Core Wire: Ideal for rows and columns due to its rigidity and ease of manipulation. Different colors can help organize rows and columns.
  • Vise Grip Wire Stripper: This tool is invaluable for creating insulation gaps in the middle of wires, making row and column wiring cleaner and easier.
  • Multimeter: For testing continuity and ensuring all connections are correctly made.
  • Wire Cutters: For trimming diode and switch leads, and for cutting wires to length.
  • Ribbon Cable (Optional): Simplifies controller wiring and keeps connections organized.

Step-by-Step Switch Wiring Guide

This guide breaks down the switch wiring process into manageable steps, from preparing your plate to connecting the controller.

1. Plate Inspection and Switch Installation

Begin by thoroughly inspecting your keyboard plate. Check for any manufacturing defects such as warping, misaligned switch cutouts, or excess material. These imperfections can hinder switch installation and overall keyboard functionality.


Close-up view of a steel keyboard plate, highlighting the precision laser-cut switch openings ready for switch installation.


Keyboard plate positioned on a workspace, demonstrating the initial step of examining the plate for any structural flaws before proceeding with the build.

Once you’ve confirmed the plate is in good condition, proceed with installing your mechanical switches. For a 1.5mm thick plate, switches should snap in securely. If your plate is thinner, you might need to use a small amount of glue to secure the switches. As you install each switch, press it a few times to ensure it functions correctly and is properly seated in the plate. For an extra measure of quality control, you can use a multimeter to test switch actuation, although switch failures are rare.


Detailed shot of mechanical switches being inserted into the keyboard plate, ensuring a snug fit for each switch to maintain stability.


Switches fully mounted on the plate, ready for diode and wire connections, illustrating a complete row of installed mechanical keyboard switches.

2. Attaching Diodes for Matrix Wiring

Diodes are a critical component in handwired keyboards. They are essential for creating a key matrix that allows the controller to correctly identify each key press, even when multiple keys are pressed simultaneously (anti-ghosting). 1N4148 diodes are commonly used due to their affordability and suitability for this application.

To ensure a strong and reliable solder joint, create a loop with the diode lead around the switch pin. This technique is applied to every solder joint in this guide. Start by bending a batch of diode leads around a small object to create consistent loops close to the diode body. For each diode:

  1. Wrap the diode lead around the tip of needle-nose pliers.
  2. Place the looped lead over the switch pin.
  3. Tighten the loop around the pin using the pliers.
  4. Pinch the loop closed with the pliers for a tighter fit.
  5. Clip off excess wire at the loop.

A tight loop ensures good electrical contact even before soldering, making the soldering process cleaner and more effective.


Close-up showing the process of bending diode leads to create loops, essential for secure and efficient soldering to switch pins.


Detailed view of a diode lead looped around a switch pin, ready for soldering, demonstrating the loop technique for a robust electrical connection.


Multiple diodes attached to switch pins with looped leads, prepared for the next step of soldering, showcasing a row of switches with diodes in place.

3. Soldering Diodes to Switch Pins

Soldering is where the electrical connections are finalized. The loops you’ve created are particularly beneficial because solder’s surface tension will draw it into the loop, creating a secure joint. Position the loop at the base of the switch pin, using the excess diode wire to help stabilize it.

  1. Apply heat from your soldering iron to the pin and loop for a few seconds.
  2. Touch the solder to the tip of the iron, allowing it to flow into the loop.
  3. Use just enough solder to fill the loop’s interior.
  4. Remove the iron and solder wire, letting the joint cool.

Aim for a clean solder joint that fully encapsulates the loop, ensuring a reliable electrical connection.


Soldering iron applying solder to a diode lead looped around a switch pin, illustrating the direct application of heat and solder for a secure joint.


A cleanly soldered diode joint, showing the solder fully encasing the wire loop around the switch pin, resulting in a strong electrical connection.

4. Preparing Wires with a Vise Grip for Rows

For wiring rows and columns efficiently, a vise grip wire stripper is invaluable. This tool allows you to create gaps in wire insulation at specific intervals without cutting the wire, which is essential for clean and continuous wiring.


Vise grip wire stripper tool, highlighting its adjustable settings and mechanism for creating insulation gaps in wires.


Demonstration of using a vise grip to strip wire insulation, creating precise gaps needed for row and column connections in handwiring.


Close-up of wire after using a vise grip, showing consistent gaps in the insulation ready for soldering to diode leads for row wiring.

Using a vise grip is straightforward:

  1. Measure and mark the wire where insulation gaps are needed based on your keyboard layout and switch spacing.
  2. Position the wire in the vise grip at the marked point.
  3. Apply pressure to the vise grip to create the insulation gap.
  4. Remove excess insulation from the edges of the gap to ensure clean solder joints.

Solid core wire is highly recommended when using a vise grip, as stranded wire is more difficult to work with using this technique. Adjust the vise grip knob to match your wire thickness to prevent cutting the wire instead of just stripping the insulation.

5. Wiring Rows: Connecting Diodes in Series

Row wiring connects the diodes in series, and solid core wire is ideal for this. For safety, slightly thicker insulation is recommended for row wires, as mistakes in column wiring could potentially affect the row connections.

An improved technique for row wiring is as follows:

  1. Lay the prepared row wire across the row of diode wires.
  2. Bend the diode wire on one edge over the row wire to hold it in place.
  3. Feed the same diode wire back under the row wire, forming a loop around the row wire.
  4. Solder this joint, ensuring the loop is securely connected to the row wire.
  5. Push the insulation of the row wire against the soldered joint.
  6. Create a loop with the next diode wire around the row wire.
  7. Push the insulation pieces aside and solder this new joint.
  8. Repeat this process down the entire row, pushing the insulation against each joint as you go.

This method allows for direct and robust solder joints between the diode loops and the row wire, while protecting the wire insulation.


Starting row wiring by laying the stripped wire over diode leads, preparing to create loops for soldering at each switch position.


Close-up of a diode lead looped around the row wire and soldered, demonstrating the technique for securing row connections at each diode.


Illustration of tightening the row wire against the switch column while routing the diode wire to form a loop, ensuring a snug and clean wiring setup.


Row wiring in progress, showing multiple switches connected with row wire, demonstrating the continuous wire run and consistent loop soldering.


Completed row wiring, showcasing clean and tightly connected rows of diodes, ready for column wiring to complete the switch matrix.

Maintaining the row wire snug against the switch column throughout this process is crucial. This reduces potential damage and results in a cleaner, more professional-looking handwired keyboard.

6. Wiring Columns: Completing the Matrix

Column wiring follows a similar looping and soldering technique as row wiring. Use vise-stripped wire to create insulation gaps and form loops around the switch pins.

The key to efficient column wiring is to work one loop at a time, soldering each immediately after forming it, rather than pre-making all loops.

  1. Place the column wire next to the switch pin.
  2. Pull the wire tightly around the pin to form a loop.
  3. Remove the loop, pinch it closed with pliers, and reposition it on the pin.
  4. Ensure the next insulation section is out of the way.
  5. Solder the loop to the pin, as close to the base as possible.
  6. Repeat for each switch in the column.

Ensure you leave enough slack in each wire section to prevent stress on the row wires and avoid accidentally melting insulation. Thicker row wires can offer added protection against such errors. Solid core wire is again preferred for columns. You can use thinner insulation for column wires; individual strands from network cables like Ethernet are excellent for this purpose due to their thin insulation and vibrant colors, which can aid in organization.


Starting column wiring, positioning the stripped wire alongside switch pins to begin forming loops for soldering column connections.


Close-up of a column wire loop being formed around a switch pin, ready for soldering, illustrating the technique for secure column connections.


Soldering a column wire loop to a switch pin, demonstrating the application of solder to create a robust electrical joint for column wiring.


Column wiring in progress, showing multiple switches connected with column wires, illustrating the continuous wire run and loop soldering technique.


Detailed view of neatly wired columns, showcasing the organized and clean wiring achieved with the loop and solder technique, ready for controller connection.


Further progress in column wiring, highlighting the methodical approach of looping and soldering each connection for reliable electrical pathways.


Completed column wiring for a section of the keyboard, showcasing the finished matrix wiring with clean and consistent solder joints.


Overview of the fully handwired switch matrix, with both rows and columns meticulously wired, ready for connection to the keyboard controller.

7. Controller Wiring and Connection

For controller wiring, standard wire can be used, but ribbon cable is highly recommended for cleaner routing and organization. A ribbon cable simplifies connecting multiple wires to the controller and keeps the wiring neat.


Ribbon cable prepared for controller connection, showing stripped ends ready for soldering, highlighting the use of ribbon cable for organized wiring.

Stripping a ribbon cable is easily done by carefully burning off a ring of insulation at the end and pulling away the excess. Strip a sufficient length of wire, then wrap it around the pin or joint before soldering. For added security, you can bend the switch pin over the wire before soldering. Ensure solder fully encircles the hole when connecting to the controller PCB to create a durable joint.


Soldering wires from the ribbon cable to the keyboard controller, demonstrating the direct connection for signal and power transmission.


Keyboard controller positioned and wired, showing the integration of the controller with the handwired matrix, ready for final testing and cleanup.


Close-up of controller wiring, highlighting the neat and organized ribbon cable connections to the controller pins, ensuring reliable data transfer.

Important Note: Avoid using pins D6, GND, and VCC on a Teensy controller, as these can sometimes cause issues.

If using a ribbon cable with excess pins, it can be trimmed to fit your controller size. For a Teensy, an 18-pin and 20-pin split is ideal. For larger builds, either use a larger ribbon section or supplement with individual wires for rows/columns further from the controller.


Ribbon cable connected to the controller and switch matrix, showcasing the comprehensive wiring setup and the final stages of handwiring.

8. Testing and Clean Up for Reliability

Testing is critical before finalizing your build. Use a multimeter to perform these checks:

  • Continuity Test: Verify connection from the start of each row to each diode wire in that row, and from the start of each column to each switch connection in that column.
  • Short Circuit Test: Ensure no connection exists between any row and any column.
  • Controller Pin Test: Check that each controller pin connects to its intended row or column connection, and not to adjacent joints.

[Multimeter testing for continuity to ensure each switch and wire is correctly connected within the handwired matrix.]

After testing, use thin wire cutters to trim the excess switch pins. If your soldering and loop placement were precise, you should be able to trim them quite short, ensuring they don’t interfere with the case or cause shorts. Finally, meticulously inspect every solder joint to confirm solder has flowed completely around each loop for optimal electrical conductivity.

Finishing Your Custom Keyboard


Handwired keyboard after cleanup and pin trimming, showcasing the neat final wiring and preparation for casing.

With the wiring complete and tested, the final steps are casing and firmware. Choose a case that fits your aesthetic and functional needs. Options range from layered acrylic to sandwich-style standoffs, or even running the keyboard without a case to showcase the handwired work.

For firmware, QMK Firmware Builder is an invaluable tool for customizing your keyboard’s functionality. A multimeter can also be helpful in identifying controller pins if you used a ribbon cable during setup.


Completed handwired mechanical keyboard with keycaps installed, ready for use, demonstrating the final assembled custom keyboard.


Angled view of the finished handwired keyboard with keycaps, highlighting the custom build and the satisfying outcome of the DIY project.

Congratulations! You have successfully handwired your own mechanical keyboard. Enjoy the unique feel and personalized experience of your custom creation!

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

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