KeyboardWhiz hardware background

A project log for All About Laptop Keyboard Reuse

Reverse-engineering laptop keyboards: theory, hardware, and sharing data

aryaArya 06/11/2022 at 22:000 Comments

Laptop keyboard FPCs can have up to 32 pins - and "keyboard+other things" connectors, on like Thinkpad or Framework keyboard modules, can even have up to 50 pins. It's hard to find a cheap USB-capable microcontroller with so many pins.

A typical keyboard uses 24 pins for the actual keys and 3-4 pins for the LEDs. The keyboard FPCs often have 30-32 pins, however - a portion of them NC. This doesn't work.

An Arduino Pro Micro has 18 GPIOs, which is nowhere near enough. Microcontrollers like Teensy tend to be of more help - Teensy 2.0 has 26 GPIOs available, which even allows for two LEDs. Bigger Teensies have more pins, but they're way too expensive for this project's goals. A Pi Pico has 26 GPIOs available too, and is cheaper. Plus, the RP2040 chip itself has 30, so it should be possible to add more features if you make a custom board with the RP2040.

However, in order for 24 pins to be sufficient, you still need to know which pins are used and which aren't - if you don't know that, you still need 32 pins; and for an universal keyboard RE adapter, the assumption is that you don't know which pins are which.

Because of this 32 GPIO requirement, I use GPIO expanders in the KeyboardWhiz. Two 16-bit or four 8-bit GPIO expanders can provide 32 IO pins - leaving the microcontroller with quite a few extra GPIOs. For instance, you can control many extra keys, PWM the backlight control circuit, or even interface to a touchpad over I2C. I use I2C expanders, but it's possible to use SPI expanders, too.

The original KeyboardWhiz only had I2C expanders and connectors on it - so you'd have to connect it to a Raspberry Pi or a HDMI-I2C breakout of some sort, and run Python code communicating with these expanders. As such, it couldn't work as a USB keyboard controller, either. The next KeyboardWhiz version will have a RP2040 in addition to expanders, so you can take control of way more features.