I'm controlling a device that needs 12v and uses maximum of 2 amps (car fuel pump suction control valve). I'm using esp32 together with IRLZ44N logic level mosfet. I'm sending PWM signal with 1khz frequency to the gate from esp. It's very basic setup I used often with arduino. The mosfet is however getting very hot after about 20 seconds and melts breadboard. The esp32 also gets hot after few minutes and eventually stops working. I tried few different mosfets and already burned two esp32s.
simulate this circuit – Schematic created using CircuitLab
At first I thought the gate threshold is too low for this mosfet but turns out it's Vgs is as low as 2V to fully open. That wouldn't explain esp burning though.
What am I doing wrong here?