DFRobot Capacitive Touch Sensor (SKU:DFR0030)

From DFRobot Electronic Product Wiki and Tutorial: Arduino and Robot Wiki-DFRobot.com


DFRobot Capacitive Touch Sensor ( left:Front, right:Back)

This is the DFRobot Capacitive Touch Sensor. This arduino touch 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.


  • Plug & Play
  • Can sense the human body and metal
  • Works well with arduino boards
  • Weight: 3 grams

Pin Definition

Touch Sensor module pin definition :

  1. Input
  2. Power
  3. GND

Caution:For the old revision the jumpers work like this:

  1. With jumper connected:

It will output digital high,when you touch

  1. With jumper NOT connected:

It will behave like a switch or button, touch once and it will be high until you touch it again

digital input module

Connection Diagram

Digital module 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
        digitalWrite(ledPin, LOW);    // if Touch sensor is LOW, then turn off the led

Nextredirectltr.pngGo Shopping DFRobot Capacitive Touch Sensor (SKU:DFR0030)

Category: DFRobot > Sensors & Modules > Sensors > Interactive Sensors