


The TTP223B Capacitive Touch Sensor is a popular, easy-to-use touch sensor that works by detecting changes in capacitance when a human finger or conductive object touches its surface. It is commonly used in various electronic projects for detecting touch input without the need for mechanical buttons, offering a more durable and sleek design compared to traditional switches.
The TTP223B uses capacitive sensing to detect a change in the electrical field when a finger (or any conductive object) is brought close to the sensor pad. The sensor responds to this change by sending a HIGH signal to the output pin when the touch is detected. If there is no touch, the output remains LOW.
Here’s a simple example of how to connect and use the TTP223B capacitive touch sensor with an Arduino:
int touchPin = 7; // Pin connected to OUT on the TTP223B
int ledPin = 13; // Pin connected to an LED (optional for feedback)
void setup() {
pinMode(touchPin, INPUT); // Set touchPin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output (for feedback)
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int touchState = digitalRead(touchPin); // Read the state of the touch sensor
if (touchState == HIGH) { // If the sensor is touched
digitalWrite(ledPin, HIGH); // Turn on the LED
Serial.println("Touch detected!");
} else {
digitalWrite(ledPin, LOW); // Turn off the LED
Serial.println("No touch");
}
delay(100); // Delay for stability
}
touchPin is set to INPUT because we’re reading data from the TTP223B's output.Brand: Generic
Origin: China