2

As part of implementing Low Power Mode, I wish to control power to attached devices, such as the HC12 transmitter/receiver. I've read of the usage of MOSFETs to control motors and lighting systems, but don't understand the applicability of such implementations to control something like an HC12, which consumes approximately 200ma. Should I be using MOSFET and, if so which one? Else, what is a better solution? The circuit I am now working on is essentially a PRO Micro, an HC12, and a small led, though I will later add a camera module, approx. 100ma.

  • my fav is the IRLZ44N, which are easy to drive from ardunio with a Vgs(th) of a couple volts, built-in dioide, a tiny on-resistance, and up to 55v of switching at 47amps. if you switch less than 20v, a common ground works perfectly with a simple N-chan circuit w/o extra bjt helpers – dandavis Apr 11 '17 at 19:08
2

Yes, MOSFETs are what you want.

The temptation is to just insert any old logic-level N-channel MOSFET in the ground connection to the device like you would when driving a relay, etc. However that method is fraught with danger. You get such issues as ground-level offsets (where ground isn't actually ground but some mV above ground) which can result in logic level mismatch problems. You get the possibility of power trying to make its way to ground through the device's IO pins and your MCU, etc.

So it is best to instead use a P-channel MOSFET to switch the positive power rail to the device. If the voltage you are switching is the same as the voltage you are doing the switching with (i.e., you are switching 5V using a 5V-level GPIO pin such as on an Arduino) then that is really all you need. However if the voltage you want to switch is higher then you will need to switch the P-channel MOSFET with an N-channel MOSFET, or an NPN BJT.

Here's two schemes:

schematic

simulate this circuit – Schematic created using CircuitLab

In the left schematic M1 is kept off by R2, and pulling the control GPIO low it turns M1 on allowing the current to flow.

In the right schematic M1 is kept off by R2 in the same way, but M2, when turned on by the GPIO being driven HIGH. R3 keeps M2 off while the MCU is not ready to drive the GPIO pin yet (in the bootloader, etc).

One thing to remember when switching the power off on either schematic is to first set all the GPIO pins that communicate directly with the device to INPUT mode. That will prevent them trying to power the target device through the IO pins (which will typically have ESD diodes that would feed current to Vcc).

All MOSFETs should be logic level (except M1 in the right schematic which can have a higher threshold depending on the voltage you are switching - best to keep it all logic level though as a rule).

  • How, then, do I go about the process of selecting a suitable MOSFET to utilise? – KC Tucker Apr 10 '17 at 18:25
  • Find one where a) the on resistance is low enough (you want sub 1Ω, better sub 0.1Ω) when V_GS is at your switching voltage (5V), so one with a threshold of no more than a volt or two, and b) can handle the current flow (and heat dissipation) that you require at that V_GS. – Majenko Apr 10 '17 at 18:27
  • IRF540 seems like a suitable choice. However, I am rather less than confident in my ability to properly analyse the myriad of spec. sheets. I will use that until I determine it is a bad decision.. – KC Tucker Apr 11 '17 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.