How to Build Your Own Keyboard PCB

Keyboard PCB board is considered the building block of keyboards. They consist of key switches that are connected to the controller, facilitating the transmission of key presses to the computer. PCB boards serve as the central point for all key presses, ensuring accurate and reliable input signals. Therefore, it is essential to study the various components and understand their interactions before embarking on a DIY keyboard PCB.

Table of Contents

Step 1: Keyboard PCB Design

Considerations that need to be included in the design

Compatibility Check:

The Keyboard PCB layout must support the boards that will be used in our project. It is important to confirm the compatibility of the chosen keycap set and switches with the layout. Some common options for switches are Gateron, Cherry MX, and Kailh. Keep in mind that certain boards may support special layouts, so compatibility should be verified.

Additional Features:

Design and program additional functions according to your needs. These can include media control keys, dedicated keys for special operations, and macro keys. You can strike a balance between functionality and compactness by eliminating some keys while maintaining the desired key layout, such as sixty percent and seventy-five percent layouts.

Ergonomics:

Before starting the circuit design, it is recommended to experience different size configurations and custom keyboard PCB size for optimal comfort. Consider options like sixty-five percent, TKL (Tenkeyless), full-size, and sixty percent compact layouts. Also, take into account your typing speed and style, and consider incorporating ergonomic parameters.

Programmability:

Certain types of keyboard motherboards offer programmability specifications that allow for macro configuration, key remapping, and customization of RGB lighting. To configure and customize these factors, various software or firmware flashes are available.

Community Support and Resources:

Engage with experts and senior engineers to get a keyboard PCB DIY guide. Additionally, utilize online resources, website forums, electronics enthusiast groups, and other community-supported platforms (such as software and firmware) to gather guidelines and information.

Components used in mechanical keyboard PCB layout

Printed Circuit Board:

The main component and foundation for creating a custom mechanical keyboard is the PCB. To get a custom PCB manufactured at a more affordable price, you can send your circuit diagram to an online PCB manufacturer. Some manufacturers even offer free services or discounted prices.

Key Switches:

Key switches are used to record and provide feedback for keystrokes. Common types include tactile, linear, or clicky switches, which can be selected based on your typing preferences and then configured on the PCB layout.

Keycaps:

Keycaps are the visible components of a keyboard that can be easily customized. They provide both tactile and visual interfaces. Keycaps are categorized based on shape, material, and color, allowing you to create an attractive-looking keyboard.

Controllers:

Controllers serve as the “brain” of a mechanical keyboard, similar to the CPU of a computer. They are responsible for sending key input signals to the computer. ARM-based microcontrollers and STM32 are commonly used in keyboard projects. When using Arduino based controllers, it’s important to check their compatibility with the firmware.

Other Components (Optional):

There are several other components that can be used based on individual needs. Examples include wrist rests, RGB lighting, custom cases, and stabilizers. These components can enhance the functionality and aesthetics of the keyboard.

Step 2: Keyboard PCB Soldering and Assembly

Assembling the keyboard requires soldering and assembling the components onto the PCB. To do this, you need to prepare a clean workspace and gather all the necessary tools such as solder wire, soldering iron, screwdriver, and other related tools.

Start the assembly process by soldering the switches onto the Keyboard PCB. Place each switch in the desired location and align the pinout with the corresponding holes. Heat the solder joints with the soldering iron and feed solder wire to create a solid connection. Repeat this process for all the switch connections on the keyboard.

When reassembling the stabilizers, it is recommended to apply lubricant to the connection points to minimize friction and noise. Ensure proper alignment and place the stabilizers in the designated holes on the plate.

For the single-chip microcontroller, it only needs to be soldered to the designated pad on the PCB.

Before soldering circuit boards, it is crucial to review tutorials and take necessary safety precautions. Once all the components are connected, perform a final inspection to ensure there are no solder bridges or cold joints that could cause issues. To verify the correct functioning of the switches, you can use a multimeter.

Step 3: Programming the Keyboard

Firmware is a type of software that is loaded into a microcontroller or chip in an embedded system. It controls the operation and functions of a hardware device. With firmware, you can define the keyboard layout, key mapping, multimedia controls, macro functions, and other customizations. The firmware reads the input signals from the keyboard PCB and converts them into data that the computer can understand for keyboard operation and interaction. Popular options for firmware include IA TMK and QMK, which can be downloaded from their respective websites.

Before starting the programming process, set up the development environment and install the necessary development tools supported by the firmware. This ensures that you have the required software for developing and flashing the firmware. These tools may include code editors and compilers.

Open the firmware’s configuration file using a code editor. These files allow you to customize various features of the keyboard, such as lighting effects, keymaps, layer settings, and macro configurations.

Configure the firmware for compilation using the provided commands defined in the firmware documentation. Compile the firmware code to convert the configuration settings into a binary file that can be flashed onto the keyboard’s microcontroller. Connect the keyboard to the computer using a USB cable and put the keyboard into the correct bootloader mode. Use the recommended flash tool provided by the firmware to transfer the compiled firmware binary to the microcontroller. Follow the instructions provided by the flashing tool to ensure a successful firmware update.

Step 4: Testing and Troubleshooting

Initial Functionality Test: Once the keyboard assembly is complete, begin by connecting the keyboard to the computer and testing each key to ensure proper operation. Test all types of keys, including special characters, function keys, and modifiers, to ensure they are functioning correctly.

Key Chatter and Debounce Test: Key chatter refers to undesired multiple keypresses caused by erratic key compressions, while debounce issues result in inaccurate keypress duration. There are testing software or online tools available to detect and test these problems. Press each key multiple times and if you observe key chatter or debounce, consider adjusting the firmware settings or replacing the problematic switch.

Keymap and Layer Testing: If you have configured custom keymaps in the firmware, test each one to ensure accuracy. Verify that macros and shortcuts are functioning as intended. Additionally, test each layer to ensure smooth transitions between them without any gaps or inconsistencies.

Connectivity and USB Testing: Test the USB connection to ensure a stable and reliable connection between the keyboard and the computer. Connect the keyboard to different USB ports and verify that there are no issues specific to certain ports.

Stabilizer and Switch Testing: Test the stabilizers and switches to ensure proper functionality. Check that the stabilizers do not produce excessive noise or rattle and that they provide smooth key travel. Test each switch for consistent actuation and proper spring tension. If any issues arise, such as sticky switches or loose stabilizers, consider lubricating or adjusting them accordingly.

Physical Inspection: Perform a thorough visual inspection by checking the solder joints and other components connected to the board. Ensure there are no soldering defects or loose connections that may affect the keyboard’s performance.

Troubleshooting: If any faults or issues arise during testing, refer to the documentation provided by the manufacturers or firmware documentation. You can also seek guidance from online communities or forums dedicated to keyboards. Basic troubleshooting steps may include re-flashing the firmware, changing switches, or adjusting firmware settings to resolve the problem.

Re-Testing: After troubleshooting and resolving any issues, re-test the keyboard to ensure that all problems have been resolved and that it is functioning accurately.

Scroll to Top