Touch Sensor ttp223

Good day

I am using touch sensor ttp223 on my ESP32. Touch sensor I/O PIN is connected to GPIO14 (I also tried GPIO27).

Here is my ESPHome config for the touch sensor.

# Touch Pad
esp32_touch:
  setup_mode: true

binary_sensor:
  - platform: esp32_touch
    name: "Touch Pad GPIO27"
    pin: GPIO14
    threshold: 1000

In can see in terminal window that the output is always 0:

[20:43:15][D][esp32_touch:126]: Touch Pad 'Touch Pad GPIO27' (T6): 0
[20:43:15][D][esp32_touch:126]: Touch Pad 'Touch Pad GPIO27' (T6): 0

When I disconnect the touch sensor wire from GPIO14 I can see State goes to OFF. When I reconnect the wire I can see State goes to ON.

When the wire is disconnected, values are reported for threshold and when I touch the GPIO14 values change as they should. But when I reconnect touch senor it always shows 0.

My ttp223 touch sensor is the small red one, not the blue one. Currently both its A/B pins are open.

Could the switch be faulty or am I doing something wrong?

The esp 32 touch component is not meant to be used with other active touch sensors like the TTP223. It is a touch sensor already. All you need is to connect a small conductive plate that you can touch.

Hi tom_l

Thank you for the quick response. Your answer pointed me in the right direction and I was able to add it as a basic touch sensor for ON and OFF and it works well now:

binary_sensor:
  - platform: gpio
    pin: GPIO14
    name: "Binary Touch Sensor"

Good Day!

i want to make a diy touch sensor switch board but the twist is i want 9 channels to oprate because my laboratory has total 5 lights and 4 fans can i integrate 9 touch sensors with the esp 32 ?

i will be very thankful if Somebody help me

You’re in luck. There are 10 capacitive touch inputs on the ESP32

  • T0 (GPIO 4)
  • T1 (GPIO 0)
  • T2 (GPIO 2)
  • T3 (GPIO 15)
  • T4 (GPIO 13)
  • T5 (GPIO 12)
  • T6 (GPIO 14)
  • T7 (GPIO 27)
  • T8 (GPIO 33)
  • T9 (GPIO 32)

https://randomnerdtutorials.com/esp32-pinout-reference-gpios/

1 Like

will the small electrode will Respond Behind of 4mm thick Acrylic board ?

That is something you will have to test and calibrate the threshold for. See: https://esphome.io/components/binary_sensor/esp32_touch.html#esp32-touch-binary-sensor and https://esphome.io/components/binary_sensor/esp32_touch.html#finding-thresholds