Touch sensor module : keyes- 036 and LCD on arduino

avatar

What Will I Learn?
how was the metal touch works on Arduino
how to program a code on Arduino Desktop IDE
how to connect all the components connection using diagram
how to connect LCD 16X2 on Arduino Uno.

4t

HARDWARE
Step 1: Gather all the Requirements
Requirements
Breadboard or PCB
LCD 16X2 with i2 breakout
Keyes ky- 036 metal touch sensor
jumper wires
Type B USB cable
Arduino UNO R3 board
PC
Difficulty
Basic
Tutorial Contents
SOFTWARE

Step 2: Download the Software and Libraries
If you’re ready to get started, click on the link below then select the version with your operating system.
Download 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.

Download the liquid crystal 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.

Step 3: Include libraries to arduino IDE

tgr

Once installed the Arduino desktop IDE. open the software then locate the SKETCH tab at the top of the software, navigate ADD ZIP LIBRARY >> then look for the downloaded libraries in the download folder. SELECT the zip file then wait for the process. include all the libraries fo liquid crystal display.

Experimental Procedures
Step 4: Build the circuit

The Arduino UNO R3

g5g

it has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button. 32k Flash Memory,
source

codes and programs can be uploaded on to it from the easy Arduino computer program. which makes it a very easy way to get started working with embedded electronics. The name R3 is the third, and latest version of Arduino Uno Board

Connection of LCD 16X2 to Arduino
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 backpack for contrast adjustment. The 16x2 display is the setup LCD number of columns and rows ( 16 columns, 2 rows Display ).

54t

The LCD has 4 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 outputs of the Arduino because i2c lines are open-drain drivers, means is that the chip can drive its output low.

4g

LCD Pin output connection to arduino

GND- GND
VCC - 5V
SCL - A4
SDA - A5
The Metal touch sensor

53

A metal 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. reference

the key - 036 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.

6t66

connection to Arduino

GND - GND
VCC - 5V
DO- D2
Step 5: Building the code
Open the Arduino Desktop IDE then type the codes

CODE:

#include // include wire .h file
#include // include the i2c 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 set.png

void setup()
{
lcd.begin(16,2); // initialize the lcd
lcd.backlight();
lcd.print("METAL TOUCH"); // 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();
}
loop.png

void loop()
{
lcd.setCursor(1, 0); // first row cursor of the lcd
lcd.print("Metal Touch"); // 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;
Step 6: copy the sketch code to Arduino IDE sketch bar. click the UPLOAD icon on the upper right side toggle, it will automatically compile the sketch to check if there's an error with the code before uploading to the Arduino board.

tyh
once the code is successfully uploaded to the board touch the electrode of the transistor with your fingers, this should change the none touch to TOUCH on the LCD indicating that the sensor has been triggered.

7h6

I hope this tutorial might help you on your future activity. thank you.



0
0
0.000
4 comments
avatar

Much of the content is copied from

It's like sewing a new tutorial by grabbing matching excerpts from other articles. Actually, it's hard to find a paragraph or sentence that is not copied from elsewhere. I think the only original text added here is near to the bottom:

Open the Arduino Desktop IDE then type the codes

and

once the code is successfully uploaded to the board touch the electrode of the transistor with your fingers, this should change the none touch to TOUCH on the LCD indicating that the sensor has been triggered.

and maybe some of the code parts and maybe some of the images.

downvoted for plagiarism, copy-paste and text spinning @steemflagrewards

0
0
0.000
avatar

Steem Flag Rewards mention comment has been approved for SFR Token Issuance!

Tokens will be transferrred when the flagged content reaches payout.

Thank you for reporting this abuse, @ookamisuuhaisha.

  • plagiarism
    You are posting content that is not yours by copying it without sourcing or manipulating it to pass plagiarism tools.

This post was submitted via our Discord Community channel. Check us out on the following link!
SFR Discord

0
0
0.000
avatar

Hello,

We have found that all or part of the above post may have been copied from:

https://whaleshares.io/@twinkletoes/arduino-project-ky-039-and-lcd-to-monitor-pulse-rate-tutorial-by-twinkletoes

Not indicating that the content you post including translations, spun, or re-written articles are not your original work could be seen as plagiarism.

Repeated plagiarized posts are considered spam. Spam is discouraged by the community, and may result in action from the cheetah bot.

If you are actually the original author, please do reply to let us know!

More Info: Abuse Guide - 2017.


If you reply to this comment directly, we may not notice your response.
It is recommended to contact us in our Discord Channel, instead.

Thank you.

0
0
0.000
avatar
(Edited)

Hello @lapilipinas, we've downvoted and removed your post from our Daily build bulletin due to improper citing or completely stealing of someone else's work. You should understand that plagiarism or abuse is strictly addressed on the steem platform, which was noted down on our platform's FAQ.

That being said, you should refrain from using any of our tags, #diy, #build-it, #howto, #doityourself, #build in an attempt to prevent future flags and perhaps a permanent blacklist.

To know more about plagiarism, we recommend you visit this blog.

The Build-it Team

0
0
0.000