I got involved with Arduino during my Covida in an effort to help my friend with a Bluetooth LE remote like one of those presentation gizmos to move between slides. At that time, I never even thought of putting two chips on a PCB by myself, but I was quite unhappy about the design choices. For example, each button was connected to a different MCU pin and when the number of buttons was increased the UART pin was used making debugging a nightmare. It took quite some time to understand why the board would reset in debugging mode with some key presses.

I knew from a kid, Commodore 64 did it, that 64 keys could be arranged on a 8x8 matrix requiring only 16 pins. The remote had 15 buttons and using a 3x5 matrix would reduce the number of required pins by half! I also didn't like the choice of the switches so for fun I decided to build one myself. A keypad is exactly the first type of project to get involved into PCB design. So I built my 3x4 matrix keypad and happily verified that the same functionality was possible with a little bit of code rearrangement.

But it didn't stop there. How low can you go with the number of pins? I discovered Charlieplexing, which allows a configuration of Nx(N-1) buttons, with N the number of pins. But I also discovered I2C and GPIO expanders. Suddenly the lowest limit of 2+2 pins for theoretically any KB size was reachable. But would a GPIO expander be able to handle a keyboard matrix configuration where you need to keep one output LINE on while reading from the input ones?

A sponsorship from PCBWay allowed me to iterate on my original design based on a Feather format to a very compact design that not only handles keystrokes, but also supports battery charging and gauging, and even a power on-off switch.