Make Use of TTP226 to Transform Traditional Switches to Touch (8 Channel), How to use TTP226 module?, Schematic of TTP226 module with arduino NANO, Code for TTP226 module with arduino NANO, Applications of TTP226 module with arduino NANO

This module uses a TTP226 touch detector IC offering 8 touch keys. This IC has a low power consumption and is designed to replace the traditional pushbuttons. When we are a few millimetres away from a button the electronic circuit detects a presence and activates that particular button in a similar manner a push button would work. The module works at an input voltage of 2~5.5V and has separate channel for each input keypad which produces a high voltage when a key is touched on the module. The module has 64 steps sensitivity which is selectable. The sensitivity and the modes of the module can be changed to various settings by applying a link on the header pins which we will solder on the module. Please note that the main pins which give output of the module are already soldered, we need to solder the header pins on the SE1, SE2, SE3, SE4 and AHL pins. We can access various settings of the module by applying links between any two pins. The module has 3 modes, that is direct mode, serial mode and matrix mode. Matrix mode has further 2 X 4 matrix type and 3 X 3 matrix type.

8 Channel Capacitive Touch Sensor Module is easy to interface. It can be used along with a microcontroller or an arduino or even without one.

    Buy TTP226

How to use the module?

We can use the module directly by connecting certain devices to the output pins of the module like relays, displays, thermostats etc. or we can connect the module to an Arduino and use it to display the text on the serial monitor or an LCD display. Here we are connecting the module to an Arduino NANO and viewing the output on the serial monitor.

Connections: -

• Connect the GND pin of the module to the GND pin of the Arduino.
• Connect the VCC pin of the module to the 5V pin of the Arduino.
• Connect the OUT1 pin of the module to the digital pin 2 of the Arduino.
• Connect the OUT2 pin of the module to the digital pin 3 of the module.
• Connect the OUT3 pin of the module to the digital pin 4 of the module.
• Connect the OUT4 pin of the module to the digital pin 5 of the module.
• Connect the OUT5 pin of the module to the digital pin 6 of the module.
• Connect the OUT6 pin of the module to the digital pin 7 of the module.
• Connect the OUT7 pin of the module to the digital pin 8 of the module.
• Connect the OUT8 pin of the module to the digital pin 9 of the module.
Follow the instructions given above or use schematic diagram given below to connect the module to the Arduino easily.

 

How to use TTP226 module?, Schematic of TTP226 module with arduino NANO


Code: -

int key1=2; //OUT1
int key2=3; //OUT2
int key3=4; //OUT3
int key4=5; //OUT4
int key5=6; //OUT5
int key6=7; //OUT6
int key7=8; //OUT7
int key8=9; //OUT8
int ks1;
int ks2;
int ks3;
int ks4;
int ks5;
int ks6;
int ks7;
int ks8;
void setup(){
Serial.begin(9600);
pinMode(key1,INPUT);
pinMode(key2,INPUT);
pinMode(key3,INPUT);
pinMode(key4,INPUT);
pinMode(key5,INPUT);
pinMode(key6,INPUT);
pinMode(key7,INPUT);
pinMode(key8,INPUT);
}
void loop(){
int ks1=digitalRead(key1);
if(ks1==HIGH){
Serial.println("1");
}
int ks2=digitalRead(key2);
if(ks2==HIGH){
Serial.println("2");
}
int ks3=digitalRead(key3);
if(ks3==HIGH){
Serial.println("3");
}
int ks4=digitalRead(key4);
if(ks4==HIGH){
Serial.println("4");
}
int ks5=digitalRead(key5);
if(ks5==HIGH){
Serial.println("5");
}
int ks6=digitalRead(key6);
if(ks6==HIGH){
Serial.println("6");
}
int ks7=digitalRead(key7);
if(ks7==HIGH){
Serial.println("7");
}
int ks8=digitalRead(key8);
if(ks8==HIGH){
Serial.println("8");
}
delay(100);
}
According to the above code when we touch a button on the module it will be displayed on the serial monitor for as long as the button is touched.

Applications: -

• Security systems
• Alarms
• Safes
• Low pressure environment
• Extremely cold surroundings
• Gate access pads

 

Sensor & modulesTtp226