I need some help. I just want to run a 6V DC Vacuum Motor Air Pump.
I'm using an external 5V power supply, an IRFZ44N mosfet, an ESP32 and a 10k ohm resistor.
Instead of running for 2 seconds and pausing for 2 seconds as i declared it in my code, the motor continously runs but at very low speed. This is my Code:
const int pumpPin = 25; // initialize digital pin 9 for pump control
void setup() {
// initialize the pump pin as an output:
pinMode(pumpPin, OUTPUT);
}
void loop() {
digitalWrite(pumpPin, HIGH); // send signal from pin 9 to circuit
delay(2000); // wait for 2 seconds
digitalWrite(pumpPin, LOW); // end signal
delay(2000); // wait for 2 seconds before repeating loop
}
Schematic: ESP32 replaced with ard uno (i'm using gpio pin 25 on esp32)
When i run the simulation on tinkercad everything is working as expected. I double checked all the wiring. So my guess is a faulty component. Does anyone know, what it could be and how to fix it?
To begin with, you'll need to use a logic level mosfet.
No idea why you have a 10k resistor across the motor terminals.
Show a circuit diagram (not fritzing) and include power supply details as well as component details.
Normal arrangement to set up a mosfet like this is run a 10k to ground from the gate terminal.
This is to make sure the gate turns off when no signal applied.
Some will also use approx 100R in series with the gate as well.
Not good to run motors on breadboard, they simply will not handle the load current.
Most here will not go searching your links for information, put it all here.
Thanks for all the helpful answers! First i will get logic level mosfets. I decided for IRF520 on modules. Hope that will fix it. Sorry for the mistake, i'm a bloody beginner
Hi Jim, can you explain why? As far as i understood the gate triggers between 3.3 and 5V and it can handle up to 1A without heatsink. Could you suggest a working NPN transistor?
The IRF520 data sheet only specifies parameters for Vgs from 4.5V to 15V. The gate threshold voltage has a max of 4V, so it definitely will not work at 3.3V.
The transistor part number is on the schematic I provided. Mouser has then in stock.
Not necessarily............ use a logic level mosfet, simple and relatively cheap given current handling capabilities.
IRLZ44 should do the job when configured correctly in the circuit, many others.
Thanks for the advice! It seems that irlz44n has better availability in Germany where i live. I watched Dronebot Workshops video on transistors and mosfets but i still do not know exactly why i should choose a mosfet over a npn or the other way around. what are the reasons for one or the other?
You have a 6V supply and a 6V motor, if you use an NPN transistor the transistor will drop 0.7V, so your low voltage motor will receive 6 - 0.7 = 5.3V.
A MOSFET will drop less than that say 0.2V so your motor will receive 6 - 0.2 = 5.8V.
(5.8 - 5.3) / 6 = = about 8%, and that can be a lot on a small motor.
The smaller volt drop means less energy wasted in the semiconductor and more used in the motor.
Tom...
PS. Anyone feel free to adjust my equations, these are just of the top of my head at the end of a long week....