Feather ESP32-S2 Capacitive Touch not working
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- WayneConnell
- Posts: 5
- Joined: Tue Jul 14, 2020 1:49 am
Feather ESP32-S2 Capacitive Touch not working
I have the Adafruit ESP32-S2 Feather with BME280 Sensor - STEMMA QT (4MB Flash + 2MB PSRAM) [ID:5303]. All board functions I need work (on another sketch) except the capacitive touch function. I develop on the Arduino IDE 2.0 using the Adafruit Feather ESP32-S2 board model. I have tried the basic TouchRead.ino example on several ports with a similar very large return value (example 3440595) that does not change when pin is touched. I presume the example is complete. I have found no mention of this failure online or on this forum. Is there something else needed to enable the function? Do I have a bad device?
- mikeysklar
- Posts: 14173
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Feather ESP32-S2 Capacitive Touch not working
Which pins have you been using for your capacitive touch testing?
Looking at the CircuitPython code there are specific pins identified for the ESP32-S2 which might not be clear if you have only been following Arduino guides and code examples.
https://learn.adafruit.com/adafruit-esp ... 3095940-18
Looking at the CircuitPython code there are specific pins identified for the ESP32-S2 which might not be clear if you have only been following Arduino guides and code examples.
https://learn.adafruit.com/adafruit-esp ... 3095940-18
Code: Select all
A4 - CircuitPython: board.A4. Arduino: T14.
A5 - CircuitPython: board.A5. Arduino: T8.
D13 - CircuitPython: board.D13. Arduino: T13.
D12 - CircuitPython: board.D12. Arduino: T12.
D11 - CircuitPython: board.D11. Arduino: T11.
D10 - CircuitPython: board.D10. Arduino: T10.
D9 - CircuitPython: board.D9. Arduino: T9.
D6 - CircuitPython: board.D8. Arduino: T6.
D5 - CircuitPython: board.D7. Arduino: T5.
There are pins other than those listed above that are touch capable on the ESP32-S2 module itself, however, the layout and circuitry on the Feather render them unusable as touch pins.
- WayneConnell
- Posts: 5
- Joined: Tue Jul 14, 2020 1:49 am
Re: Feather ESP32-S2 Capacitive Touch not working
I have attempted to access 'touch' on T10, T11, T12 and T13. Other ports are used. The following is the data returned. The values change following a reset, but don't change with subsequent reads of the respective pins, even when touched.
Touch T10 = 248377
Touch T11 = 2400234
Touch T12 = 1810388
Touch T13 = 4189011
Touch T10 = 248377
Touch T11 = 2400234
Touch T12 = 1810388
Touch T13 = 4189011
- mikeysklar
- Posts: 14173
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Feather ESP32-S2 Capacitive Touch not working
Can you post a short example of the code you are running that is not updating the values?
- WayneConnell
- Posts: 5
- Joined: Tue Jul 14, 2020 1:49 am
Re: Feather ESP32-S2 Capacitive Touch not working
It is an incredibly simple test.
// ESP32 Touch Test
int testCntr;
void setup()
{
Serial.begin(9600);
delay(1000); // give me time to bring up serial monitor
Serial.println("ESP32 Touch Test");
testCntr = 0;
}
void loop()
{
Serial.print("Touch T10 = "); Serial.println(touchRead(T10)); // get value
Serial.print("Touch T11 = "); Serial.println(touchRead(T11)); // get value
Serial.print("Touch T12 = "); Serial.println(touchRead(T12)); // get value
Serial.print("Touch T13 = "); Serial.println(touchRead(T13)); // get value
Serial.print("Counter="); Serial.println(testCntr);
testCntr++;
delay(1000);
}
// ESP32 Touch Test
int testCntr;
void setup()
{
Serial.begin(9600);
delay(1000); // give me time to bring up serial monitor
Serial.println("ESP32 Touch Test");
testCntr = 0;
}
void loop()
{
Serial.print("Touch T10 = "); Serial.println(touchRead(T10)); // get value
Serial.print("Touch T11 = "); Serial.println(touchRead(T11)); // get value
Serial.print("Touch T12 = "); Serial.println(touchRead(T12)); // get value
Serial.print("Touch T13 = "); Serial.println(touchRead(T13)); // get value
Serial.print("Counter="); Serial.println(testCntr);
testCntr++;
delay(1000);
}
- mikeysklar
- Posts: 14173
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Feather ESP32-S2 Capacitive Touch not working
The ESP32-S2 needed some patching. Are you running the latest ESP Arduino release 2.0.3?
https://github.com/espressif/arduino-es ... /tag/2.0.3
issue:
https://github.com/espressif/arduino-esp32/issues/5745
merge:
https://github.com/espressif/arduino-esp32/pull/6194
https://github.com/espressif/arduino-es ... /tag/2.0.3
issue:
https://github.com/espressif/arduino-esp32/issues/5745
merge:
https://github.com/espressif/arduino-esp32/pull/6194
- WayneConnell
- Posts: 5
- Joined: Tue Jul 14, 2020 1:49 am
Re: Feather ESP32-S2 Capacitive Touch not working
The board manager indicates esp32 by Espressif Systems Version 2.0.3-RC1 is installed. The Arduino IDE is indicating 2.0.0-rc6. If this is the root of the 'touch' issue I have no idea how to correct this problem. Any suggestions?
- mikeysklar
- Posts: 14173
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Feather ESP32-S2 Capacitive Touch not working
The 2.0.3-RC1 release candidate is from late March 2022.
The 2.0.3 release is from early May (3 weeks ago). You need to be running 2.0.3. The most current release where this issue has been resolved.
https://github.com/espressif/arduino-esp32/tags
The 2.0.3 release is from early May (3 weeks ago). You need to be running 2.0.3. The most current release where this issue has been resolved.
https://github.com/espressif/arduino-esp32/tags
- WayneConnell
- Posts: 5
- Joined: Tue Jul 14, 2020 1:49 am
Re: Feather ESP32-S2 Capacitive Touch not working
I now have the esp32 by Espressif Systems Version 2.0.3 installed. The operational results are the same. The board manager was able to find the Version 2.0.3, which I installed. I was not able to directly correlate the last link you sent with this installation. I am unfamiliar with the process to install that specific build.
- mikeysklar
- Posts: 14173
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Feather ESP32-S2 Capacitive Touch not working
Installing the correct version via the boards manager should be fine. Everything I have read on the arduino-esp32 indicates the same touchread API should be working.
You can open a new issue on the github repo submitting your code example. Basically cut and paste your initial post from here this forum to there. Since you are on the current stable release it could be relevant.
https://github.com/espressif/arduino-esp32/issues
You can open a new issue on the github repo submitting your code example. Basically cut and paste your initial post from here this forum to there. Since you are on the current stable release it could be relevant.
https://github.com/espressif/arduino-esp32/issues
Please be positive and constructive with your questions and comments.