Reducing touch sensor sensitivity

daxliniere
Posts: 7
Joined: Mon Nov 15, 2021 12:23 am

Reducing touch sensor sensitivity

Postby daxliniere » Wed Jul 20, 2022 3:33 pm

I'm working on a project and it has a touch sensor using an ESP32 pin. The prototype worked really well, but now that it's installed in its aluminium casing, the touch threshold has dropped from <15 to <5. This is causing intermittant triggering even when the unit is not being touched. The pin is electrically connected to the casing.

Is there a way to reduce the sensitivity of the touch sensor? Either by software or hardware?

This is the test code I'm using:

Code: Select all

#include <esp_adc_cal.h>

const int touchSensor = 32; //pin number
const int touchThresh = 5; //was 15

void setup()
{
  Serial.begin(115200);
}

void loop()
{
  Serial.print("Touch: ");
  if (touchRead(touchSensor) < touchThresh) {
    Serial.print("yes");
  }
  else {
    Serial.print("no");
  }
  Serial.print("    touch value: ");
  Serial.println(touchRead(touchSensor));

  delay(100);
}
Any help would be greatly appreciated.

All the best,
Dax.

Who is online

Users browsing this forum: No registered users and 33 guests