How to interface Capacitive Touch (ttp223b) Sensor with Arduino

10,117 views

The ttp223b is a capacitive touch sensor module and the sensor driver is based on the driver IC TTP223. This capacitive touch sensor is an ideal alternative for old-fashioned keypads and buttons. The operating voltage of the TTP223 IC is from 2V to 5.5V and the power consumption of the touch sensor is very low.

TTP223 is a touch indicator IC that offers 1 touch key. This touch detection IC is designed as a substitute for the traditional direct button key with a diverse pad size. Touch sensors allow electronic devices to sense when your finger is within a few millimeters of a surface to simulate a button “push” just like how the pushbutton works.

Hardware Components

Following components are required to make Capacitive Touch Sensor

S.NOComponentValueQty
1.Arduino Uno R31
2.USB Cable A/B1
3.Capacitive Touch SensorTTP223B1
4.LED5mm1
5.Breadboard1
6.Connecting Wires1

Capacitive Touch Sensor TTP223b pinout

capacitive touch sensor ttp223b pinout

Useful Steps

Follow all steps carefully from the video tutorial at the end of this post (Highly Recommended).

  • STEP # 1 ( Make Touch Sensor Connections )
  • VCC – To VCC of Arduino.
    GND – To GND of Arduino.
    SIG – To D2 of Arduino.
  • STEP # 2 ( Connect LED )
  • Cathode(-) – To GND of Arduino.
    Anode(+) – To D13 of Arduino.
  • STEP # 3 ( Upload Code )
  • Download code and upload it to Arduino Board using Arduino IDE Software
  • https://www.arduino.cc/en/Main/Software

Circuit Diagram

Touch Capacitive Sensor
Touch Capacitive Sensor

Working Explanation

The TTP223 touch sensor module provides a single integrated touch sensing area of 11 x 10.5mm with a sensor range of ~5mm. An on-board LED will give a visual indication of when the sensor is triggered. When triggered the module’s output will switch from its idle low state to high. Solder jumpers allow for reconfiguring its mode of operation to be either active low or toggle output. 

Arduino Code

int ledPin = 13;
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(0.9); 
}

Applications

  • Capacitive touch sensing may be used in any place where low to no force touch sensing is desired.