How do I read the Touch Sensor from the ESP32-S2 properly using Arduino?

misaalanshori
Posts: 1
Joined: Thu Aug 19, 2021 3:48 pm

How do I read the Touch Sensor from the ESP32-S2 properly using Arduino?

Postby misaalanshori » Thu Aug 19, 2021 4:20 pm

I wanted to use the touch sensor on the ESP32-S2. I tried the example code from the example menu but that did not work at all. The arduino example just have touchRead(), but on the esp-idf documentation theres configurations for the sensor voltage, speed, measurements time, denoise, and filtering.

The result read by the arduino code from the touch sensor are a complete mess, sometimes the values would be high when not touched and go low when touched, sometimes the value would be low when not touched and go high when touched and sometimes it would just not change or only change a very small amount, it also changes through these "states" seemingly at random while the sketch is running. Its also very sensitive to the proximity of my hand, which I don't really want for a simple touch pad. Overall the readings were not very predictable and i cant figure out how i would be able to convert it to a simple true/false value (like i usually do on the esp32)

So after reading the esp32-s2 documentation it looks like theres more things to configure that i don't think the arduino library/sketch did, and that might causing the reading problems.

Can someone give an example sketch to properly read the values from the touch sensor? Also maybe an explanation to what changing the touch pad voltage, speed and other configuration does (in terms of sensitivity and how it interacts with touch)

Who is online

Users browsing this forum: No registered users and 83 guests