Tutorial : TTP223B Sensor Touch Module

Step :

Like  a lot of the sensors out there, this is three pin sensor.  You provide, power, ground and monitor the output.

Catalex Capacitive Touch Sensor Pin Outs


Connect the Touch Sensor to Your Arduino

This is a real simple set up.  You will know that you have power properly applied when the green LED is on.

Arduino Capacitive Touch Sensor Tutorial


Upload the code to Arduino sketch


// Henry's Bench
// Capacitive Touch Sensor Tutorial
 
// When Sig Output is high, touch sensor is being pressed
#define ctsPin 2 // Pin for capactitive touch sensor
 
int ledPin = 13; // pin for the LED
 
void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);  
  pinMode(ctsPin, INPUT);
}
 
void loop() {
  int ctsValue = digitalRead(ctsPin);
  if (ctsValue == HIGH){
    digitalWrite(ledPin, HIGH);
    Serial.println("TOUCHED");
  }
  else{
    digitalWrite(ledPin,LOW);
    Serial.println("not touched");
  } 
  delay(500);
  
}

Test Your Arduino Sketch

When you done uploading ,Open your serial monitor.   Touch the sensor pad while looking at the monitor.   You may see an output that looks something like the picture below.

Arduino Capacitive Touch Sensor Tutorial Output