Instability Issue When Switching MOSFET for Raspberry Pi Power

sghioto

Joined Dec 31, 2017
8,634
That module will definitely work.
The problem with the original circuit is trying to use a N channel mosfet as a high side switch.
Module schematic:
1740063163459.png
 
Last edited:

BobaMosfet

Joined Jul 1, 2009
2,211
The gate is voltage driven, but the component you output that voltage from is current driven. You cannot have voltage without current. You must ALWAYS be aware of current in your circuit. The more current you conserve, the more current you have to use, and the cooler and lower-power your designs are.

I'm not sure you're understanding where to use the IRLZ44N. It is a HEAVY-DUTY MosFET for big loads (motors, hydraulic solenoids, etc). It's very hard to read your circuit but in cases where you are doing logic-level rather than heavy load, you need to be using a smaller transistor, like a 2N3904 BJT.

Here is how you wire an IRLZ44N correctly (I did not bother with a flyback around R12):

1740069782013.png

The +5V is there just to show what voltage level the MCU-PIN initially puts out. R9 drops the current to a little over 1mA. R10 is your pull-down to make sure Q1 is off when not being driven by the MCU-PIN. R10 cuts the current to about 0.5mA. This is why you could go with a larger resister here, if you wanted. It takes little to drain a capacitor quickly. R12 represents your heavy load being driven at +24V at whatever current the load requires.

Resistors are generally one of the most common components in any circuit for this reason. Look at the datasheet carefully for any component that is equivalent to MCU-PIN above, and look at max current output of device for all pins. It might only be 40mA (as an example). In which case, the component may reset when it hits that limit. If you have an oscilloscope, learn it, use it- it is invaluable to seeing what is happening over time, and to catch things like spikes etc which might throw you outside your envelope.

This will help you:

Title: Understanding Basic Electronics, 1st Ed.
Publisher: The American Radio Relay League
ISBN: 0-87259-398-3
 

sghioto

Joined Dec 31, 2017
8,634
The +5V is there just to show what voltage level the MCU-PIN initially puts out. R9 drops the current to a little over 1mA.
There is no practical current flowing through the gate.
The R9 + R10 combo draw 0.34 ma from the MCU but R9 drops the voltage at the gate to 3.4 volts as well. Forget R9!
If one insist on using a series gate resistor then a 220 ohm would suffice.
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,577
Charging and discharging the gate capacitance is where drive current capability is required. THAT can be a serious inconvenience at times. And it is certainly why gate driver circuits are sometimes rather complicated. Especially for POWER MOSFETS. That freedom from BASE driving circuits is not free.
 

Thread Starter

mbari

Joined Feb 15, 2025
8
One question is about why is the power to the processor being switched?? Normally a sleep mode would be used to conserve power.
Do you mean power to the Raspi?

If so, I can tell you that the application vary its sleep time from 5 minutes to 24 hours, depending on user request. That led (not my decision) to this setup.
 

Thread Starter

mbari

Joined Feb 15, 2025
8
The gate is voltage driven, but the component you output that voltage from is current driven. You cannot have voltage without current. You must ALWAYS be aware of current in your circuit. The more current you conserve, the more current you have to use, and the cooler and lower-power your designs are.

I'm not sure you're understanding where to use the IRLZ44N. It is a HEAVY-DUTY MosFET for big loads (motors, hydraulic solenoids, etc). It's very hard to read your circuit but in cases where you are doing logic-level rather than heavy load, you need to be using a smaller transistor, like a 2N3904 BJT.

Here is how you wire an IRLZ44N correctly (I did not bother with a flyback around R12):

View attachment 342853

The +5V is there just to show what voltage level the MCU-PIN initially puts out. R9 drops the current to a little over 1mA. R10 is your pull-down to make sure Q1 is off when not being driven by the MCU-PIN. R10 cuts the current to about 0.5mA. This is why you could go with a larger resister here, if you wanted. It takes little to drain a capacitor quickly. R12 represents your heavy load being driven at +24V at whatever current the load requires.

Resistors are generally one of the most common components in any circuit for this reason. Look at the datasheet carefully for any component that is equivalent to MCU-PIN above, and look at max current output of device for all pins. It might only be 40mA (as an example). In which case, the component may reset when it hits that limit. If you have an oscilloscope, learn it, use it- it is invaluable to seeing what is happening over time, and to catch things like spikes etc which might throw you outside your envelope.

This will help you:

Title: Understanding Basic Electronics, 1st Ed.
Publisher: The American Radio Relay League
ISBN: 0-87259-398-3

Thanks for the reading advice, I really appreciated it!

About the IRLZ44N: beside the misuse in a high-side switch (even if I noticed that it's also possible to either low-side switch with a P-channel or high-side switch with a N-channel; not going further for the sake of my mental health), I had the misbelief that, being logic-level, it could be directly driven by the 3.3V MCU pin of my XIAO.
 

BobaMosfet

Joined Jul 1, 2009
2,211
There is no practical current flowing through the gate.
The R9 + R10 combo draw 0.34 ma from the MCU but R9 drops the voltage at the gate to 3.4 volts as well. Forget R9!
If one insist on using a series gate resistor then a 220 ohm would suffice.
I see what you're saying about R9, but you MUST ALWAYS use a gate resistor on the gate to stop inrush current.

1740175960752.png
 
Last edited:

BobaMosfet

Joined Jul 1, 2009
2,211
Thanks for the reading advice, I really appreciated it!

About the IRLZ44N: beside the misuse in a high-side switch (even if I noticed that it's also possible to either low-side switch with a P-channel or high-side switch with a N-channel; not going further for the sake of my mental health), I had the misbelief that, being logic-level, it could be directly driven by the 3.3V MCU pin of my XIAO.
Hope the book helps.
 

MisterBill2

Joined Jan 23, 2018
27,577
Ok but 220 ohms max as I stated previously.
Understand that THERE IS ALWAYS A TRADE-OFF involved with the gate resistor! There is ALWAYS needing to limit the charging and discharging current of the gate/source capacitance, while still avoiding spending excessive time in the linear control mode where the current is increasing and power is being converted into heat. Understand that while the mosfet saturated (fully ON) resistance is very small, the switch-on action is never instant.
 
Top