rgoulter / keyboard-labs

Repo with my PCB designs and keyboard firmware
136 stars 11 forks source link

Keyboard Labs

This repository contains the source files for keyboard designs and keyboard firmware.

Keyboards

Kicad source files are in pcb.

Plotted gerber files can be found under the GitHub repository's releases.

Designation Summary/Keywords Image
X-1 36-key (2x3x5+3), split, column-staggered, MX/choc, sub-100x100, per-key RGB LED, ARM
X-2 60-key (5x12), un-split, ortholinear, MX/choc, GH60-compatible, "show the components", ARM
X-2 HSRGB 60-key (5x12), un-split, ortholinear, MX/choc, GH60-compatible, "show the components", HotSwap, per-key RGB, ARM
PyKey40 Lite Planck-MIT (4x12, 1x2U), ortholinear, MX, BM40/JJ40-compatible, PCBA, no frills, ARM
PyKey40 HSRGB Planck-MIT (4x12, 1x2U), ortholinear, MX, BM40/JJ40-compatible, PCBA, HotSwap, per-key RGB LED, ARM
Pico42 42-key ortholinear, MX/choc, BM40/JJ40-compatible, no frills, ARM
CH552-44 44-key ortholinear, MX, BM40/JJ40-compatible, no frills
CH552-48 48-key ortholinear (4x12), MX, BM40/JJ40-compatible, no frills
CH552-48-LPR 48-key ortholinear (4x12), low profile redragon, no frills
CH552-36 36-key (2x3x5+3), split, column-staggered, MX, sub-100x100, no frills
WABBLE-60 60-key (5x12), unsplit, ortholinear, MX, GH60-compatible, "show the components", RISC-V

X-1: 36-key, split, reversible PCB with WeAct Studio Mini F4 dev board

Design goals:

Pictures:

X-1, rev2021.5, MX variation (with rotary encoder, OLED, etc.).

X-1, rev2021.5, Choc variation, low-profile (with flipped GD-32 Bluepill devboards).

Height comparison between low-profile build (with Choc switches) and with sandwich-case.

Tented.

Showing the underside of the PCB through the acrylic bottom layer.

2D Renders of the PCB, revision rev2021.5

Build Guides

Keyboard Layout

Typing Demonstration Videos

typings.gg:

typing.io:

X-2: 5x12 Ortholinear, ARM-powered Adaptation of peej's Lumberjack PCB

peej's lumberjack-keyboard is a cool and creative design, which continues the style of "show the components" used by keyboards like the plaid.

One downside to it is that DIP microcontrollers are relatively weak. Development boards are a spiritual-successor to DIP microcontrollers, so I wanted to adapt the striking Lumberjack design to a more powerful development board.

Design goals:

Pictures:

X-2 PCB assembled, using a Bluepill devboard, with MX switches, in a cheap GH-60 case.

X-2 PCB assembled, using a WeAct Studio MiniF4 "Blackpill" devboard, with Choc switches, in a layered acrylic case.

2D Renders of the PCB, revision rev2021.1

Build Guides

X-2 HSRGB: 5x12 Ortholinear, ARM-powered Adaptation of peej's Lumberjack PCB, with HotSwap and per-key RGB

A fancier version of the X-2 above. With all the benefits of the X-2 (fits in GH-60 case, powerful microcontroller), but with a RGB lighting, which makes the keyboard a bit fancier.

Design goals:

Pictures:

X-2 HSRGB PCB assembled, using a Bluepill devboard, with MX switches, in a cheap GH-60 case. Using MX switches with transparent housing, like Kailh's Jellyfish switches, enhances the RGB lighting.

X-2 HSRGB PCB assembled, view of the back.

Build Guides

PyKey40 Lite: No-Frills Subset of the PyKey60 in BM40/JJ40 Form-Factor

My first PCBA design.

Takes jpconstantineau's PyKey60, and arranges a no-frills (no RGB, no hotswap, no speaker) subset of it to be a drop in replacement for the BM40/JJ40 PCB.

Design goals:

Pictures:

2D Renders of the PCB, revision rev2023.3

PyKey40 HSRGB: 4x12 Ortholinear with HotSwap and RGB in BM40/JJ40 Form-Factor

A 4x12 ortholinear with hotswap sockets, and per-key RGB and underglow, using the RP2040 MCU, with mounts compatible with the JJ40/BM40.

Design goals:

Pictures:

PyKey40 HSRGB PCB assembled in a high-profile aluminium case.

2D Renders of the PCB, revision rev2023.1

Pico42: Simple Hand-Solderable PCB in BM40/JJ40 Form-Factor

A very simple, hand-solderable PCB which uses the Raspberry Pi Pico dev board.

I made this design because in my first attempt at designing a CNC case for the PyKey40, I put the cutout for the USB connector in the wrong place. Having a design which doesn't use a USB connector underneath the PCB works around this.

The form factor encourages the thumbs to use 2-3 keys each (and rely on the pinky fingers less).

Design goals:

Pictures:

Pico42 PCB assembled with MX switches, in a low profile aluminium case.

Height of the Pico mounted on round-pin male headers in female headers.

Pico42 PCB assembled with Kailh Choc switches, in a sandwich case.

Underside of the Pico42 in a sandwich style case.

2D Renders of the PCB, revision rev2023.2

Build Guides

CH552-44: Low-Budget Hand-Solderable PCB in BM40/JJ40 Form-Factor

A very simple, hand-solderable 44-key PCB which uses the WeAct Studio's CH552 devboard.

The form factor encourages the thumbs to use 2-3 keys each (and rely on the pinky fingers less).

The keyboard uses semickolon's fak firmware, which uses the sophisticated and modern Nickel configuration language to declare keyboard and keymap definitions.

The CH552 is cheaper than the RP2040, although is much less powerful. e.g. you're probably not going to get Vial on a CH552 keyboard. In practice, fak seems well suited for small-keyboard enthusiasts.

Since the CH552 has relatively few GPIO pins, the matrix uses 7 rows of 7 columns (= 14 GPIO pins), rather than a more traditional 4 rows of 12 columns (which would use 16 GPIO pins).

Design goals:

Pictures:

<img src="https://raw.githubusercontent.com/rgoulter/keyboard-labs/master/docs/images/keyboards/ch552-44/ch552_44-sandwich-top.JPG" width=600 />

CH552-44 (rev2023.1) in a sandwich style case.

Underside of the CH552-44 (rev2023.1) in a sandwich style case.

2D Renders of the PCB, revision rev2023.2

Build Guides and Release Assets

Firmware

(NOTE: for flashing new firmware, on Windows, I recommend the official WCHISPTool. For flashing using open-source software, it's much easier to flash firmware onto the CH552 from Linux, e.g. docs/guide-liveiso-flashing-fak.md).

Plates and Cases

A bottom plate can be used to protect the components underneath the PCB.

Source files for plates to cut (or cases to 3D print) can be found under cad/ in this repository.

CH552-48: Low-Budget PCBA in BM40/JJ40 Form-Factor

A very simple 48-key PCBA which uses the CH552 MCU.

The keyboard uses semickolon's fak firmware, which uses the sophisticated and modern Nickel configuration language to declare keyboard and keymap definitions.

The CH552 is cheaper than the RP2040, although is much less powerful. e.g. you're probably not going to get Vial on a CH552 keyboard. In practice, fak seems well suited for small-keyboard enthusiasts.

Since the CH552 has relatively few GPIO pins, the matrix uses 7 rows of 7 columns (= 14 GPIO pins), rather than a more traditional 4 rows of 12 columns (which would use 16 GPIO pins).

Design goals:

Pictures:

CH552-48 in a sandwich style case.

Underside of the CH552-48 in a sandwich style case.

Underside of the CH552-48, showing the PCBA components..

2D Renders of the PCB, revision rev2023.1

Firmware

(NOTE: for flashing new firmware, on Windows, I recommend the official WCHISPTool. For flashing using open-source software, it's much easier to flash firmware onto the CH552 from Linux, e.g. docs/guide-liveiso-flashing-fak.md).

Plates and Cases

A bottom plate can be used to protect the components underneath the PCB.

Source files for plates to cut (or cases to 3D print) can be found under cad/ in this repository.

CH552-48-LPR: Low-Budget PCBA with Low Profile Redragon Switches

Variation of the CH552-48 which uses Redragon low profile switches.

Redragon low profile switches are significantly cheaper than other low profile switches, especially the popular Kailh Choc v1 switches.

Height varies depending on keycap profile. The distance between the top of the PCB and the top of the keycap is around 11mm for Redragon low profile switches with low profile keycaps. (In comparison, the same measurement is 10-11mm for Kailh Choc v1, and about 20mm for MX).

Unlike MX switches (where switches from different manufacturers will have compatible pin positions), different "low profile" switches have different pin positions from each other. So, to use Redragon "low profile" switches, you need a PCB designed for Redragon low profile switches.

The KiCad footprint I used for this design can be found under pcb/ in this repository.

Redragon switches support keycaps with MX stems, unlike Kailh Choc v1. Albeit, general MX keycap profiles (e.g. XDA) are NOT fully compatible with "low profile" switches, since the bottom of the keycap bottoms-out below where a switch plate sits. Instead, "low profile" switches with MX stems need 'slim' keycaps, such as NuPhy's or womier's, etc.

Since the Redragon low profile switches have 3-pins, it's best to assemble the keyboard using a switch plate (e.g. a lasercut 1.0mm metal plate). Pictures below show what a build without a plate looks like.

Design goals:

Pictures:

CH552-48-LPR in a JJ40 low profile aluminium case.

CH552-48-LPR in a sandwich style case.

Underside of the CH552-48-LPR in a sandwich style case.

Switches mounted to the PCB without a plate.

Unsoldered underside of the PCB, with switches mounted in a plate.

2D Renders of the PCB, revision rev2023.1

Firmware

Same as for the CH552-48.

(NOTE: for flashing new firmware, on Windows, I recommend the official WCHISPTool. For flashing using open-source software, it's much easier to flash firmware onto the CH552 from Linux, e.g. docs/guide-liveiso-flashing-fak.md).

Plates and Cases

A bottom plate can be used to protect the components underneath the PCB.

Source files for plates to cut can be found under cad/ in this repository.

CH552-36: Low-Budget 36-key Split Keyboard with SMT Components

A very simple, 36-key PCB which uses the CH552 MCU.

The design takes inspiration from TeXitoi's keyseebee.

The PCB is smaller than 100x100 mm2, so that it's cheaper to fabricate at various PCB fabricators.

The keyboard uses semickolon's fak firmware, which uses the sophisticated and modern Nickel configuration language to declare keyboard and keymap definitions.

Design goals:

Pictures:

<img src="https://raw.githubusercontent.com/rgoulter/keyboard-labs/master/docs/images/keyboards/ch552-36/top.JPG" width=600 />

CH552-36.

<img src="https://raw.githubusercontent.com/rgoulter/keyboard-labs/master/docs/images/keyboards/ch552-36/mcu.JPG" width=600 />

CH552-36, close up of the MCU area.

<img src="https://raw.githubusercontent.com/rgoulter/keyboard-labs/master/docs/images/keyboards/ch552-36/tented.JPG" width=600 />

CH552-36, tented, with a coiled TRRS cable.

<img src="https://raw.githubusercontent.com/rgoulter/keyboard-labs/master/docs/images/keyboards/ch552-36/bottom.JPG" width=600 />

Bottom of CH552-36.

2D Renders of the PCB, revision rev2023.1

Build Guides and Release Assets

Firmware

(NOTE: for flashing new firmware, on Windows, I recommend the official WCHISPTool. For flashing using open-source software, it's much easier to flash firmware onto the CH552 from Linux, e.g. docs/guide-liveiso-flashing-fak.md).

WABBLE-60: 5x12 Ortholinear, BLE, RISC-V-powered Adaptation of peej's Lumberjack PCB

A keyboard using the WeAct BLE core board.

WeAct's BLE core board is significantly cheaper than the more popular nice!nano BLE board.

The PCB design resembles peej's lumberjack-keyboard, and mounts into GH-60 compatible cases like the Lumberjack; however, the WeAct BLE core board uses a much more powerful MCU than the Lumberjack's 8-bit ATMega328P.

The WABBLE-60 PCB includes LiPo charging.

Design goals:

Pictures:

<img src="https://raw.githubusercontent.com/rgoulter/keyboard-labs/master/docs/images/keyboards/wabble-60/wabble-60.JPG" width=600 />

WABBLE-60.

2D Renders of the PCB, revision rev2024.2

Build Guides and Release Assets

Firmware

There are few options for keyboard firmware for the WeAct BLE core board; and what options there exist are not very mature.

There is a port of QMK to the CH582, but as far as I'm aware, it's USB-only, and its BLE-implementation is not public.
I wrote about my experience writing firmware with this port.
I've put the code for the WABBLE-60 in my qmk_port_ch5xx fork.

Kirei, from the same author as fak supports the CH58x.

I recorded a video demonstrating 110 WPM using a BLE connection.
Though, at the time of writing, Kirei's BLE implementation is not yet mature; I've had trouble using the BLE keyboard on some platforms.

Like fak, Kirei's keymaps are declared in Nickel. Kirei's keymap language is more expressive than fak's.
Here's an example of a non-trivial keymap written for Kirei
I've put the code for the WABBLE-60 in my kirei fork.

Besides these options, ch32-rs has a work-in-progress HAL for CH58x. Its examples include a bare-bones BLE Peripheral.

WCH's EVT has many examples for the CH58x (including USB HID Keyboard, USB+BLE, BLE HID, BLE Central+Peripheral, BLE OTA IAP).

WeAct also have a BLE core board which uses CH592. However, the CH592 has even less support than the CH58x.

CAD Designs

CAD design files found under cad/:

Tenting Stand

keyboard_tenting_stand.scad describes a design which can be laser cut and assembled to form a adjustable tenting stand. The stand can be adjusted using an extra wedge piece.

The design accepts various parameters (e.g. width, height, angle, screw diameter).

Layered Case

An OpenSCAD module which helps for modelling the layers for a layered acrylic case.

Simple 3D Parameterised Case for CNC/3DP

A set of OpenScad files for a parameterised simple keyboard case design.

I've used outputs from these for CNC milling, as well as for 3D printing.

The case has several parameters, so it should be suitable for a variety of rectangular-shaped PCB keyboards.

The CNC case, mounting a Pico42.

The CNC case, top.

The CNC case, bottom.

The 3D Printed Pico42 case, mounting a Pico42 with Choc switches, sitting on a laptop's keyboard.

The 3D Printed Pico42 case, top.

The 3D Printed Pico42 case, bottom.

Preview of the case in OpenScad.

Firmware

Source files under firmware.

QMK is the most practical firmware I've used for small keyboards. I maintain firmware for my keyboards and my layouts in a downstream GitHub repository on the branch rgoulter-keyboards-and-layouts. (This branch will get rebased onto qmk's develop branch from time to time). My code will get synced into the firmware/qmk directories.

There is some code for the CircuitPy keyboard firmware KMK. (Although, at the time of writing, KMK doesn't handle home row modifiers well, so IMO it's less suitable for small keyboards as-is).

There is also keyboard firmware written in Rust using the keyberon firmware under firmware/keyberon.

Scripts

Kicad PCB to OpenSCAD

My attempt at generating top/bottom plate CAD files as code.

The script generates an OpenSCAD file with the .kicad_pcb data (Kicad module positions, board outline as an OpenSCAD module, etc.), which can be used by other OpenSCAD code.

See: scripts/README.MD

Example output of OpenSCAD code, which makes use of the Kicad PCB data to construct a variety of keyboard plates.

Notes