ESP32 custom touch button board problem - Page 1
Forum section: electronics / projects

author: samatthias
author_rank: Newbie
timestamp: July 28, 2023, 02:32:20 pm
content: Hello together,unfortunately, I have to turn to you. I have designed a 9-touch board with EasyEDA for my ESP32 board (https://oshwlab.com/samatthias/esp32_wroom_9_keypad).I soldered the Wroom32 Dev kit board and it worked fine (except for touch button 2 / GPIO2 - it had some problem). I wrote a little code to read out the values and then define a threshold. It's no realy complex so far.Code:#include <Arduino.h>void setup() {Serial.begin(115200);}void loop() {Serial.println("touch_0: " + String(touchRead(4))); // GPIO 4 -> touch 0Serial.println("touch_2: " + String(touchRead(2))); // GPIO 2 -> touch 2Serial.println("touch_3: " + String(touchRead(15))); // GPIO 15 -> touch 3Serial.println("touch_4: " + String(touchRead(13))); // GPIO 13 -> touch 4Serial.println("touch_5: " + String(touchRead(12))); // GPIO 12 -> touch 5Serial.println("touch_6: " + String(touchRead(14))); // GPIO 14 -> touch 6Serial.println("touch_7: " + String(touchRead(27))); // GPIO 27 -> touch 7Serial.println("touch_8: " + String(touchRead(32))); // GPIO 32 -> touch 8Serial.println("touch_9: " + String(touchRead(33))); // GPIO 33 -> touch 9delay(1000); // give me time to bring up serial monitorSerial.println("ESP32 Touch Test");}Output:Code:ESP32 Touch Testtouch_0: 45touch_2: 0touch_3: 37touch_4: 48touch_5: 48touch_6: 121touch_7: 53touch_8: 48touch_9: 51You can see that something is wrong here Three things can be observed:1) I have explicitly not soldered GPIO14 (touch button 6).2) As described GPIO2 is not running. This can be ignored (for now)3) The differences between the soldered and working GPIO touch buttons and GPIO14 / touch button 6 are very big regarding sensitivity.When I touch button 6 (which is not directly soldered to the board) the value jumps from 127 to 10, which gives a super threshold. The "touch" or the finger can be well dedected.With all other buttons, the value moves only very slightly from e.g. 45 to 43. Also, the values are somehow only half as high when measuring.Conclusion: There must be something about the board or my design that strongly influences the sensitivity.Do any of you know advice or have ideas on how I can dramatically improve my setup?The goal is to have a board that offers 3-4 touch buttons and can detect the fingers behind a 2mm thick plastic board. If possible the internal ESP32 capabilities should be used for touch detection.Maybe there is someone among you, who could help me or even has already designed something similar. I am grateful for any advice and thank you for the discussion!best regardsMatt

author: samatthias
author_rank: Newbie
timestamp: July 28, 2023, 03:34:12 pm
content: Hi Everyone,after I posted my question it came to my mind I already disasembled a similar touch device from Sonof. But this makes nothing clearer: They have a very unique design which I never saw before. You may have a look at it as well.best regardsMatt

author: MarkS
author_rank: Unknown
timestamp: July 28, 2023, 03:54:56 pm
content: My guess, based partially on ignorance, is capacitive coupling through the ground/power planes.

author: samatthias
author_rank: Newbie
timestamp: July 29, 2023, 07:45:56 am
content: Dear MarkS, dear community,I must admit as a beginner your answer was a bit cryptic. After my research, I believe I have figured out what your statement means.Source  Time: 12:05 points out the problem I must be struggling with. Besides that there are other improvements mentioned in sources , ,.The main design requirements are:- Use round shapes - preferably a circle. For example, for a square or rectangle, use round corners. Sharp corners should be avoided.- The distance between the pads and the ground must be big enough (problem I have).- Ground pad should be filled as polygon mesh if possible or left completely empty.- Line lengths must be as far apart from each other as possible- The line lengths should be as short as possible- Other influences which I will not recite all nowThanks a lot MarkS to point me to the right direction! I should have checked all this in advance. Admittedly I was a bit amateurish with my design.Best regardsMattSources: DYI Youtuber project:https://youtube.com/watch?v=FjcVGP6vktM&feature=share NXP presentation design touch buttons:https://youtube.com/watch?v=g-WVW6QobwY&feature=share Application note from ST AN2733:https://datasheet.datasheetarchive.com/originals/library/Datasheet-071/DSA00359316.pdf

author: tooki
author_rank: Super Contributor
timestamp: July 29, 2023, 08:55:54 am
content: Take a look at this, too:https://www.nxp.com/docs/en/application-note/AN3863.pdf