<center>*This tutorial is an open source arduino project that teaches how to control TTP223 touch key switch senosor module i am going to use LCD 16,2 with i2 backpack to display the data from the module*</center>
![20180426_145209_HDR.jpg](https://gateway.ipfs.io/ipfs/QmWHXPSDomWj3NR2LAfdkZdG3WuDHYmqa49tD7hH9PZmRn)
<center>***Gather all the Requirements***</center>
<center><sub>1 pc Touch key switch module
Arduino Microcontroller board
16x2 LCD Display
Type B usb cable
PC
Breadboard
Jumper wires</sub></center>
----
![20180426_145037_HDR.jpg](https://gateway.ipfs.io/ipfs/QmcNbgtq7LQox9UbHNm3YYkTGcQENdtxpB4Kx6LKNsekQo)
<center>*The 16x 2 LCD with I2C module you will be able to connect the LCD with Arduino board with only two Data cables! The i2c module has a built in potentiometer bakpack for contrast adjustment. The 16x2 display is the set up LCD number of columns and rows ( 16 columns, 2 rows Display ). has 4 build in backpack pins (1) VCC it refers to the power signal of the LCD typically connected to 5volts, (2)GND or sometimes zero voltage, It is also the common connection of the LCD must connect to in one way or another path in order to complete the circuit. (3) SDA and (4) SCL is the i2c serial bus pin it is used to synchronize all data transfers over the I2C bus from the 16 pin of the normal LCD, Both SCL and SDA are connected to analog pin ouputs of the arduino beacasue i2c lines are open drain drivers, means is that the chip can drive its output low.*</center>
<center>***Connection of LCD To Arduino***</center>
![U5dtscBsyjBC5SyzpoZbaN8ZPJJuqi4_1680x8400.png](https://gateway.ipfs.io/ipfs/QmRbbzXaMcxbkYCzRxHy7ZBmFNtz3z4hofF1z6Uj3nQR3j)
<center>*A touch sensor is a type of switch that only operates when it's touched by a charged body. It has a high-frequency transistor which can conduct electricity when receiving electromagnetic signals.
The Sensor has 4 pins the power pins GND / VCC , the analog pin AO and the Digital pin output D0, use the digital pin output DO for sensor pin of the module to arduino.*</center>
<center>***Connection of Touch sensor to Arduino***</center>
![222.png](https://gateway.ipfs.io/ipfs/QmbUmjocwu1E6ZqCutcs9nKuf13g3hXUBNARSfZqipJrWc)
<center>*Dowload the arduino Desktop IDE: https://www.arduino.cc/en/Main/Software
When the download is finished, un-zip it and open up the Arduino folder to confirm that click yes, there are some files and sub-folders inside. The file structure is important so don’t be moving any files around unless you really know what you’re doing.*</center>
<center>*Download the liquidcrystal LCD library : https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library This library is a modified version of the H. Mario LiquidCrystal_I2C V.2.0 lib. then Include libraries to arduino IDE*</center>
<center>***SOURCE CODE***</center>
<pre><code>#include <Wire.h> // include wire .h file
#include <LiquidCrystal_I2C.h> //include lcd library
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // 16X2 lcd display address
int pin = 2; // pin connection of metal touch
void setup()
{
lcd.begin(16,2); // initialize the lcd
lcd.backlight();
lcd.print(" SENSOR "); // text to be displayed on the LCD when boot up
pinMode(pin,INPUT);
delay(1000); // delay time of the TEXt 1000 is equal to 1 seconds
lcd.clear();
}
void loop()
{
lcd.setCursor(1, 0); // first row cursor of the lcd
lcd.print(" TOUCH SENSOR "); // text displayed on the lcd
int val = digitalRead(pin); // reads the value of the touchpin
lcd.setCursor(0, 2); // 2nd row cursor
if(true == IsTouchec(pin)) // Text that the sensor has been triggered
{
lcd.setCursor(0,2); // text displayed at the 2nd row of the LCD
lcd.print("Sensor=Touch ");
}
else // otherwise
{
lcd.setCursor(0,2); // text displayed at the 2nd row of the LCD
lcd.print("Sensor=None "); // text that the sensor is not triggered
}
}
bool IsTouchec(int p)
{
int time = 0;
do
{
if (HIGH == digitalRead(p)) return true;
delay(1);
} while (time++<15);
return false;
}</code></pre>
<center>*Once the code is successfully uploaded to the board touch the plated touch pad with your fingers, this should change the none touch to TOUCH on the LCD indicate that the sensor has been triggered. thats all folks, if you have question drop it down below the comment thanks.*</center>
![20180426_145230_HDR.jpg](https://gateway.ipfs.io/ipfs/QmXnLQrBonPi1gKyGYjwYR9XWSiLDWaYY4NbANQxA14ARy)
----
![ee](https://steemit-production-imageproxy-web.s3.amazonaws.com/U5dsnt2Y19qmNJ6S4rHWGSU4yi4wucH)