Mosfet relay leaking?

Hi,

I use a ESP32 IO pin to control a basic Mosfet relay and power a DC pump. It work well but from time to time when I boot the ESP32, the pump start (not fully but maybe 10% duty cycle). If I do nothing, the pump keep working (at 10% duty cycle) until the control program trigger the IO pin for real and start the pump as intended.
I obtain a different pump behavior if I immediatly reboot the ESP. Doing this stop the pump which remain off until the control program trigger the pin.

Could it be a mosfet leaks? The schematic below show my relay setup. Accordingly, the voltage on the IO pin should be 0 at boot up. Could it be that my 1 meg resistor is to large? Could it be a problem with ground uncoupling between the relay and the ESP? Of course this is intermittent and hard to reproduce for proper testing....
Relay_A

I would use a 10K pull down!

Post the data sheet for the FQ38, I cannot find it as a MOSFET and your TTL output device. I will take a SWAG, Your TTL output section is interesting. I would add a pull up on the TTL signal in the range 0f 500 to 1K Ohms, this will give you more drive to the MOSFET. The 1K could be changed to something in the 100 Ohm range. The reason TTL devices do not source much current but they sink a lot. You state the TTL is 0 or restart so I am believing that. You do have the pull down resistor on the correct side of the gate resistor. I believe your leaking is that the MOSFET is not fully enhanced or turned off.

Here is the spec sheet for the FQP30N06L. https://www.onsemi.com/pdf/datasheet/fqp30n06l-d.pdf

Sorry the TTL is misleading. It is ESP32 IO signal level. Low = 0 volts, High = 3.3 volts.
It also sound to me that the Mosfet is not fully off but this apparently occur only when I boot the system (and not every time). It may have to do with the power on of the system? I apply power which then initiate the ESP boot and from time to time the relay allow some current even if the ESP signal is 0 volt.

I choose a 1k resistor to limit the signal current to 3.3 mA. If i decrease the resistor value then I may overwhelm the ESP32 max current output of 12 mA / pin. 3.3 mA works and is a safe margin and a battery saver.
This was the same thinking with the ground resistor of 1 meg --> only 3.3 uA wasted there.

At the moment the ESP ground is connected with the ground of the pump and relay. Maybe I should put someting there to isolate the current from the pump? I suspect that the relay is not fully off because "maybe" somehow a voltage offset appears when I power the system? In turn, this offset may "facilitate" the current flow in the mosfet and act like I send a small signal on the gate pin? Again I only guess here.

Finally, I know that the FQP30 is not ideal. It is not fully on with 3.3 volts signal but it is "on" enough for my application: the pump work and push air more than enough for me. It also turn solenoid valve on and off and I can use it for PWM the pump if needed.

thanks

Which esp32 pin are you using? Anyway, try another one to see if you get the same effect. Some pins may behave differently at boot time or be used to control the built-in led etc.

You should still check some wiring connections, it's probably not the correct pins.

I use gpio pin 25, 26 and 27 on a nodemcu 32s. I carefully select them.

Pin 27 is actually the one with the pump.
Pin 25 and 26 also have a MOSFET relay to control solenoids. The config is the following:

Pin 27 control 1 MOSFET and trigger the pump.
Pin 25 control another MOSFET to trigger a solenoid
Pin 26 control a third MOSFET to trigger another solenoid.

Thanks