ESP32 LoRa Micro Keyboard

picture of micro keyboard

Ya know what I miss? Phones with keyboards.

This micro keyboard is my first fully SMD design, featuring 40 micro tactile switches. Apparently undeterred after the challenges of soldering in a TQFP64 in the CPLD BLASTER 72, I decided to try soldering in a bunch of tiny things with extremely tiny leads using nothing but a soldering iron and my wits. I did get smart eventually.

It's designed to attach to one side of the Heltec ESP32 WiFi LoRa 32 v2 to form a tiny battery powered "hackberry".

Because of the limited I/O available (just 7 pins, some of which are input-only) I used a 74HC138 to demultiplex three pins into eight column drivers. It has one diode per column to prevent shorting across the column drivers. There are five pull-up resistors for the rows. The keys are active-low due to the nature of the 74HC138 selecting a low output.

I had a few issues getting the scan routine to work correctly. It turns out the weak pull-ups, standard diodes, and the inability to switch all of the 74HC138 outputs simultaneously caused a bit of glitching when reading. Adding a small delay after setting the columns cleared up the issue. Using a decoder also means there's no way to turn off the column outputs, nor can you set them all low for interrupt-based triggering. You have to scan as long as you want to detect keys.

If you're building this, I would recommend using 10K pull-ups and schottky diodes. Regular diodes lower the row voltage level and the 47K pull-ups result in some delay in that voltage reaching its peak. It leaves the inputs in the ambiguous zone for too long.

Overall this was not a great design for a battery-powered device, but it was a good (and relatively cheap) introduction to keyboard design both in hardware and software.