esp32-touch-pins

How to use touch pins on an ESP32

  • 2 min

Touch pins on the ESP32 are a very interesting feature that allows us to perform capacitive sensing.

Capacitive sensing is based on the property that all objects (including humans) can store a small amount of electrical charge.

When we touch a touch pin, we change the capacitance in the circuit. The ESP32 can detect this change in capacitance, which allows us to determine if a touch has occurred.

It is possible to create a touch panel by connecting any conductive object to these pins, such as aluminum foil, conductive fabric, conductive paint, among others.

Touch Pins on the ESP32

The ESP32 has multiple touch pins (usually labeled as T0, T1, T2, etc). The number of touch pins can vary depending on the specific development board you are using.

The ESP32’s touch sensors, in general, work quite well. They have good sensitivity and low noise. So we can use them even with fairly small pads.

Furthermore, the capacitive touch pins can be used to wake the ESP32 from deep sleep mode.

How to Read ESP32 Touch Pins

It is really very simple to use the ESP32’s touch pins in the Arduino environment. We simply have to use the touchRead function.

touchRead(int pin);
Copied!

Code Examples



References: