Sensor TTP223B remove auto shutdown time 12 seg

Hello greetings ,
I wanted to use this ttp223b sensor as a liquid detector I have done the tests by placing it on the outside in a plastic cup, I fill it with water when it reaches the limit, it turns on but after a few seconds it turns off by itself, it can work that that while it is sensing, keep it on after the level drops, it turns off.

I have tried to use this code but the detail is that when it reaches the level at the second it turns off itself

#define ctsPin 2

int ledPin = 13;

void setup() {
pinMode(ledPin, OUTPUT);
pinMode(ctsPin, INPUT);

void loop() {
int ctsValue = digitalRead(ctsPin);
if (ctsValue == HIGH) {
digitalWrite(ledPin, HIGH);

else {
digitalWrite(ledPin, LOW);
Serial.println("not touch");


This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.