Hello everyone - first post, so I welcome (gentle, please) feedback on improving the quality of the post/information. Also new to making electronics in general! So please excuse any ignorance.
I am creating a circuit to turn on a small pump (2.5-6V, 0.4-1.5W) when an ESP32 pin is on HIGH, but I am having trouble getting the transistor to close the circuit. I’ve tried two different transistors (2N7000 N-Type MOSFET and 2N2222 N-type BJT) and both seem to have the same issue. When applying 3.3v from an ESP32 board pin to the gate/base of the transistor, the LED lights up, but the gate does not open. However, when I apply the 5v using a jumper wire to the gate/base, it opens and the pump turns on.
Looking at the data sheets for both of these transistors (linked above), 3.3v appears to be over the threshold/saturation voltage, so I’m not sure why the transistor is opening with the 5v but not the 3.3v. What am I missing?
FYI - The LED is only in there so I can see when the pin is on HIGH. I’ve tried running it without the LED and get the same results.
Power source for 5v is a usb cable with 5v 2.4A power output plug.
2N7000 is a very poor choice for motor control, as the absolute maximum drain current is just 200 mA. The 2N2222 NPN is not much better, with absolute maximum collector current 600 mA.
The 2N7000 is not logic level. Vgs(th) could be 3volt.
One batch might work with 3.3volt logic, another batch might not.
Driving the LED from the same ESP pin will drag drive voltage down.
Leo..
Note 1: I don’t know the current of your pump, I found in internet this one. I can almost swear it says 170 mA, which is why I used that value for the calculations. It is up to you to use the actual values of your components.
Note 2: Note that the base current is somewhat high, this is the current that your microcontroller pin will supply. It is important that you look at the datasheet of your uC for the current characteristics of each pin. Maybe you can try another configuration
20ma is the absolute max current rating for most small LEDs.
That doesn't mean you should go anywhere near that.
1mA through a modern LED is usually enough to make it clearly visible.
Try 1k instead of the calculated 140 Ohm.
Just use the standard 220 Ohm as base resistor.
Leo..
20ma is the absolute max current rating for most small LEDs.
I know it. This is just an example for the thread starter of how to do the calculations. And thanks for the observation
Just use the standard 220 Ohm as base resistor.
It is always important to know the calculations, not just put random values. The lower the value of the base resistor, the more current the microcontroller pin will supply.
MOSFET Gate threshold and BJT saturation voltage are two completely different things and neither have anything to do with why your circuit does not work.
2N7000 is a very poor choice for motor control, as the absolute maximum drain current is just 200 mA. The 2N2222 NPN is not much better, with absolute maximum collector current 600 mA.
@jremington I did a little more learning and have been looking for either a BJT or NFET that I could purchase here where I live in Egypt. The MOSFET that I think would work well (if I understand more now) is the IRLZ44N. Looks like the threshold voltage is below 3.3v, and the drain current is well over 220mA (approximate max current of pump). HOWEVER, I can’t seem to find any NFETs (that one included) locally available that have a threshold voltage less than 4v.
So I am looking at BJTs, and I’m wondering if the BD135 might work?
Collector current 1.5A > 220mA needed for pump
hFE ≈ 120 for Ic of 220mA, and ESP32 pin current is 20mA (hFE > 11 required)
Vceo = 45V >>> 5V needed
Ptot = 8 W which I think is sufficient (Ic x Vce… 220mA x 0.5V = 0.11W)??
I’m probably getting something wrong, so please feel free to correct! Is there anything else I need to check?
IRLZ44N should be fine and the BD135 will work fine as well.
Collector current 1.5A > 220mA needed for pump
The maximum current drawn by the pump depends on what type it is. If it is brushless, it probably doesn't have a high startup current. If brushed, then expect the startup current (drawn for a few milliseconds) to be 5 to 10X the normal load current, which still within the 3A peak pulse collector of the BD135.
You probably don't need a heat sink for the BD135, but it wouldn't hurt.
Hfe is irrelevant when switching. It drops sharply when the transistor becomes reverse-biased (when collector drops below base voltage).
Most bjt datasheets have a saturation graph, which is a much better indicater of how much base current is needed.
Base current needed for 500mA collector current might be higher than an Arduino pin can supply. That's why we go for mosfets above a few hundred mA collector current.
Not enough base current results in a partially saturated transistor, which heats it up quickly to the point of failure.
Leo..
Practically, when using a BD135, you use the maximum safe current that the ESP32 pin can deliver (20mA?). More base current won't harm the BD135. Less will.
I would use a 2N2222 or BC337 for ~250mA collector current, and drive the base with a minimum 5% of that (12.5-20mA).
Leo..