Custom Handwired Rust-BLE Keyboard
A fully custom, 3D-printed, Bluetooth split mechanical keyboard built without a PCB.
Author: Constantin Eduard-Andrei
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-Edward-game-scr
Description
This project is a custom-built, wireless split mechanical keyboard based on the ergonomic Corne physical layout. To maximize hardware complexity and avoid prebuilt kits, the keyboard uses no PCB; instead, the switch matrix is entirely handwired. The core of the project is writing a custom embedded Rust firmware from scratch using the embassy-rs framework to handle matrix scanning, key debouncing, and Bluetooth Low Energy (BLE) communication.
Motivation
I chose this project to gain deep, hands-on experience with both bare-metal electronics and modern embedded software. On the hardware side, handwiring the diode matrix forces a complete understanding of how electrical grids operate. On the software side, writing the firmware in Rust provides the opportunity to learn embassy-rs for asynchronous embedded programming and to understand how to implement a BLE HID (Human Interface Device) stack from the ground up. Also I want to some watch movies in the summer on my tv and I need a keyboard to type on the internet so that the search is way faster.
Architecture
-
The system architecture consists of a custom electrical matrix and an asynchronous Rust software stack.
-
The Hardware Matrix: 42 mechanical switches are handwired into a matrix of Rows and Columns. Diodes are soldered to each switch to prevent electrical "ghosting" when multiple keys are pressed.
-
The Microcontroller: An NRF52840 development board acts as the central brain, connected to the matrix rows and columns via its GPIO pins. It is powered by a 3.7V LiPo battery.
-
The Rust Firmware: The software utilizes embassy-rs for async execution. A polling task continuously scans the GPIO matrix to detect state changes.
-
Bluetooth Communication: Using the nrf-softdevice crate, the microcontroller advertises itself as a BLE Keyboard and transmits the processed keystroke data over the air to a host computer.
Log
Week 5 - 11 May
Finalized component research and ordered all necessary hardware (microcontrollers, switches, batteries, keycaps) -> Waiting for their delievery.
Week 12 - 18 May
Week 19 - 25 May
Hardware
The hardware relies on a 3D-printed chassis to hold the switches, eliminating the need for a PCB. The logic is handled by NRF52840 chips due to their low power consumption and excellent Bluetooth capabilities.
Schematics
Bill of Materials
| Device | Usage | Price |
|---|---|---|
| SuperMini NRF52840 | The microcontroller | 45 RON |
| Liter Energy 120mAh 3.7V LiPo (401230) | Power supply | 100 RON |
| Gateron Milky Yellow Pro | Mechanical linear keyboard switches | 125 RON |
| 1N4148 High-speed Diodes | Prevents "ghosting" in the keyboard matrix | 16 RON |
| 24AWG Solid Core Copper Wire | Routing the rows and columns | 24 RON |
| PBT XDA Blank 1U Keycaps | The physical key profiles | 58 RON |
| SS12F15VG4 4MM Slide Switches | Physical power toggle for the batteries | 36 RON |
Software
| Library | Description | Usage |
|---|---|---|
| embassy-rs | Async embedded framework for Rust | The core framework used to run asynchronous tasks (like matrix scanning and Bluetooth handling) without blocking the CPU |
| embassy-nrf | Hardware Abstraction Layer (HAL) | Used to safely interact with the NRF52840's physical GPIO pins and timers |
| nrf-softdevice | Rust bindings for Nordic's Bluetooth stack | Used to configure the BLE radio and implement the HID protocol to talk to the PC |
| defmt | Highly efficient logging framework | Used for debugging the matrix scanning logic over a USB connection |