Grove Starter Kit for Arduino: Touch sensor

Grove Starter Kit for Arduino: Touch sensor © LGPL

Teaches you how to use the touch sensor in the Arduino Grove Starter kit.

  • 717 views
  • 1 comment
  • 2 respects

Components and supplies

Apps and online services

About this project

Setup:

Simply connect the touch sensor to D4.

Also connect an LED to pin 3.

Note: the touch sensor actually senses touch on the silver circle on the bottom of the sensor.

Code

Touch codeArduino
const int TouchPin = 9;
const int ledPin = 3;
void setup() {
  pinMode(TouchPin, INPUT);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  int sensorValue = digitalRead(TouchPin);
  if (sensorValue == 1){
    digitalWrite(ledPin, HIGH);
  }
  else{
    digitalWrite(ledPin, LOW);
  }
}

Schematics

Touch sensor setup
plug the sensor into D4
Dscn4058 l3yjxy3dpu

Comments

Similar projects you might like

Grove Starter Kit For Arduino --- RGB LCD

by Grant

  • 6,313 views
  • 2 comments
  • 7 respects

Touch Sensor and Sound Sensor Controlling AC/DC Lights

Project showcase by Anbumachi

  • 1,161 views
  • 2 comments
  • 5 respects

Smart Home Sensor Node

Project tutorial by vincent wong

  • 8,801 views
  • 3 comments
  • 17 respects
Add projectSign up / Login