
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 which measure down to nanometers. The sensor [Matthias Wandel] built with a Raspberry Pi Pico lands somewhere in the middle, providing both sensitive measurements and an absolute scale.
The idea is that the amount of overlap between two metal plates should be detectable by measuring the capacitance between them. Reaching any kind of usable resolution would require a very precise measure of capacitance, around the picofarad range. [Matthias] realized that the Pico’s GPIO pins have an inherent capacitance, and can have a pull-down resistor set, essentially creating an RC circuit. [Matthias] would set a pin to a high-level output, then switch it to an input. The amount of time the pin takes to switch from high to low indicates the RC constant, which includes the capacitance attached to the pin.
When attached to a metal plate, the Pico was sensitive enough to detect the plate’s capacitive coupling to [Matthias]’s hand through a thick wooden floor. To measure capacitance between two metal plates, the Pico measured how well a voltage signal applied to one plate was coupled to the other plate. This was sensitive enough to measure the slight change in the dielectric constant when [Matthias] waved a piece of ABS pipe between the two capacitor plates. Making actual position measurements was tricky, since capacitance changed with both X- and Z-axis shifts in the plates.
Digital calipers use similar capacitive sensors to make their measurements, as [Matthias] knows from his experiments in hacking them. If you’re interested in more details, check out this teardown of some cheap digital calipers.
Thanks to [H Hack] for the tip!