• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Flaky ESP 32 touch sensors

Q&A Forum › Flaky ESP 32 touch sensors
0 Vote Up Vote Down
bill1 asked 5 years ago

I’m building a lighting control system for a motorhome using ESP32 and MQQT. I have all the remote control stuff working well, but controlling a light you’re standing next to with a network connected device is not handy. I decided  touch control for turning on and dimming the lights would be great. Each ESP32 controls 4 channels of lighting via mosfet boards.

If I initiate a single channel of touch control it works fine. But when I add more the touch channels interfere with each other and become glitchy. I tried a version of debouncing to distinguish real touches from glitches, but there’s enough noise to ultimately overcome even the most aggressive delay. I read that the touch pins freely oscillate and touching one changes the frequency. It seems likely that the touch wires are acting like antennas, sending signals to each other.

Does anyone have any useful experience in making these sensors reliable?

The code I’m using is very simple, this version has no “debounce” filter since they didn’t work well enough.

//LED1
touchValue1 = touchRead(touchPin1);
// check if the touchValue is below the threshold
if(touchValue1 < threshold){
if (incLed1<254){
incLed1 = incLed1+4;
ledcWrite(ledChannel1, incLed1);
}

if (incLed1>254){
incLed1=0;
}
delay(30);
}
3 Answers
0 Vote Up Vote Down
bill1 answered 5 years ago

After more than a bit of research, I decided the built-in touch control is inherently flaky–too flaky for what is essentially a fallback way of controlling the lights. I tried using shielded cable and larger sensor plates, and that helped, but over a long enough stretch of time the lights creep slowly up. I’m going to experiment with independant  touch sensors based on the ttp233b IC.

0 Vote Up Vote Down
bill1 answered 5 years ago

For anyone looking to use the touch sensors on an ESP32 for something real world, this article might be helpful. For me it showed so many potential sources for error that I dismissed the utility, but someone more persistent could use this information to design a more reliable connection and perhaps fix some of the noise sources in code. https://nick.zoic.org/art/esp32-capacitive-sensors/

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Bill.
Thanks for sharing your research and I’m sorry for the delay in my response.
I would suggest exactly that – using independent touch sensors.
When you try with those, if you want, please share your results with us.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.