A custom 60% ortholinear mechanical keyboard, built from scratch with a 3D-printed case and handwired matrix.
Powered by an ESP32-S3 Zero microcontroller and programmed in C++ for key scanning, debouncing, and USB HID input.
- Ortholinear (grid-style) key layout
- 3D-printed case and plate design
- Handwired switch matrix with diodes
- ESP32-S3 Zero for USB HID functionality
- Firmware written in C++ (Arduino / PlatformIO compatible)
- ESP32-S3 Zero (microcontroller)
- 63 × Blue mechanical switches
- 63 × 1N4148 diodes (one per switch)
- Keycaps Cherry MX style
- Wires (24-26 AWG preferred for handwiring)
- 3D-printed case & plate
- Screws, brass threaded inserts, stabilizers
- Design & CAD: Fusion 360
- Slicing & Printing: Orca Slicer & FDM 3D Printer
- Firmware Development: Arduino IDE / PlatformIO
- Programming Language: C++
- Microcontroller Platform: ESP32-S3 Zero
- Decide your matrix rows × columns based on your ortholinear layout (common 60% ortholinear uses a grid sized to the key count).
- Handwire switches into a matrix: one side of each switch goes to a row wire, the other side goes through a diode to a column wire.
- Diode orientation: place the 1N4148 diode on each switch such that current flows from the switch toward the column/scan line. In practice, orient the diode with its striped end (cathode) pointing to the column/scan line (the MCU side). This prevents ghosting during matrix scanning.
- Route row and column wires to ESP32-S3 Zero GPIOs. Reserve a few extra GPIOs for indicators or encoders if needed. Use internal pull-ups or external resistors per your scanning routine.

Keyboard Matrix Circuit — Arduino Forum Reference
- 3D-print the case and plate. Test fit switches and stabilizers before final assembly.
- Solder diodes to switch pins first (striped end toward column).
- Solder row/column buses and label them (R0, R1, ... / C0, C1, ...).
- Connect buses to the ESP32-S3 Zero following your planned pin mapping. Secure the MCU and wiring inside the case, then close and mount.
The keyboard follows a 60% ortholinear grid layout with layered functionality.
This provides a compact footprint while still maintaining all essential keys.

Keyboard layout (visualized using Keyboard Layout Editor).
- Layer 1 (Default): Standard typing layer with alphanumeric keys, modifiers, and space.
- Layer 2 (MO): Media controls (volume, play/pause, next/previous).
- Layer 3 (MO): Function keys (F1–F12) and system shortcuts.
The editable layout file is included here: Keymap\60_keyboard.json
The complete CAD model of the keyboard is included in the repository:

Early render — initial concept.

Top view without keycaps — switch layout.

Handwired matrix — bus routing. (Without Diodes)

Top-right — underside and keycaps points.
Model: The whole model is support free
Printer: any FDM printer with a 0.4 mm nozzle.
Material: PLA (recommended) - PETG or ABS for higher heat resistance
- Layer height: 0.20 mm
- Infill: 15%
- Adhesion: none
- Supports: none (model designed support-free)
- Layer height: 0.16 mm (for smoother finish)
- Infill: 15%
- Adhesion: none
- Supports: none (model designed support-free)
| Function | GPIOs |
|---|---|
| Rows (0 → 4) | 45, 42, 41, 17, 40 |
| Cols (0 → 12) | 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 |
| NeoPixel | 21 |
This project uses C++. You can use either the Arduino IDE (with ESP32 board installed) or PlatformIO.
- Install ESP32 board support (Espressif) in Arduino IDE.
- Open the provided
Firmware/sketch. - Edit the
ROW_PINS[]andCOL_PINS[]arrays to match your wiring. - Select the ESP32-S3 Zero board and the correct port.
- Upload.
- Implement a debouncing routine (5–20 ms typical) to avoid chatter.
- Use a matrix scanning algorithm that drives columns (or rows) actively and reads inputs on the other side.
- Configure USB HID descriptors correctly for keyboard behavior.
- Keep serial debugging optional (enable via a compile flag) so HID is unaffected.
While the current build is fully functional, there can be upgrades in future iterations:
- Per-Key RGB lighting: NeoPixel/WS2812B LEDs for customizable effects.
- Wireless support: use the ESP32-S3’s built-in Bluetooth for Bluetooth HID, making the keyboard usable without USB.
- Custom PCB: replace handwiring with a dedicated PCB for cleaner routing, easier assembly, and better reliability.
This project is licensed under the MIT License.
Copyright (c) 2025 Mrinal Kumar










