Views
DFRobot Capacitive Touch Sensor (SKU:DFR0030)
From Robot Wiki
Contents |
Introduction
This is the DFRobot Capacitive Touch Sensor. This sensor can sense the human body and metal, when they touch the sensor. In addition to this, the detection works even when separated by plastic, glass and other materials. In combination with arduino boards, the sensors can be used to create very interesting and interactive projects.
Specification
- Plug & Play
- Can sense the human body and metal
- Works well with arduino boards
- Weight: 3 grams
Pin Definition
Touch Sensor module pin definition :
- Input
- Power
- GND
Connection Diagram
Sample Code
int ledPin = 13; // Connect LED on pin 13, or use the onboard one
int KEY = 2; // Connect Touch sensor on Digital Pin 2
void setup()
{
pinMode(ledPin, OUTPUT); // Set ledPin to output mode
pinMode(KEY, INPUT); //Set touch sensor pin to input mode
}
void loop()
{
if(digitalRead(KEY)==HIGH) //Read Touch sensor signal
{
digitalWrite(ledPin, HIGH); // if Touch sensor is HIGH, then turn on
}
else
{
digitalWrite(ledPin, LOW); // if Touch sensor is LOW, then turn off the led
}
}
Go Shopping DFRobot Capacitive Touch Sensor (SKU:DFR0030)



