Helen Frankenthaler PCB Circuit Board R&D Center

flexible pcb keyboard

The Smallest Keyboard

The Smallest Keyboard

I couldn't find a keyboard small enough for wearables and extremely small PCs, so I made one.

v2 'alpha'

Hardware:

v2 'alpha' pick and place

Comma-Separated Values - 21.38 kB - 04/23/2023 at 09:27

v2 'alpha' bill of materials

Comma-Separated Values - 3.12 kB - 04/23/2023 at 09:27

v2 'alpha' Gerber RP2040 circuit/4 layer

x-zip-compressed - 74.63 kB - 04/23/2023 at 09:27

Importable .json file for EasyEDA (File --> Open --> EasyEDA)

JavaScript Object Notation (JSON) - 497.13 kB - 01/13/2022 at 15:26

Code:

CircuitPython / Pi Pico 'firmware' for the keyboard

py - 5.64 kB - 01/04/2022 at 22:24

  • 59× B3U-1000P Microswitch
  • 1× PCB (files attached)
  • 1× Raspberry Pi Pico Microcontroller
a smaller keyboard has entered the chat

TEC.IST • 04/23/2023 at 12:04 • 0 commentsMy 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: https://www.signalintegrityjournal.co... ], 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 [ [https://www.frankenthalerfoundation.org ] 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...

Code Complete

TEC.IST • 01/05/2022 at 22:40 • 0 commentsThe code is complete! See code.py in the project attachments. There is also a video walkthrough of the code here:

The PCB

TEC.IST • 12/16/2021 at 01:02 • 0 commentsI received feedback on the Threadripper Laptop video that some would have liked to see a build video along the way. Well, here goes for the next project. The first component I'm nailing down is a very small keyboard, around the size of three pennies in a row.

There are BlackBerry keyboard-to-USB kits out there, though they require adapters and don't give you the full range of keys you might use with a PC.

There are small(-ish) key matrix decoder keyboards out there as well, though the tactile switches tend to be larger and spaced further apart.

What I settled on was a 59-key keyboard in the footprint of the Raspberry Pi Pico, with the microcontroller handling the key matrix decoding and USB interface.

The keyboard has a standard QWERTY layout with a full number row, symbol keys typical of a PC keyboard, Escape, CTRL, ALT, Shift, Backspace, Enter, Space, and directional arrows.

To fit it all in I found a very small tactile switch, the B3U-1000P, measuring just 3.0 x 2.5 x 1.6 mm. Making key matrix connections by hand in such a tight space would be miserable, so a PCB was the way to go. I went with JLCPCB because Easy EDA (their online PCB design tool) is, well, easy. There are top and bottom traces, as the matrix needs to crisscross.

The matrix is decoded by two nested loops: one through rows and one through columns. Each key has it's own unique row and column combination. The microcontroller loops through each possible combination and returns the value corresponding to the key pressed.

One potential downside to this approach is ambiguity when multiple keys are pressed at the same time, i.e. which key am I intending to hit and in which order. Some keyboard circuits use diodes to prevent this, but these are omitted here due to space considerations and because the ergonomics of this particular keyboard having to be carefully pressed often by fingernail, it is unlikely to run into multiple keys being pressed at the same time. Exceptions are any keys that can modify the meaning of another: CTRL, ALT, and Shift can all be read independently to see if the key being pressed is being modified in any way by these keys.

I originally named the keys according to their content, including special characters, so helpful labels would print on the PCB, but JLCPCB's systems ended up not playing nicely and left two switches out of the pick and place arrangement. I modified these names to remove the special characters that caused problems before uploading the project files.

Small batch PCB cost is around $10 per board, not awful considering there are 59 placed components and several large pads for direct soldering to a Raspberry Pi Pico (the black PCB and lead free options were nice as well). Adding the cost of a Pico and economy shipping, this can be replicated for around $20 per unit in batches of 5+ units.

Project files including the PCB and pick and place file are linked in the description.

In the second installment, we'll write the key matrix decoder.

Discussions

Log In/Sign up to comment

Become a Hackaday.io Member

Create an account to leave a comment.Already have an account?Log In.

Colpr wrote 11/10/2023 at 12:58

I have small little hands but even for me this is too small. The good thing about small hands is their nice when soldering components.

Are you sure?yes | no

TEC.IST wrote 03/24/2023 at 16:14

Sorry, just seeing this now. Yes, go for it. This schematic, pcb, and supporting code (the part I wrote, Circuit Python is from Adafruit) are in the public domain.

It would be great if you post a link to your project here, because whatever makes it different will make it a better fit to some use cases (and I'm curious how and where projects are eventually used!).

Are you sure?yes | no

TEC.IST wrote 03/24/2023 at 15:52

Sorry, just seeing this now. I have a couple extra due to PCB assembler minimums and can just mail you one. Drop me a message here (hackady.io direct message).

Are you sure?yes | no

asutrem wrote 01/12/2022 at 18:26

hi! is it possible for you to share the easyeda project? i would like to edit the silkscreen as the letters are covered by switch outlines. thank you!

Are you sure?yes | no

TEC.IST wrote 01/13/2022 at 15:35

Yes, I attached the EasyEDA-native .json to the project page under 'Files' or directly download here:https://cdn.hackaday.io/files/1591975832779936/PCB_Pico%20Keyboard%20PCB_2022-01-13.json

Are you sure?yes | no

TEC.IST wrote 01/13/2022 at 15:39

I've seen some interesting microcontrollers with wireless options -- picking a battery, attachment method, etc. that wouldn't make it dramatically thicker could be tricky

Are you sure?yes | no

TEC.IST wrote 01/13/2022 at 15:41

I don't think I'll be revisiting this version. Here is the EasyEDA file: https://cdn.hackaday.io/files/1591975832779936/PCB_Pico%20Keyboard%20PCB_2022-01-13.json

See the code for the null row/column combinations and you could potentially work in a right alt key onto one of those spots.

Are you sure?yes | no

Alexandra Bastet Stehr wrote 12/18/2021 at 15:20

Somehow ordering with JLCPCB is broken with your board, the PCB itself gave a warning that it could be broken when manufactured and trying to add the BOM and Pick&Place file resulted in a bill of over 150€ and a preview that has the parts way over the edge of the board.

If i could add images i would, i hope links are OK on this site:

https://lionscade.de/zeugs/Screenshot_2021-12-18%20PCB%20Prototype%20PCB%20Fabrication%20Manufacturer%20-%20JLCPCB.png

Are you sur