How to Use a Touch Sensor

How to Use a Touch Sensor © GPL3+

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

  • 2,765 views
  • 1 comment
  • 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 user253146

  • 8,180 views
  • 3 comments
  • 4 respects

eNVIRO: 7" Touch Panel Weather Station with Remote Sensor

Project in progress by antiElectron

  • 3,529 views
  • 1 comment
  • 12 respects

Grove Starter Kit for Arduino: Touch sensor

by Grant

  • 886 views
  • 1 comment
  • 2 respects

Smoke Detection using MQ-2 Gas Sensor

by Aritro Mukherjee

  • 213,116 views
  • 36 comments
  • 133 respects

Sound Sensor Activated LEDs with LCD for Sound Level Data!

Project tutorial by Heathen_Hacks-v2

  • 1,410 views
  • 2 comments
  • 8 respects

Vibration Sensor Module

Project tutorial by Alberto Zanon

  • 21,186 views
  • 2 comments
  • 9 respects
Add projectSign up / Login