Thursday, 23 October 2025

My third keyboard design: diode-free, 34-keys, Bluetooth, spilt

Back when I was first looking at DIY keyboard designs, one that caught my eye was the Forager - a cute little 34-key wireless split keyboard in a compact elegant case. I was ready to move down to 36-keys, but just 34 seemed a stretch (I'm willing to try now). Also, it looked like a challenging build - surface mounted hotswap sockets (I can do those now), two little Seeed XIAO controllers (should be OK), and 34 surface mounted diodes (tiny and daunting). Well, I could just design my own diode free keyboard PCB again, right? 

Distracted boyfriend meme, but with keyboard PCBs

I actually did the initial PCB design for this while still finalizing the case modifications for my second keyboard, the Gamma Omega Hesse, and ordered the Acid PCB as the Hesse PCB was being shipped to me. Hence the meme.

Problem Scoping 

The Forager is a split keyboard, each half has a small PCB (about 10x11.5cm) with 17 choc switches using hotswap sockets and a diode each. The case is 3D printed in two pieces, and the switches and their keycaps stand proud of the flat top case surface. The battery is hidden in a 4mm space under the PCB, along with the hotswaps and the controller itself, which sits tucked in the corner with the USB socket (used for charging) exposed and touching the desk. In other words, the tiny controller itself is the limiting factor in the bottom case thickness!

Given I set out to replace the PCB with a diode-free version, this was also a chance to add a cut out for the battery - giving another 1.6mm in thickness, a bigger battery, and thus a longer battery life. Dropping the diodes makes that change much easier!

The original design uses one of the popular tiny Xiao footprint controllers, specifically the first Bluetooth capable model - the Seeed XIAO nRF52840, originally known as the Seeed XIAO BLE. This has 11 GPIO pins on easy to reach castellated pins. The battery connections are sadly on the back, which complicates the build - handled with a cut-out in the PCB to solder this from underneath. Also on the back are two NCF connection pads, which can also be used as GPIO pins - making in total 13 GPIOs (important later).

The Xiao family has since expanded, with some other Bluetooth options. First up, the Seeed XIAO nRF52840 has a plus variant, which adds tiny extra castellated pins between the original ones, for an advertised total of 20 GPIOs. The catch is pin D16 aka P0.31 has a connection to the battery sensing circuitry, and cannot be used when a battery is connected - so for wireless keyboard use this has only 19 usable GPIOs. That is still more than enough for direct wiring a split keyboard (one GPIO per key), even a larger split 36-key or 38-key design (like the Totem).

The other option I briefly considered is the newer Seeed XIAO nRF54L15, which has the original 11 GPIO castellated pins, and adds 5 as pads on the back like the battery connections, for a total of 16 GPIOs. Other points against this were ZMK support is still a work in progress, and the reset button has been moved - so it can't be used with the original Forager case.

Or, there are Xiao clones like the Super-nRF52840 (alternative link), which has the NFC pair (in a similar place) and another seven GPIOs or the back (including P0.31 likely used in battery monitoring). So again probably 19 usable GPIOs? The reset and battery pads look to be in the same location as the original. One to consider in future perhaps, if I need more GPIOs in this form factor?

Battery Connection

Without worrying about diodes, adding a cutout to the PCB was an easy change. While this will allow a larger battery be fitted, not many are sold with the connection used on the original PCB design. The lowest profile connection on LiPo batteries of suitable size is misleadingly sold as  "JST 1.25mm" or "Micro JST 1.25mm". They are typically clones of the Molex PicoBlade (thanks ZMK Discord!). The Molex PicoBlade series horizontal SMD connector 53261-0271, or a clone, should fit nicely - safely under 4mm in height required with the bottom case design.

KiCad rendering of my draft replacement PCB for the Forager keyboard
Draft replacement Forager PCB, direct wiring with battery cutout

Diode-free with Direct Wiring

Swapping to the Seeed XIAO nRF52840 plus (which costs only a fraction more to buy) let me easily redesign the Forager's twin PCBs to use direct wiring - one GPIO for each of the 17 switches in each half.  It was a little tedious, but not hard. In doing this I was almost able to get all of the wiring (other than the battery connection) on a single side of the PCB - which lead me to think about making this into a reversible PCB. That is, the two halves of the spilt keyboard use identical PCBs, but with the switches and controller etc mounted on opposite sides. This is attractive for small production runs as PCB fabrication often has a minimum of five boards (enough for two keyboards and a spare), and smaller boards are cheaper. This wiring was too much of a fun challenge to resist.

Replacing all 17 switch footprints in KiCad with a reversible (dual sided) version, and adusting the wiring net was easy but tedious. The dual-sided footprint solution for the battery connection I came up with turns out to be a minor variant of how at least two earlier DIY keyboards did this (seen later on Discord, neither are public as far as I know). Essentially a well placed cutout lets you solder either of the battery pads, but you only connect the B+ terminal (which will be on the opposite sides for the left and right boards), while using the ground pad instead of B- (soldering that would make a short here).

Close up of KiCad rendering of a double-sided Seeed XIAO nRF52840 plus footprint
However, despite having done two viable PCB designs (see the pull requests links above), I was still rather leary of the challenging soldering required for the tiny castellated pads on the Xiao Plus. That, and the call of Graph Theory was too strong - I could avoid hours of tricky tiny castellation pad soldering by spending even more time in KiCad!

Diode-free with Graph Theory - Partial Heawood Wiring

The first diode-free keyboard design using Graph Theory was the Heawood42, a wireless split design with 21 keys on each half. This used just 14 GPIOs thanks to the Heawood graph with 14 vertices and 21 edges. See my first keyboard blog post, explaining how the girth 6 Heawood Graph gives a 4-key rollover keyboard matrix, with a 7x7 scanning matrix.

KiCad silkscreen art - the partial Heawood Graph
KiCad silkscreen art - creating the partial Heawood Graph by removing a node.

Dropping a vertex and its three edges gives a partial Heawood Graph of 13 vertices and 18 edges - enough for a split 36-key design, and spare keys for the Forager. The original 
Seeed XIAO nRF52840 controller can be used by repurposing the two NFC pads on the back making 13 GPIOs, which I used for a sparse 7x6 scanning matrix. That was 6 scanning and physical columns of 3 keys (only 2 for the Forager thumb column), and 7 scanning rows.

Draft replacement Forager PCB with Graph Theory wiring

Space for the thru-hole soldering of the back pads is tight, especially for P0.10 tucked in the corner under the D6 pad, but I'm willing to give this a shot:

KiCad 3D rendering of PCB focused on Xiao controller
Some delicate thru-cut-out back soldering required

The other important cavaet is that, like the Heawood42, each half keyboard will only have 4-key rollover. This is a bigger problem in a non-split keyboard like my Gamma Omega Hesse, but still a limitation to keep in mind when planning a combo-rich layout. 

Firmware

After plugging in a controller by USB, the RGB LED colour cycles, and macOS sees it as:

            Seeed XIAO nRF52840 Sense:

              Product ID: 0x8045
              Vendor ID: 0x2886
              Version: 1.01
              Serial Number: 49C4BBA99B0EBB98
              Speed: Up to 12 Mb/s
              Manufacturer: Arduino
              Location ID: 0x03110000 / 3
              Current Available (mA): 500
              Current Required (mA): 100
              Extra Operating Current (mA): 0

Double-pressing reset it apppears as the XIAO-SENSE drive, and the INFO_UF2.TXT contained:

UF2 Bootloader 0.6.1 lib/nrfx (v2.0.0) lib/tinyusb (0.10.1-293-gaf8e5a90) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Seeed XIAO nRF52840
Board-ID: Seeed_XIAO_nRF52840_Sense
SoftDevice: S140 version 7.3.0
Date: Nov 12 2021 

This wasn't a sense version of the controller, but I went ahead and flashed both anyway, ignoring the seemingly harmless "The Finder can't complete the operation because some data in "xxx.uf2" can't be read or written (Error code -36)". The left controller shows up as expected:

            Acid:

              Product ID: 0x615e
              Vendor ID: 0x1d50
              Version: 3.05
              Serial Number: 486AD074793AA7C2
              Speed: Up to 12 Mb/s
              Manufacturer: ZMK Project
              Location ID: 0x03110000 / 3
              Current Available (mA): 500
              Current Required (mA): 100
              Extra Operating Current (mA): 0

Shorting pins to test keypresses in USB mode worked. The right controller does not show up as a keyboard, and alone is useless:

            Miscellaneous Device:

              Product ID: 0x615e
              Vendor ID: 0x1d50
              Version: 3.05
              Serial Number: D22B8BABBFA58F5F
              Speed: Up to 12 Mb/s
              Manufacturer: ZMK Project
              Location ID: 0x03110000 / 3
              Current Available (mA): 500
              Current Required (mA): 100
              Extra Operating Current (mA): 0

However with both the left and right controllers plugged into USB, they automatically pair and shorting pins on the right to simulate keypresses sends them to the left half wirelessly, which then sends them to the computer over the USB cable. Basic testing passed - this should be ready to use, although I will want to add LED control to my Forager Acid ZMK firmware later.

The Order 

The higher price of the two Xiao controllers more than outweighs this saving, but the smaller PCB and smaller 3D printed parts did cost less at JLCPCB than my monoblock keyboards:

  • PCB (5 pieces; defaults except white lead free HASL finish, and removed the order number from the board), USD $9.50 total
  • Top case (left & right), USD $4.03 each
  • Bottom case (left & right), USD $0.74 each
  • Legs (four pieces), USD $2.40 total

JLCPCB Merchandise Total: $21.44 (compared to $36.76 for the Hesse earlier this month, and $29.12 for the TC36K earlier in the year), Shipping Charge: $8.15, Customs duties & taxes: $5.97, Order Total: $35.56.

Then the misc components (about $20 on the controllers alone) including switches and keycaps. I'm not sure I want to know the grand total... and once again, I am hoping my soldering skills will rise to the challenge.

No comments:

Post a Comment