In this video, Clem embarks on a captivating journey to craft an open-source Bluetooth keyboard entirely from the ground up, showcasing his passion for keyboard customization. Starting with the choice of clicky mechanical switches and a low-profile design, Clem combines elements from both English and German layouts to create a compact and highly personalized keyboard. He meticulously designs a custom PCB, integrating an ESP32 S3 microcontroller for wireless connectivity, and delves into coding the firmware from scratch. The uniqueness of his creation extends to 3D-printed keycaps with raised, durable symbols on the inside, ensuring a lasting, tailored typing experience. Despite encountering technical challenges, Clem's determination prevails, resulting in an open-source Bluetooth keyboard with a distinctive layout and innovative features, ready for fellow enthusiasts to explore.
Watch the Video:
Keyboards. An everyday item for the average computer user and praised possession for the enthusiast. Building a mechanical keyboard from a kit is a very popular project. As Clem spends most of his time in front of his PC, he is an avid user of mechanical keyboards, but not an enthusiast, so his daily driver can be described as the "cheapest thing that has mechanical switches“. Since he coined the phrase „there should be an open-source variant of everything“, a keyboard went on the list. But not a normal one. An ortholinear, Bluetooth connected, modular keyboard with a weird mashup of keys comprised of US style QWERTY and German QWERTZ layout. The only way to build such a monstrosity is to start from scratch and even write the firmware from scratch.
Clem decided on a 60-button compact ortholinear layout, coincidentally the exact same size as the Blackmagic Speed Editor keyboard. The two are perfect for side-by-side usage on his editing workstation. The Bluetooth connectivity is achieved by utilizing an ESP32-S3 as the main MCU. USB-C acts as the charging port and Serial output. 4 colorful LEDs provide feedback about the current state of the Keyboard and visually indicate if SHIFT-Alt/AltGr or SUPER/FN/GUI are pressed.
Clem decided on a 60-button compact ortholinear layout, coincidentally the exact same size as the Blackmagic Speed Editor keyboard. The two are perfect for side-by-side usage on his editing workstation. The Bluetooth connectivity is achieved by utilizing an ESP32-S3 as the main MCU. USB-C acts as the charging port and Serial output. 4 colorful LEDs provide feedback about the current state of the Keyboard and visually indicate if SHIFT-Alt/AltGr or SUPER/FN/GUI are pressed.
The keyboard therefore has 4 freely programmable layers available for heavy customization. A BLE Keyboard on a cord does not make much sense, so Clem made a second PCB bringing the aforementioned modularity into play. The second PCB fits right above the uppermost row of keys; it has a convenient copperless window which is illuminated by the LEDs on the main PCB, a LiPo with its specific charging and protection circuitry and LDO. Both PCBs are interconnected via a universal bus, broken out on a Molex Premo-Flex connector and connected with a simple flat flex ribbon cable. This allows for variable heights and tolerates slight misalignments. The Premo-Flex connectors break out all power traces and UART connections so the keyboard can easily be used in future projects (foreshadowing) *wink *wink.
The whole layout was done in KiCad and features hot-swappable Keyboard switches. The flat low profile KS27 Gateron Blue switches were chosen for clickiness (and availability). The footprints should also fit the sockets of other brands and/or switches, but they have not been tested yet. Builders should print out the board files to check if the holes line up for the chosen switches before committing to a particular model. All PCBs were manufactured by Aisler with ENIG finish, and had to be assembled with a hot air gun and soldering iron, as the PCB was too big to fit in Clem’s reflow oven.
Of course, for such a weird keyboard, there are no ready-made injection-molded keycaps available. Blank keycaps would also make the board unusable to Clem, as he actually looks down a lot while typing to find the right keys. The only choice was to design and 3D-print custom keycaps. Clem designed his set of keycaps in FreeCAD and utilizes the ShapeString function of the Draft workbench to make easy modifications to the writing for each key. He also extrudes the writing to the inside of each keycap and paints the letter with a permanent marker. This results in a flat keycap without any raised portions that can be printed very quickly while laying flat on the bed of a resin printer. The lettering will never rub off, because it never actually comes in contact with the fingers. Of course, this only works with transparent keycaps, so Clem prints them with his super durable MAYER MAKES Engineering Resin. The full keyset and the source files are available for download and are easily customized (as demonstrated in the video).
The firmware was written in Arduino with the help of the ESP32-BLE keyboard library and the Adafruit keypad library. To get the BLE keyboard output working on the ESP32-S3, Clem was required to enable NIMBLE in the librariess files and install the NIMBLE library. These changes enable more efficient usage of the memory of the ESP32-S3 and should in theory also make the library work on the ESP32 S2 and C3. The firmware first tries to identify which layer the user is trying to use and then sends the corresponding key of the active layer. It took a lot of shuffling around with the code until the output was snappy enough for real keyboard usage. Additionally, a DEBUG option can be enabled that outputs the KEYCODE of each pressed key via USB-Serial to identify any mishaps.
Clem also designed a backshell for the keyboard., The original intention was to mill it from aluminum, but this could not be done in time for the video release. He 3D-printed a shell in PETG; however, it turned out that the keyboard with the secondary PCB-mounted LiPo was so stiff and sturdy that a back shell is not really necessary, though would be a nice upgrade. At 15mm total thickness, this also might be one of the flattest DIY mechanical keyboards out there.
Bonus Content:
Bill of Material:
Product Name | Manufacturer | Quantity | Buy Kit |
---|---|---|---|
MULTICOMP PRO Zero Ohm Resistor, Jumper, 0603 [1608 Metric], Thick Film, 100 mW, 1 A, Surface Mount Device | Multicomp pro | 60 | Buy Now |
BOURNS Small Signal Schottky Diode, Single, 40 V, 300 mA, 500 mV, 2 A, 125 °C | BOURNS | 60 | Buy Now |
MOLEX USB Connector, USB Type C, USB 3.1, Receptacle, 24 Ways, Surface Mount, Right Angle | MOLEX | 1 | Buy Now |
STMICROELECTRONICS ESD Protection Device, 17 V, SOT-23, 6 Pins, USBLC | STMICROELECTRONICS | 1 | Buy Now |
MOLEX FFC / FPC Cable, Premo Flex Jumper, 10 Core, 1 mm, Same Sided Contacts, 6 ", 152 mm, White | MOLEX | 1 | Buy Now |
MOLEX FFC / FPC Cable, Premo Flex Jumper, 10 Core, 1 mm, Same Sided Contacts, 2 ", 51 mm, White | MOLEX | 1 | Buy Now |
MOLEX FFC / FPC Board Connector, 1 mm, 10 Contacts, Receptacle, Easy-On 52207, Surface Mount, Top | MOLEX | 1 | Buy Now |
MOLEX FFC / FPC Board Connector, ZIF, 1 mm, 10 Contacts, Receptacle, Easy-On 52271, Surface Mount, Bottom | MOLEX | 1 | Buy Now |
MIKROELEKTRONIKA Rechargeable Battery, 3.7 V, Lithium Polymer, 2 Ah, JST | MIKROELEKTRONIKA | 1 | Buy Now |
Additional Parts:
ESP32-S3-Wroom1 |
Keycaps 3d printed with MAYER MAKES ENGINEERING RESIN + Blue Dye |
PCB provided by Aisler.net use code „thanks_mayermakes_23“ for a discount. |
Switches used are Gateron Blue KS27, sockets are random parts i found by searching for the switches. |