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

Hi Difster,

Sorry, haven't got time for a longer answer, but to answer a couple of your questions:

You need the series resistor because the MOSFET gate will have a large capacitance (especially for a power MOSFET which will typically be about 1nF). If you connect the gate directly to an output pin you will get a large current for a small amount of time. This may damage the output of the Arduino. It may not be obvious you have damaged the Arduino unless you look at the waveform on an oscilloscope (I have seem usual amounts of noise or rise times that are slower than you would expect). I must admit I am not sure how much you can get away with - but if you put a big enough capacitor on an output pin you probably are going to damage that output.

Regarding the 4mA sensor current, you need to be careful about the start-up current and possible spikes / surges etc. Typically you may find a small electrolytic capacitor on the sensor power line to smooth these out. But again, ideally you don't want to connect capacitive loads to output pins.

Jon.