Arduino Blog #8 TTP223 Touch Sensor by lapilipinas

View this thread on steempeak.com
· @lapilipinas ·
$3.53
Arduino Blog #8 TTP223 Touch Sensor
<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 &lt;Wire.h>  // include wire .h file 
#include &lt;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)
👍  , , , , , , , , , , , , , , , , , ,
properties (23)
post_id45,477,680
authorlapilipinas
permlinkarduino-blog-8-ttp223-touch-sensor
categoryblog
json_metadata"{"links": ["https://www.arduino.cc/en/Main/Software", "https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library"], "community": "busy", "tags": ["blog", "busy", "technology", "diy", "programming"], "app": "busy/2.4.0", "image": ["https://steemitimages.com/0x0/https://gateway.ipfs.io/ipfs/QmWHXPSDomWj3NR2LAfdkZdG3WuDHYmqa49tD7hH9PZmRn"], "format": "markdown"}"
created2018-04-26 08:06:51
last_update2018-04-26 08:06:51
depth0
children2
net_rshares554,406,222,214
last_payout2018-05-03 08:06:51
cashout_time1969-12-31 23:59:59
total_payout_value2.724 SBD
curator_payout_value0.803 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length4,605
author_reputation45,943,303,796,102
root_title"Arduino Blog #8 TTP223 Touch Sensor"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (19)
@steemmakers ·
<div class='pull-right'><center><a href='http://www.steemmakers.com'><img src='https://www.steemmakers.com/img/comment_logo_makers.png' /></a></center></div><b>Congratulations</b> This post has been upvoted by SteemMakers. We are a community-based project that aims to support makers and DIYers on the blockchain in every way possible. <br/><br/>Join our <a href='https://discord.gg/EFGbRuW'>Discord Channel</a> to connect with us and nominate your own or somebody else's posts in our review channel.<br/><br/><b>Help us to reward you for making it !</b> Join <a href='https://www.steemmakers.com/steemmakerstrail.php'>our voting trail</a> or <a href='https://www.steemmakers.com/steemmakersdelegation.php'>delegate steem power</a> to the community account. <br/><br/>Your post is also presented on the community website <a href='http://www.steemmakers.com'>www.steemmakers.com</a> where you can find other selected content. <br/><br/>If you like our work, please consider upvoting this comment to support the growth of our community. Thank you.
properties (22)
post_id45,670,364
authorsteemmakers
permlinkre-lapilipinas-arduino-blog-8-ttp223-touch-sensor-20180427t110957962z
categoryblog
json_metadata{}
created2018-04-27 11:09:54
last_update2018-04-27 11:09:54
depth1
children1
net_rshares0
last_payout2018-05-04 11:09:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,045
author_reputation1,905,460,717,963
root_title"Arduino Blog #8 TTP223 Touch Sensor"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@lapilipinas ·
thank you
properties (22)
post_id45,671,538
authorlapilipinas
permlinkre-steemmakers-re-lapilipinas-arduino-blog-8-ttp223-touch-sensor-20180427t112004331z
categoryblog
json_metadata"{"app": "steemit/0.1", "tags": ["blog"]}"
created2018-04-27 11:20:15
last_update2018-04-27 11:20:15
depth2
children0
net_rshares0
last_payout2018-05-04 11:20:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length9
author_reputation45,943,303,796,102
root_title"Arduino Blog #8 TTP223 Touch Sensor"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000