
N Mosfet is always on
(Images attached) I have made a cricuit in which an ESP32 controls 2 electric motors via IRL546NPBF Mosfets. The ESP32 is Seeed studio Xiao C6.
As you can hopefully see on my photo, the connection is VBUS 5.02V -> Motor (max 4.8V across terminals when working) -> mosfet drain. The source is connected to ground. The gate is connected to gpio with a 22K ohm resistor to ground. In the real circuit I will also include a second resistor between gpio and gate to protect the ESP32. The gpio on high is 3V.
The issue is that the mosfet is always on, regardless whether the gate is connected to a gpio (high or low), VBUS or ground. Though, the motor is faster when the gate is at higher voltage - I tested a simple script where gpio 1 alternated between high and low every 2 seconds, the motor changed speed.
While the photo may not be the best, I checked whether all connections are there with a multimeter.
I do need to use a mosfet, a I plan to use pulse width modification with this setup.
I dont know the exact rating of the motors, because they are kind of scrap material, but they arent damaged in any way. I know that the motors use 150mA, the VBUS pin can provide a maximum of 500mA.
If you need to know more, please tell me.
Here are some important screenshots of the mosfets documentation:
As you probably can tell, I dont know much, hence posting here.
SOLUTION: The indicator leds that I have added between gpio and gate have blocked the ability of the mosfet to turn back off. Now it works. Thanks for the help