Categories

Arduino and a TTP224 capacitive touch module

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 CAPACITIVE TOUCH

TTP224 4-CHANNEL CAPACITIVE TOUCH

 

Schematic

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

arduino and ttp224

arduino and ttp224

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

Share

Comments are closed.