Custom Lego Mechanical Keyboard: Build Guide
In this article
Yes, you can build a fully functional custom mechanical keyboard using Lego bricks as the case and keycaps. This guide walks you through the entire process, from gathering parts to final assembly. You'll need a mechanical keyboard kit (or parts), Lego bricks, and basic tools. No soldering is required if you choose a hot-swappable kit.
What You'll Need
- Mechanical keyboard kit – a hot-swappable PCB, plate, and stabilizers (e.g., a 60% or 65% kit).
- Switches – Cherry MX or compatible (linear, tactile, or clicky, your choice).
- Keycaps – standard MX-compatible keycaps (Lego studs are not recommended as keycaps—they don't fit properly).
- Lego bricks – enough to build a case and optionally a wrist rest. Standard 2x4, 2x2, and 1x4 bricks work well.
- Lego baseplates – for a flat bottom surface (optional but recommended).
- Double-sided tape or adhesive putty – to secure the PCB to the Lego case (avoid permanent glue).
- USB cable – compatible with your keyboard PCB (usually USB-C).
- Small screwdriver – for any screws in the kit.
- Optional: switch puller, keycap puller, and a soft cloth.
Step-by-Step
- Plan your layout. Decide which keyboard size you want (60%, 65%, etc.) and check the dimensions of your PCB. Note the position of the USB port and any controller chips that need clearance.
- Design your Lego case. Sketch a simple rectangular frame that fits your PCB. The frame should be at least 1-2 studs wider than the PCB on each side. Remember to leave an opening for the USB port. If your PCB has a top-mounted USB-C port, you'll need a gap in the front wall.
- Build the base. Start with a flat baseplate (or a solid layer of bricks) slightly larger than your PCB. This will be the bottom of the case. Ensure it's flat and stable.
- Build the walls. Construct four walls around the base, leaving the USB opening. Use interlocking bricks for strength. The walls should be tall enough to hold the plate and PCB—usually about 1-2 cm above the base. Test-fit the PCB periodically.
- Add internal supports. Place a few small bricks or plates inside the case to support the PCB from underneath, especially at the corners and center. This prevents flexing when typing.
- Install stabilizers. If your kit includes stabilizers (for spacebar, enter, etc.), install them on the PCB according to the kit's instructions. This is easier before mounting the switches.
- Mount the switches. Insert the switches into the plate (if your kit has a plate) and then press the plate+switches onto the PCB. Ensure the pins are aligned and push firmly until they click. If your kit is hot-swappable, you can insert switches directly into the PCB sockets.
- Test the PCB before assembling. Connect the PCB to your computer and test each switch with a keyboard tester website or a simple text editor. If any switch doesn't register, reseat it.
- Secure the PCB in the case. Place the assembled PCB+plate into the Lego case. Use small pieces of double-sided tape or adhesive putty on the internal supports to hold the PCB in place. Make sure the USB port aligns with the opening.
- Build the top frame (optional). If your kit has a top plate, you can place it over the switches. If not, you can build a Lego top frame that fits around the switches to give a finished look. Ensure the switches are accessible for keycaps.
- Attach keycaps. Press each keycap onto its switch stem. Align them carefully to avoid bending the stems.
- Final test. Plug in the keyboard and type to ensure all keys work. If any key is stuck or unresponsive, adjust the keycap or switch.
Common Mistakes
- Insufficient clearance for the USB port. Measure the port location and build the wall accordingly. If the port is blocked, you'll have to rebuild the case.
- PCB not supported. Without internal supports, the PCB can flex and cause missed keystrokes. Add bricks underneath.
- Using Lego studs as keycaps. Lego studs are too small and won't fit MX stems. Use standard keycaps.
- Forgetting to test before final assembly. Testing after mounting everything is harder to troubleshoot. Always test the PCB first.
- Over-tightening screws (if any). Some kits have screws for the plate; tighten gently to avoid stripping.
Tips
- Use Lego plates (flat bricks) for the top surface to give a smoother look.
- Add rubber feet (Lego or adhesive) to the bottom to prevent slipping.
- Build a removable wrist rest from Lego bricks for ergonomics.
- If your PCB has RGB lighting, use transparent or light-colored Lego bricks to let the glow show through.
- Label the USB port location with a small sticker or a different colored brick for easy plugging.
Troubleshooting
Keys not registering: First, reseat the switch (pull it out and push it back in). If that doesn't work, check if the switch pins are bent. If using a plate, ensure the switch is fully seated. If the PCB is hot-swappable, try a different switch in that socket.
USB port not accessible: If the port is blocked, you need to modify the case. Remove the PCB, carefully break apart the wall near the port, and rebuild with a gap. Use a small saw or brick separator to disassemble.
Keyboard flexes when typing: Add more internal supports. Place bricks directly under the PCB's mounting holes. If the case is too tall, the PCB may not sit flat—add shims (small plates) under the PCB.
Stabilizers rattle: Apply a small amount of lubricant (like dielectric grease) to the stabilizer wires. Ensure they are clipped in properly.
Lego case falls apart: Use larger bricks and interlock them more. For permanent builds, you can use a small amount of Lego-compatible glue (like Kragle) on the bottom layer only—but avoid gluing the PCB.
If nothing works: Disassemble completely and rebuild, following the kit's manual for the PCB assembly. Verify the PCB is functional by testing it outside the case.
Frequently Asked Questions
Can I use Lego keycaps?
No, standard Lego studs are too small for MX stems. You can find 3D-printed Lego-style keycaps, but they are not official Lego and may not fit well.
Do I need to solder?
No, if you buy a hot-swappable kit. If you have a soldered PCB, you'll need to solder the switches yourself—that requires a soldering iron and experience.
Will the Lego case damage the PCB?
No, as long as you use non-conductive materials. Lego bricks are safe. Avoid using metal screws or conductive adhesives.
Can I use any keyboard kit?
Most standard mechanical keyboard kits (60%, 65%, 75%) will work. Just ensure the PCB dimensions fit your Lego case. You can also build a case around a pre-built keyboard, but you'd need to remove the original case.
How do I clean the Lego case?
Disassemble the case and wash the bricks with warm soapy water. Let them dry completely before reassembling.
Is it durable enough for daily use?
Yes, if built with tight connections. Use a baseplate for stability. Avoid dropping it, as bricks can pop off.