How to Use a Touch Sensor

How to Use a Touch Sensor © GPL3+

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

  • 8,789 views
  • 2 comments
  • 8 respects

Components and supplies

About this project

Don't worry if you don't know how to use a touch sensor. It's easy!

Although you can make a touch sensor with Arduino, it's a lot easier to just have a ready-built one. This will also make the code and the circuit easier.

The circuit

Connect VCC Pin to 5V on Arduino.

Connect GND to Arduino's GND.

Connect OUT to D2 on Arduino and you're ready!

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.

Code

TouchSensor.inoArduino
Upload this code:
void setup() {
  pinMode(2, OUTPUT);
  Serial.begin(9600);

}

void loop() {
  if (digitalRead(2) == HIGH)Serial.println("Sensor is touched");
  delay(500);

}

Schematics

Schematics
touch_mwkPX9Hr0n.fzz
Schematics
Touch aszd5vxmjb

Comments

Similar projects you might like

touch sensor

Project tutorial by tech guy

  • 20,890 views
  • 4 comments
  • 12 respects

eNVIRO: 7" Touch Panel Weather Station with Remote Sensor

Project in progress by antiElectron

  • 5,121 views
  • 1 comment
  • 18 respects

Grove Starter Kit for Arduino: Touch sensor

by Grant

  • 1,081 views
  • 1 comment
  • 2 respects

Smoke Detection using MQ-2 Gas Sensor

by Aritro Mukherjee

  • 295,784 views
  • 49 comments
  • 187 respects

DIY Heart Rate Sensor

by Ingeimaks Ingeimaks

  • 22,177 views
  • 2 comments
  • 30 respects
Add projectSign up / Login