How can I use this wood penetrable touch ensor


I bought this touch sensor that penetrates wood. It has 3 pins. I have connected one of the pin in ESP32 to the data pin of the sensor and tested all the modes like push inverted, touch, analog, analog inverted. Nothing seems to work. In some modes the brightness increases and decreases like breathing effect. How can I fix this?

https://www.aliexpress.com/item/4001062538820.html here is the product page just in case

1 Like

Arg!! Just bought it so excited and now I see your post :frowning: Have you been able to do something with it? If this work?! I’ve got plenty of Montessori wooden toy to make to my children. That would be so cool.

Do you have a datasheet or an explanation of how the device works? If not you may be in for some reverse engineering to figure out how to talk to the sensor.

From the purchase link, these devices can be driven from 5-24V and then connected to an analog LED strip. The “B” type gives you both On-Off and dimming of the strip.

That means the output will be some type of PWM signal, probably via an internal MOSFET.

I would suggest you power the device via a 5 V supply and feed the output to a simple resistor divider to bring the output voltage down to the 3.3V level of the ESP as a 1st step.

A 6K8 and 10K resistor in series will bring a 5V supply device down to 3V for the ESP. You probably want to add a 10uF@16V capacitor across the output fed to the ESP to smooth out the likely PWM signal. You can try something like:

Depending on how you wish to use this with WLED you can try (at least) 2 different types of connection:

A) Simple On/Off - connect the output of the divider above to a GPIO and configure it as a switch to give you on/off control.

B) Connect to an analog input GPIO and configure WLED for Analog button, this can give you a little more control. You can see the KB for more details: Analog button

I’d suggest you start with (A) just to prove you can turn a light on/off.
Depending on the actual output design of the touch switch, you may need to tune the divider (especially for analog usage) but those values should be reasonably safe if you’re supplying the device from 5V.

Let us know how it goes…