Turning off external sensors with Arduino: MOSFET vs I/O pin

Hi everyone,

For a project, I made an environmental sensor system, consisting of an Arduino Pro Mini 5V, a data logger module and three sensors.

To save power between data logs I used several techniques I read about online, including turning off the power to the sensors using a MOSFET (I used the IRLB8721PbF).

Recently, I started reading a bit more about MOSFET's and turning off external devices with Arduino's, and I realized that since my sensors only use about 4mA, I could have used the a I/O pin (set to output) on the Arduino instead.

As I was curious to see if there were any difference in current draw between the two methods, I tested the current draw when using the MOSFET vs when using the I/O pin to turn the sensors on. When using the MOSFET, the current draw increased with 4 mA when the sensors are turned on, corresponding to the sensor draw. However (!) when using the I/O pin the current draw first shortly increased with 6 mA, after which it settled at a 4 mA increase. These differences would suggest that it is more power efficient to use a MOSFET, even with low current draw apllications.

Now my question is (1) why do I see this short spike to 6 mA increase in current draw when using the I/O pin to power on the sensors? (2) And is it more preferable to use a MOSFET even with low current draw applications and why?

Another thing related to this: I recently read that a resistor in series with the gate is necessary when using a MOSFET, however I have been using the MOSFET for my application without a resistor and I have had no problems whatsoever for more than 6 months and counting. (3) Could someone explain why it has been working fine for my application? Does it have something to do with the fact I use the MOSFET to switch a low current draw load? Or does it have something to do with the type of MOSFET I am using (the IRLB8721PbF).

Lot's of questions, I'm kinda new to electronics...

Thanks in advance for taking the time to answer!

Difster

A N channel mosfet can only switch the low side, or common, of a device. This works for two lead devices such as solenoids, relays, lamps and led’s but it does not always work for devices that have more than one current path.

Powering a low current device with an output pin can work but since you don’t mention actual devices or provide a schematic of how you connected things, it’s difficult to comment in detail.

Hi,
What are your sensors?
If any are I2C or SPI you may need to restart the sensor each time you re-apply power.

Tom.... :slight_smile:

Difster88:
Recently, I started reading a bit more about MOSFET's and turning off external devices with Arduino's, and I realized that since my sensors only use about 4mA, I could have used the a I/O pin (set to output) on the Arduino instead.

No, probably not a good idea.

Two big problems doing that:

  1. Output pins have a fairly high impedance, 40 ohms or so, so instead of providing a solid 5V rail to the
    sensor you have one that will sag as the sensor's current consumption changes, imposing that variation
    onto the sensor's output voltage if its analog 4mA x 40 ohms = upto 0.16 V variation.

  2. You forget about decoupling. The sensor's supply needs decoupling, and a decoupling capacitor is too
    harsh a load to drive from an Arduino pin - logic signals can be expected to drive a few 100pF capacitive
    load, but 100nF or more? Not a good idea as the charging spike for the cap might be 100mA or more.

One or other of these issues will apply, 1) for analog sensor, 2) for digital.