Introduction: INTERFACING TTP224 Four-Channel Touch Detector Module With BHARAT -PI

In this article, We will interface with TTP224 four-channel touch detector module with bharat pi. We will also discuss its working Principle, pin out, features, modes of operation and finally we will write a simple program to interface it with bharat pi.

capacitive touch sensorworks by using the principle of capacitance, which is the ability of a capacitor to store electrical charge. When a human body, such as a finger, approaches the sensor, a capacitance is created between the sensor and the body. The body and the sensor act as the plates of a capacitor, and this results in the induction of a charge between them.

Step 1: TTP224 Capacitive Touch Sensor(INTRODUCTION)

TTP224 is a non-contact four-channel touch sensor IC designed to replace traditional buttons for effortless control. As the name suggests, it has four touch keys. It works by detecting the input capacitive touch and varying the capacitance to trigger the switch. Powering this IC needs only a few volts. It comes with an auto-calibration attribute with a period of 4.0sec if no touch is detected. It is effortless to interface with any microcontroller either for smart control or hobby projects.


Step 2: TTP224 Pin Configuration

  • NO Pin NameFunction
  • 1 TP0 Touch Key pin 1
  • 2 TP1 Touch Key pin 2
  • 3 TP2 Touch Key pin 3
  • 4 TP3 Touch Key pin 4
  • 5 AHLB Active high or low output pin
  • 6 VDD Positive Supply pin
  • 7 VREG Output internal Regulator pin
  • 8 TOG Output type choice pin
  • 9 LPMB Low power, fast mode choice pin
  • 10 MOT1 Key-on-time choice pin 2
  • 11 TPQ0D Active-low-open-drain-output pin
  • 12 TPQ0 Direct Output pin 1
  • 13 TPQ1 Direct Output pin 2
  • 14 TPQ2 Direct Output pin 3
  • 15 TPQ3 Direct Output pin 4
  • 16 SM Single or multi-pin choice pin
  • 17 OD Output Open-drain choice pin
  • 18 REGN Internal Regulator enable/disable choice pin
  • 19 VSS Ground pin
  • 20 MOT0 Key-on-time choice pin 1

Step 3: Features and Specifications:

·       Response time : 100msec-200msec

·       Low Operating voltage: 2.5-5.5 Volts

·       Operating current : 2.5 uA -9.0 uA

·       Can adjust sensitivity externally by a capacitor (0-50pF)

·       Provides a choice pin(LPMB) to select the fast or low power mode

·       Select direct or toggle power mode

·       Provides a choice pin to select active high or low output pin

·       Make the output open-drain

·       Inbuilt maximum on key time setting to return the system to the power-on state

·       Inbuilt no diode protection circuit output pin(TPQ0D)

·       Auto-calibration attribute of 4.0 sec if no touched is detected

·       Touch stability with a stability time of 0.5sec

Step 4: REQUIREMENTS

  1. ·      Bharat-pi (board)
  2. ·      Jumper wires
  3. ·      Aurdinno-ide
  4. ·      TTP224 Capacitive Touch Sensor

Step 5: Interfacing TTP224 Capacitive Touch Sensor BHARAT -PI

  1. VCC - 5V
  2. GND - Gnd pin
  3. OUT(4) - 32 PIN
  4. OUT(3) - 27 PIN
  5. OUT(2) - 26 PIN
  6. OUT(1) - 25 PIN

Step 6: SOURCE CODE AND PROGRAMMING

const int SENSOR_PIN4 = 32;

const int SENSOR_PIN3 = 27;

const int SENSOR_PIN2 = 26;

const int SENSOR_PIN1 = 25;

void setup() {

 Serial.begin(9600);

 // initialize the Arduino's pin as aninput

 pinMode(SENSOR_PIN1,INPUT);

 pinMode(SENSOR_PIN2,INPUT);

 pinMode(SENSOR_PIN3,INPUT);

 pinMode(SENSOR_PIN4,INPUT);

}

void loop() {

 if(digitalRead(SENSOR_PIN4) == HIGH){

  Serial.println("Sensor 4 is touched");

  while(digitalRead(SENSOR_PIN4) == HIGH){}

 }

  else

  if(digitalRead(SENSOR_PIN3) == HIGH){

  Serial.println("Sensor 3 is touched");

  while(digitalRead(SENSOR_PIN3) == HIGH){}

  }

  else

  if(digitalRead(SENSOR_PIN2) == HIGH){

  Serial.println("Sensor 2 is touched");

  while(digitalRead(SENSOR_PIN2) == HIGH){}

  }

  else

  if(digitalRead(SENSOR_PIN1) == HIGH)

{

  Serial.println("Sensor 1 is touched");

  while(digitalRead(SENSOR_PIN1) == HIGH){}

 }

}

code avilabel at git hub : https://github.com/Madhankarthick/TOUCH-SENSOR-CODE-FOR-BHARAT-PI/blob/4cced85111b4862b66510cce9585730d7977cafe/TOCH%20SENSOR.txt

Step 7: FINAL OUTPUT (SERIAL MONITOR)

Step 8: Applications

  1. Consumer electronics, such as smartphones, tablets, laptops, and wearables
  2. Automotive industry, such as infotainment systems, climate control, and other in-car systems
  3. Home appliances, such as touch sensor faucets and smart home devices
  4. Robotics, such as enabling basic movement and touch detection
  5. Security systems, such as keypads and locks
  6. Industrial applications, such as pressure and distance measurement


Step 9: Video