*a smaller keyboard has entered the chat*

A project log for The Smallest Keyboard

v1 USB keyboard approximately the size of three pennies in a line; v2 around the size of a quarter

tecistTEC.IST 04/23/2023 at 12:040 Comments

My previous tiny keyboard was designed for direct soldering to a Raspberry Pi Pico, so what made sense at the time for ergonomics (lol) was to use the largest tactile switches that fit the given footprint.  The PCB routing was relatively simple, considering the only components were the switches and the traces just had to form a matrix that lined up with the Pico's GPIO pads.

However, there are smaller switches available.  I also took a few points of feedback from the DIY hardware community, among them: ditching the micro USB of the Pico in favor of USB Type-C, and adding back the right ALT modifier key, which is apparently critical for entering Polish characters.

Starting with a blank sheet design led me to a custom RP2040 circuit and a four-layer PCB stackup (to be fair the prior design was also four layers, two for the keyboard traces and two layers on the Pico board).  The end result is a keyboard with a cross-section about the size of a quarter, wearing a USB Type-C port for a backpack.  The PCB is reduced from the 51 x 21 mm of the prior design to 29 x 16.25 mm.

Design compromises include moving from a square ground pad for the RP2040 to a circular one to fit in additional traces under the RP2040 (which when it intersects with the solder mask paste layer, might be cropped back to a square anyway by the PCB assembler given that this layer is ostensibly what they use to cut the stencil), some very tightly placed vias occupying two input pins, and the four layer stackup itself.  I wonder if it's possible to get back to a 2-layer PCB with a little bit better spacing, especially moving the RP2040 to a more central location on the board.  I don't love where the right ALT key landed either, specifically it being to the right of enter -- it looked better positioned in the EDA software than in the render, but after seeing the 3D view, it is probably best rotated 90 degrees, placed just above the up arrow, and then enter can be shifted over a bit to the right.  There are also a reduced number of decoupling capacitors (although an increased overall capacitence due to using much higher values), beginning to implement power integrity advice from Bogatin, et al., "The Myth of Three Capacitor Values" from Signal Integrity Journal [ free to read here: ], which boils down to: in the age of surface mount parts, for power circuits, you might as well use the largest capacitor value that is available in the component body size you have to work with (here 0204-sized components and sticking with the JLCPCB basic parts library, you might as well use the 10uF value in place of 1uF or 0.1uF/100nF -- although, considering 2-sided assembly at JLCPCB means you can't do economic PCBA, i.e. with standard PCBA 0201 parts are also on the table).

Given the two-sided assembly, cost is steep relative to the components at around $25 per PCB in small batches of 5.

The ubiquitous Pro Micro keyboard PCB or the Adafruit KB2040 [ ] could also be options for direct solder.  The footprint of either, at around 1.3 inches, is just a little wider than this assembled version (but still smaller than the Pico footprint).  Using one of these would reduce the assembly needed to just the keyswitch matrix, and the firmwares are already worked out, so this is probably the way to go for small stuff like wearables, so you can live out any residual calculator/PDA watch fantasies you might have.

The PCB design, BOM, and Pick and Place files are available.  Pros and cons are as noted earlier.  If anyone has this or something similar assembled, I'd recommend asking your PCB fabricator to have a look at the paste mask layer under the RP2040 to okay it, perhaps sprinkling a couple decoupling caps close to the RP2040 if you can, and double-checking each route as I have not built this intermediate version.  Until next time...