Sketch for a capacitive proximity / touch sensor with Arduino. This sensor based on a square wave generator rather than charge time measurement as the popular CapSense library. This design results in very stable sensor readings and it also works from a battery. It is compatible with virtually every Arduino board and even with most ATtiny chips. The sketch depends on my Arduino frequency counter library.
For details and the hardware description, visit http://dlacko.org/blog/2017/01/08/arduino-capacitive-proximity-sensor-with-signal-generator/