TTP224 capacitive touch module example

In this example I connect a TTP224 4-CHANNEL CAPACITIVE TOUCH module that I bought recently to an Arduino. This capacitive module offers 4 touch pads, here is a picture of this

 

TTP224-4-channel-digital-touch-capacitive-touch-switch-sensor-module

The TTP224/TTP224N TonTouchTM IC is capacitive sensing design specifically for touch pad controls. The device built in regulator for touch sensor. Stable sensing method can cover diversity conditions. Human interfaces control panel links through non-conductive dielectric material. The main application is focused at replacing of the mechanical switch or button. The ASSP can independently handle the 4 touch pads with 4 direct output pins.

Schematic

We connect the 4 outputs to Arduino pins 4 to 7, this is a basic schematic

arduino and ttp224 schematic

arduino and ttp224 schematic

Code

Copy the following into your Arduino IDE and uplaod the sketch, now open the serial monitor and press one of the number buttons. The serial monitor displays the button pressed.

 

int i;
 
void setup()
{
//set pins 4 - 7 as inputs
for(i=4; i<=7; i++)
{
pinMode(i, INPUT);
}
Serial.begin(9600);
}
 
void loop()
{
for(i=4; i<=7; i++)
{
if(digitalRead(i) == HIGH)
{
//I'm using pins 4 - 7 so subtract 3 to match
//numbering on module
Serial.println(i-3);
}
}
delay(100);
}

 

 

Links
1pc TTP224 4-way Capacitive Touch Switch Module Digital Touch Sensor

Related