Keybaud Pi
A 60-key RP2040 keyboard that is a USB HID device and a serial-terminal keyboard at the same time, speaking standard xterm encoding over I2C.
Source, schematics and firmwarelautus-creations/keybaud-pi
- Status
- shipped
- Started
- Oct 31, 2026
- Stack
- RP2040, PlatformIO, Arduino-Pico, TinyUSB, EasyEDA Pro
- Repository
- GitHub
Keybaud Pi is a 60-key keyboard on a 100 x 60 mm board, built around a bare RP2040 rather than a Pico module. It does two jobs at once. Plugged into a computer over USB-C it is an ordinary HID keyboard with no drivers. Wired to a handheld terminal over I2C it answers at address 0x5F and sends the same bytes a standard terminal keyboard does: ASCII for characters and control keys, xterm escape sequences for everything else.
The firmware serves both interfaces, with no host detection and no mode switch. That is about the firmware, not the wiring. Only one of the two should ever be plugged in at a time, because connecting USB and the terminal port together can damage the keyboard and the host.
The terminal port expects 5 V. Its supply passes through a Schottky diode and a 3.3 V LDO, so the connector needs roughly 4 V or more before the RP2040 sees a solid rail. A 3.3 V source might work, but it is untested and the combined drop can brown out the RP2040. Ground has to be shared with the microcontroller reading the keyboard, including when the keyboard runs from its own 5 V supply.
The on-board I2C pull-ups sit behind a solder jumper that ships open, so the board never adds pull-ups to a bus that already has them. A host with none of its own needs that jumper bridged, or external resistors fitted.
Hardware
Board revision 0.1. Two PCBs stacked in a 3D-printed case.
| Block | Implementation |
|---|---|
| MCU | RP2040, 12 MHz crystal, W25Q128JV 16 MB QSPI flash |
| Keys | 60 tactile switches, 5 rows x 12 columns, one 1N4148W per key |
| Key grid | 7.5 mm column pitch, 7.0 mm row pitch |
| Switches | XKB TC-1102-B-G-B, 6 x 6 mm, 7 mm tall, through-hole, hand-soldered |
| Cover | A second PCB carrying the legends, with plunger and LED holes |
| Indicators | Three reverse-mount 1206 LEDs shining up through 2.0 mm board cutouts |
| USB | USB-C 16-pin receptacle, 5.1 kOhm CC pull-downs, USBLC6-2SC6 ESD protection |
| Terminal port | JST PH 2.0 mm 4-pin: GND, 5 V, SDA, SCL |
| Power | One Schottky per 5 V input into an XC6206 3.3 V LDO |
Every surface-mount part sits on one side of the board, which is what makes machine placement cheap: a fab house populates a single side in one pass. The switches face the other way, under the cover, so the indicator LEDs are reverse-mount parts that shine back through the board rather than sitting on the side the user sees.
The through-hole parts, 60 switches and the terminal connector, I soldered by hand. Nothing forces that choice. They can go on the assembly order too, at the usual cost of hand-placed and through-hole parts.
The key grid is square, 12 columns on 7.5 mm and five rows on 7.0 mm. What makes that pitch workable is that the switch bodies are rotated inside it. The footprint’s four pads span 6.5 by 4.5 mm, so square to the grid the nearest pads of two adjacent keys would be 1.0 mm apart. Rotated 16.5 degrees they are 2.24 mm apart. Fifty switches are at 16.5 degrees and the two columns at one end are at 18.

The cover is the only place the legends exist
The cover is a PCB with no components on it: white silkscreen on a black board, with the base legend, the Shift alternate beside it and the Fn legend above. It costs almost nothing to order alongside the main board, and the legends end up as durable as the board itself rather than printed on a keycap that wears.
It is drawn in the main board’s coordinate frame so the plunger holes, LED holes and mounting holes land in the same places, and its legends sit on the face the user reads. One consequence reaches into the firmware: the key map is mirrored left to right, so Esc at the top left is column L.
Firmware
PlatformIO with the Arduino-Pico core, using the Pico board profile for the 12 MHz crystal and the Winbond flash. Two builds ship: a bring-up test for a freshly assembled board, and the keyboard firmware.
The keyboard firmware registers its own HID device through the Arduino-Pico USB stack rather
than using the Arduino Keyboard library. With the library, Windows’ Caps Lock reports never
reached the firmware and the CAPS LED stayed dark.
There is a serial test mode. Type test into a serial monitor at 115200 and keys stop
reaching the computer; each press and release is logged, and t reruns the matrix short
test, l cycles the LEDs, m prints the key map. It never survives a reset, so a board
cannot be left in it by accident.
Fn+Ctrl+Shift+Esc reboots into the RPI-RP2 bootloader drive, so firmware updates do not require opening the case to reach BOOTSEL.

Terminal mode
The terminal side sends standard terminal encoding rather than a protocol of its own. Characters and control keys are ASCII. Arrows, Home, End, PgUp, PgDn, Delete and F1 to F12 are xterm escape sequences, with xterm’s modifier parameter when Shift, Alt or Ctrl is held. Any serial terminal program, shell or terminal library can read the stream without a translation layer, because there is nothing to translate.
Mechanically it is a 64-byte FIFO read one byte at a time, returning 0x00 when empty. An escape sequence is queued in one piece, which is what makes a multi-byte sequence safe over a protocol that hands out one byte per read. It also resolves the obvious ambiguity: a 0x00 immediately after 0x1B means the Esc key itself, not the start of a sequence that got torn in half.
Modifiers are held rather than sticky, and Caps Lock is tracked on the keyboard. Bytes are queued on key down, with repeat at 500 ms then 30 per second. Writes are accepted and ignored, reserved for Caps Lock and LED control later.
One bench finding that cost real time: the I2C link needs a direct ground wire to the host. With ground reaching only through mains earth, about 30 percent of reads failed and some returned flipped bits. Pull-ups, bus speed and the target handler made no difference. A direct ground wire took it to zero failures across thousands of reads.

Where it stands
Done. Rev 0.1 works and is tested on every board built so far.
If there is ever a rev 0.2, one change drives it: the terminal connector should accept 3.3 V as well as 5 V, defaulting to 5 V so a board behaves exactly like this one out of the box. Today it needs roughly 4 V or more once the Schottky drop and the regulator’s dropout are counted, which means a 3.3 V host has to boost before it can feed the keyboard. That affects the I2C connection only. The USB path is unchanged either way. Selecting between two rails probably means a 3-pin jumper rather than the two-pad solder jumper this board uses.
Two others are still open. Where the board takes its power from could become a three-way selection: the terminal port, USB-C, or both. And the jumpers would likely change form, since a solder jumper is fine for something set once at build time and wrong for anything a user might reasonably want to move. Pin jumpers are the probable answer, most likely 2 mm pitch right-angle headers to keep the added height down.
Two smaller things sit on the terminal side rather than on this board. The write-register map is undefined, so writes are accepted and ignored. And the I2C pull-up value waits on knowing the host bus, which is why the jumper that connects the on-board pull-ups ships open.