Problem with Touch Pin and IRF378

I try to control some 12V LEDs with an IRF3708 mosfet and a esp8266 (wemos d1 mini) and try to use a touch button to set the PWM frequency. Therefore I connected the pins like this:

D0 - 220kOhm - D6
|
Metal sheet

As long as the mosfet gets no signal, everything is working nicely and i can clearly set a threshold for the touch pin when it is touched. However, as soon as I give a signal on to the mosfet, no matter if very low or high frequency, the values read at the touch pin drastically change and there is almost no detectable change between "touched" and "not touched".

It seems that the IRF3708 produces a lot of noise and was wondering if there is a way to get rid of it in an elegant way? Im not very much into electronics and i am quite lost on this. Any hints are welcome!
Thanks!

It is working as expected. You did good figuring where the noise source is. Did you look at the data sheet for the MOSFET, you are not driving it properly and it is oscillating. Try a resistor between the ESP and the gate in the range of 25 to 50 Ohm, it may help but the drive is incorrect and it will not operate reliably. You want a MOSFET logic level preferably avalanche rated with a Vgs of 2.5V or less so it can properly enhance.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.