Capacitive Touch for Particle IDE


I have been scouring the forums and internet searching for a reliable capacitive touch algorithm for Particle’s development boards. Something akin to Paul Badger’s lovely Capacitive Touch Library built for Arduino (found here:
I have been using some attempts at a translation of this (, but I have experienced poor reliability with this code, and I get some moments of weird oscillating readouts when I touch a contact point (wiring here: I have a fair amount of confidence that this is not a wiring issue, as I have tried the same circuit with Arduino+Capacitive Touch Library which works consistently with no oscillation.

I wanted to do a quick sanity check with the community to see if there is a reliable algorithm/library that has been developed to simulate Paul Badger’s capacitive touch library for the Photon before I journey down the rabbit hole of trying to re-engineer one myself.

@Colin1 In my experience it is more reliable to use a capacitive touch controller IC such as Freescale’s MPR121. This is a capacitive touch sensor controller driven by an I2C interface. There is a library for this in the community space and I can vouch it works well out of the box. If you want to dig deeper then you can use the parameters exposed via the API to this IC to condition the signal for your specific application.