Here is a good introduction to capacitive sensing. Read through it to see possible uses and helpful tips for making your own.
Here is my simplified and clarified revision of the example code: https://gist.github.com/ericjforman/8fd70b69a1751588aee1f9fcffa7cd42
Don’t forget to install the CapacitiveSensor library from the Arduino IDE:
- Go to menu Sketch / Include Library / Contributed Libraries, then search for “CapacitiveSensor”
Notice how the sensor can be very sensitive – you might want to smooth the input (use Arduino “Smoothing” example, or my own improved example on this site, search for smoothing.)
Leave a Reply