Connecting a basic Touch sensor
This example shows how to interface a basic touch sensor to our arduino, this sensor came as part of a kit of 37 sensors.
Touching the metal sensor pin produces an output at the ‘DO’ pin. The output is not a clean signal but craetes a 50 Hz mains induced signal . The output signal is ‘active high’ and the circuit sensitivity can be adjusted with the potentiometer. An analog output signal from the sensor is also available on pin ‘AO’.
These are connected as follows
|3||+||5 volt power|
So a quick and easy test is to write a sketch which outputs the digital and analog readings to the serial port and then see if we can get the readings to change
// Arduino pin numbers
//D2 and A0 used
const int digital = 2;
const int analog = 0;
Now compile and upload this and open the serial monitor and set the baud rate to 115200 and you should see something like the following
As you can see there are 2 sets of readings
The 0 and 1023 is the reading when no touch is detected. The 1 and 113 is the reading when a touch is detected
Here are links to the sensor kit
Ultimate 37 in 1 Sensor Modules Kit for Arduino from Amazon UK
Ultimate 37 in 1 Sensor Modules Kit for Arduino from Amazon US