TTP224 Four-Channel Touch Detector Module with Arduino

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.

TTP224 Four Channel Touch Detector IC

This tutorial will view its pinout, configuration, features, specifications, interfacing,2D model, and applications.

TTP224 Touch Detector IC Pinout

The following diagram is the pinout of the integrated driver IC:

TTP224 pinout diagram Four Channel Touch Detector IC

TTP224 Pin Configuration

The following table lists the pin configuration details of TIP224 touch detector IC.

NumberPin NameFunction
1TP0Touch Key pin 1
2TP1Touch Key pin 2
3TP2Touch Key pin 3
4TP3Touch Key pin 4
5AHLBActive high or low output pin
6VDDPositive Supply pin
7VREGOutput internal Regulator pin
8TOGOutput type choice pin
9LPMBLow power, fast mode choice pin
10MOT1Key-on-time choice pin 2
11TPQ0DActive-low-open-drain-output pin
12TPQ0Direct Output pin 1
13TPQ1Direct Output pin 2
14TPQ2Direct Output pin 3
15TPQ3Direct Output pin 4
16SMSingle or multi-pin choice pin
17ODOutput Open-drain choice pin
18REGNInternal Regulator enable/disable choice pin
19VSSGround pin
20MOT0Key-on-time choice pin 1

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

How to set the Modes of Output pin?

To set the mode of the output, we are facilitated with three pins. AHLB gives a choice to select whether the output pins should be either direct active high or active low. Similarly, TPQ0, TPQ1, TPQ2, and TPQ3 output pins can toggle if the TOG pin is enabled. Moreover, OD makes the output pins as Open-drain if enabled.

The chart shown below should be put into  consideration to set the output combinations:

TTP224 setting output pins mode

How to connect Touchpads and TTP224

The schematic below shows the connections of touchpads to   TTP224 four-channel detector IC:

TTP224 external touch pad connections diagram

While designing a printed circuit board, successive points should be kept in mind for better performance:

  • Power supply stability is important.
  • The material covering PCB should not be metallic or electric.
  • Make use of filters and capacitors to minimize input noise.
  • C5 and C6 should be placed in the closest proximity of TTP224.
  • Place touchpads close to the IC
  • To control sensitivity over a vast range of temperatures, use either NRO or X7R capacitor.

Interfacing with Arduino

TTP224 interfacing with Arduino

Interfacing TTP224 Four-Channel Touch IC with Arduino is straightforward and easy. The wiring diagram is shown above, and the pin configuration is as follows:

TTP224 ModuleArduino UNO
GNDGND
VCC+3V
OUT1D2
OUT2D3
 OUT3D4
OUT4D5
RGB LED(common cathode)Arduino UNO
GNDGND
RD9(PWM)
GD10(PWM)
BD11(PWM)

In this circuit, we power the LEDs through a 3v Arduino pin, but if an external power source is used, one must connect the ground of the Arduino to the ground of the power. The TTP224 module has respective status pins for its touchpad keys. The inbuilt status pin will indicate which key is touched.  After making connections, upload the Arduino code. When any key is touched, the LED flashes a color according to the code, and the serial monitor will display the current state of the key. The results can be seen through the LED and Serial Monitor as well.

Arduio Code

#define PAD1 2 //Buttons pins
#define PAD2 3
#define PAD3 4
#define PAD4 5

//Arduino pins to which RGB LED connected
#define RED_LED 9  
#define GREEN_LED 10
#define BLUE_LED 11

// Variables to store PWM duty cycle for each LED

int Red=0, Blue=0, Green=0; //Color values to be affected to the RGB

//Boolean variable to store pad state

bool PAD1_State, PAD2_State, PAD3_State, PAD4_State; 


void setup() {
  
  Serial.begin(9600);        //Set Serial communication
  
  pinMode(PAD1,INPUT);    //Set pin modes
  pinMode(PAD2,INPUT);
  pinMode(PAD3,INPUT);
  pinMode(PAD4,INPUT);

  pinMode(RED_LED,OUTPUT);     
  pinMode(GREEN_LED,OUTPUT);
  pinMode(BLUE_LED,OUTPUT);
  
}

void loop() {

  Serial.print(Red);     //Display the colors values on the serial monitor
  Serial.print("\t");
  Serial.print(Green);
  Serial.print("\t");
  Serial.println(Blue);
  
  
  PAD1_State = digitalRead(PAD1); //Read the buttons states
  PAD2_State = digitalRead(PAD2);
  PAD3_State = digitalRead(PAD3);
  PAD4_State = digitalRead(PAD4);

  analogWrite(RED_LED,Red);       //Write the values on the RGB
  analogWrite(GREEN_LED,Green);
  analogWrite(BLUE_LED,Blue);

  if(PAD1_State == HIGH)   //Button 1 controls the RED, 2 Green and 3 Blue
     Red+= 20;                //Everytime you press the value gets incremented by 20 you can change as you want
  if(Red >= 255)              //If it exceeds the limit it will be brought back to 0
     Red=0;

   if(PAD2_State == HIGH)
   Green+= 20;
  if(Green >= 255)
   Green=0;

   if(PAD3_State == HIGH)
   Blue+= 20;
   if(Blue >= 255)
   Blue=0;

   if(PAD4_State == HIGH){ //Button 4 resets the value to 0
    
    Red=0;
    Green=0;
    Blue=0;
    
   }
  delay(100); //To avoid that one touch gets counted as 10 or more, although 100 is pretty big you can reduce it and test
}

TTP224 Alternative Options

  • TTP229
  • TTP226
  • ADS7843

Applications

  • Substitutes for traditional buttons
  • Different consumer products
  • Smart control

2D Diagram

The following figure shows the 2d model of TTP224 Four-Channel Touch IC. It shows us the physical dimensions of the components needed when a PCB card is designed.

Datasheet

The link to the datasheet is given below to see more details and specifications of the TTP224 Four-Channel Touch IC Detector.

Leave a Comment