top of page

Interfacing of Touch Sensor with Arduino Uno.


What is a Touch Sensor?


This device uses your body as part of the circuit. When you touch the sensor pad, the capacitance of the circuit is changed and is detected. That detected change in capacitance results in the output changing states.



Material Required:

Material Quantity

Arduino Uno 1

Touch Sensor 1

Jumper cables 4


Pinout Diagram:



Pin of Touch sensor:


1. GND.

2. VCC.

3. SIG



Circuit Diagram:

Connect the Touch Sensor with Arduino as follows:

  1. GND pin of Touch sensor to GND of Arduino

  2. VCC pin of Touch Sensor to 5V of Arduino

  3. SIG pin of Touch Sensor to digital pin 2 of Arduino.




Tested Programming Code:


#define ctsPin 2

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);

}



Precautions:


  1. Double check the connections before powering on the circuit.

  2. Don’t use loose jumper cables.

  3. Check whether proper board is selected from Arduino IDE.

  4. Ensure proper placement of Touch Sensor for correct working.


Conclusion:

Once your sketch is running, you have to see the Touch Sensor working by seeing the Serial monitor whenever it is being touched.






GET IN TOUCH

We'd love to hear from you

bottom of page