Making a touchpad

← Back to Kevin's homepagePublished: 2020 June 25

I thought it’d be fun to try making a touchpad using cheap, generic components:

I’m following the approach outlined in this paper. The idea is that a human finger will capacitively couple two electrodes — so emit a PWM signal on electrode columns and measure the voltage along disconnected (but nearby!) electrode rows to determine 2D touch positions.

Here I’m using an STM32 microcontroller on a luxury PCB with firmware written in Rust. Total cost for the PCB, components, and shipping to Taiwan for five assembled boards was 29.26 USD (which is…wild).

My immediate focus is on improving the raw electrical signal-to-noise ratio, likely via passive analog filtering (though open to other avenues, since I have no idea what what I’m doing).

If I can get reasonable raw data, the next step towards using it as, say, a laptop touchpad would be to hook it up to an operating system. I have no idea what the USB HID stuff looks like for touchpads — if I’d need to implement touch/gesture recognition on the microcontroller or if I can pass pixel data to an operating system driver.

Another open area I’m curious about is why Mac’s touchpad experience is so much better than Windows and Linux (based on my subjective lived experience). Does Mac have some special sauce in their hardware? Is it all in the OS layer? Can a third-party device leverage it somehow? TBD.