How to Use a Touch Sensor

This guide will show you how to use a touch sensor.

Nov 25, 2018

51178 views

8 respects

Components and supplies

1

Touch Sensor

1

Arduino UNO

1

Male/Female Jumper Wires

Project description

Code

TouchSensor.ino

arduino

Upload this code:

Downloadable files

Schematics

Schematics

Schematics

Schematics

Schematics

Schematics

Schematics

Schematics

Comments

Only logged in users can leave comments

Anonymous user

2 years ago

Hello, mate. I think this have a little correction of pinMode(). That should be INPUT instead of OUTPUT for getting the data from touch sensor.

arcaegecengiz

2 years ago

I've fixed it

Anonymous user

6 years ago

Hello, mate. I think this have a little correction of pinMode(). That should be INPUT instead of OUTPUT for getting the data from touch sensor.

arcaegecengiz

2 years ago

I've fixed it

West_Fighter

6 years ago

In your code: The code Copy and paste this code to the Arduino IDE and upload it. void setup() { pinMode(2, OUTPUT); Serial.begin(9600); } void loop() { if (digitalRead(2) == HIGH)Serial.println("Sensor is touched"); delay(500); } Then, open the Serial Monitor and set the baud rate to 9600. When you touch it, you will see a "Sensoristouched" message. First you write "pinMode(2,OTUPUT);" than digitalRead(2) == HIGH. At OUTPUT you can digital or analogWrite ;-) And you lost one ";" can you see where???