Catalex Capacitive Touch Sensor (TTP223B) [S009]


* Specs

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.

When I first got this,  I expected a glitchy device,  that while functional,  would occasionally have unpredictable output results.

I may have been wrong.   After playing for a few hours, I can’t seem to get it to do anything other than what I expected it to do.  If you’re looking for robust user input,  this might do the trick.

* Contents

- Key Code

#define ctsPin 14 // Pin for capactitive touch sensor


int ledPin = 13; // pin for the LED


void setup() {


  pinMode(ledPin, OUTPUT);  

  pinMode(ctsPin, INPUT);



void loop() {

  int ctsValue = digitalRead(ctsPin);

  if (ctsValue == HIGH){

    digitalWrite(ledPin, HIGH);





    Serial.println("not touched");





Posted by RDIoT

댓글을 달아 주세요