Touch Sensor With Arduino

by Utsource in Circuits > Arduino

13030 Views, 3 Favorites, 0 Comments

Touch Sensor With Arduino

20191024_091434.jpg

Hi guys in this instructables we will learn how to use touch Sensor withith Arduino and in that way we can provide touch inputs to arduino and that can be used For any kind of output. So using this touch sensor can provide the output which can be controlled by touch inputs.

Things You Need

Km5Zu-2RIncAUweU7uG7IhyWPySZ0SqIgAI0-vk9w7767_IkthCPCcsirj2GGmXF4IdQDg8UVpHVLVM6CXnzFsG1hnAdSkK7BIhIOtEldXoZiDsvzsPo-6o0rD6Mda7UyOE=w456-h323-nc.png
electronics-kit-resistor-led-button-breadboard-wire-1697-1024x1024.jpg
f_8a82362bf33d4734a91f1a196574c870.jpg

These are following things you need for this instructables :

Arduino uno

Touch sensor

Jumper wires

Breadboard

Connections

20191024_091434.jpg

Connect everything According to the shown schmatics and you'll fine.

Code

images(101).jpg

Please copy the following code and upload it to your arduino Board :

// Henry's Bench
// Capacitive Touch Sensor Tutorial

// When Sig Output is high, touch sensor is being pressed

#define ctsPin 2

// Pin for capactitive touch sensor

int ledPin = 13;

// pin for the LED

void setup()

{

Serial.begin(9600);

pinMode(ledPin, OUTPUT);

pinMode(ctsPin, INPUT);

}

void loop()

{

int ctsValue = digitalRead(ctsPin);

if (ctsValue == HIGH)

{

digitalWrite(ledPin, HIGH);

Serial.println("TOUCHED");

}

else{

digitalWrite(ledPin,LOW);

Serial.println("not touched");

}

delay(500);

}

Testing the Sensor

20191024_092740.jpg

After connecting everything together and uploading the code to arduino whenever you will touch the touch sensor the LED on pin 13 will light up and on serial monitor you will get a message as "TOUCHED" and when you are not touching it you will get message "not touched". So have fun using touch Sensor in your arduino Project.