Capacitieve touch sensor voor aanraakbediening en touch-geactiveerde apparaten.
SKU: OT8822 Número do artigo: NA061 EAN: 8720828223482 Localização: H10.03
Alternativa
Botão de pressão | LIGA-DESLIGA self lock | 7x7x12
€ 0,45
Ver esta alternativa
Como ligar o Sensor tátil TTP223B a um Arduino UNO ou ESP32, com um sketch de exemplo que podes carregar já.
This project demonstrates the TTP223B capacitive touch sensor module. When you touch the capacitive sensing pad, the sensor outputs a HIGH signal which turns on the Arduino's built-in LED and prints the status to the Serial Monitor.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : TTP223B Capacitive Touch Sensor Demo
* Board : Arduino UNO (arduino:avr:uno)
* Parts : Touch sensor TTP223B
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
// Pin definitions
const int touchPin = 2;
const int ledPin = 13;
int lastState = LOW;
void setup() {
pinMode(touchPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(115200);
Serial.println(F("TTP223B Touch Sensor Initialized"));
}
void loop() {
int touchState = digitalRead(touchPin);
// Control onboard LED based on touch input
digitalWrite(ledPin, touchState);
// Print message on state change
if (touchState != lastState) {
if (touchState == HIGH) {
Serial.println(F("Touch detected!"));
} else {
Serial.println(F("Touch released."));
}
lastState = touchState;
}
delay(20);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This circuit reads digital signals from the TTP223 capacitive touch sensor and reflects the state on the ESP32's built-in LED. When you touch the sensor pad, the signal pin goes HIGH, illuminating the onboard LED and printing touch events to the Serial Monitor. The module is powered directly with 3.3V for safe logic compatibility.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : ESP32 TTP223 Capacitive Touch Sensor Demo
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : Touch sensor TTP223B
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
const int TOUCH_PIN = 4; // D4 on ESP32 DevKit V1
const int LED_PIN = 2; // Onboard LED on ESP32 DevKit V1
int lastState = LOW;
void setup() {
Serial.begin(115200);
pinMode(TOUCH_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);
Serial.println("TTP223 Touch Sensor Initialized.");
}
void loop() {
int touchState = digitalRead(TOUCH_PIN);
if (touchState != lastState) {
if (touchState == HIGH) {
digitalWrite(LED_PIN, HIGH);
Serial.println("Touch detected!");
} else {
digitalWrite(LED_PIN, LOW);
Serial.println("Touch released.");
}
lastState = touchState;
delay(50); // Simple debounce delay
}
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
O TTP223B é um sensor tátil capacitivo que reage ao toque de um objeto ou pessoa numa superfície sensível. Este sensor foi concebido para diversas aplicações, como controlo por toque, interruptores e botões táteis, e outros dispositivos ativados por toque.
Especificações técnicas do sensor tátil TTP223B:
O sensor tátil TTP223B dispõe de um circuito de debounce integrado para evitar interferências. O consumo de energia é baixo, menos de 1 mA em modo de espera. O sensor tem uma resposta rápida de menos de 60 ms e uma longa vida útil de mais de 100.000 ciclos.

| Tensão de operação | 2.0 V tot 5.5 V DC |
|---|---|
| Tensão de saída | Gelijk aan de voedingsspanning (Vcc) in Momentary-modus |
| Temperatura de funcionamento | -20 °C tot +70 °C |
| Alcance de deteção | 0 mm tot 12 mm |
| Vida útil | > 100000 cycli |
| Corrente de saída | 500 mA (maximaal) |
| Modo de saída | Toggle-modus of Momentary-modus (instelbaar) |
| Tempo de resposta | < 60 ms |
| Consumo de energia em standby | < 1 mA |
Funciona bem.
ótimo para pequenos projetos.
Não ficas satisfeito? Tens 30 dias após a receção para devolver o produto.
Tudo sobre devoluções
Sensor tátil TTP223B