martin2250 / ADCTouch

touch sensing library for Arduino
MIT License
101 stars 24 forks source link

ADCTouch

ADCTouch is a library that allows users to create a capacitive sensor without ANY external hardware.

Purpose

Most capacitive touch libraries require two pins and a large resistor to acquire precise readings. This library makes use of the AVRs internal wiring to get decent resolution with just a single pin.

Usage

int val = ADCTouch.read(byte analogChannel, int samples = 100);

How it works

To Acquire a reading, the library does the following:

The accuracy is really good, most often even the LSB/smalles digit can still yield usable data and just vary by a single unit between readings (at only 100 samples, more will mean even less variation). The sensitivity is phenomenal, with a large enough surface, it can sense a person in more than 2 feet distance.

A more accurate explanation can be found here