The Raspberry Pi isn't always the best tool for the job.
Raspberry Pi price hikes and the RAM apocalypse made microcontrollers the smarter choice for many DIY builds.
Capacitive displacement sensors span a wide range of resolution, from the touchscreen sensors which can only detect displacement as a binary state, all the way to the sensors in semiconductor fabs ...