For a project, I made an environmental sensor system, consisting of an Arduino Pro Mini 5V (with ATmega328P microcontroller), 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!

  • \$\begingroup\$ The answer would depend a lot on the actual sensors. Could you post the links to the datasheets of your sensors? (A schematic wouldn't hurt here either.) \$\endgroup\$ Aug 22, 2018 at 17:41
  • \$\begingroup\$ Irrespective of how you control power, remember that you must not apply signal voltages to any unpowered sensors' pins, unless the sensor data sheets explicitly allow signal voltages to be above the supply voltages. Getting this wrong can not only stress things, but can mean that you actually end up (at least partially) powering the sensors through their their signal pins and protection diodes, potentially negating the benefit of switching power, and also potentially causing either damage, or mis-operation when they try to start up from a "partially powered" state. \$\endgroup\$ Aug 22, 2018 at 18:28

1 Answer 1


The way you powered your sensors is exactly correct, using an external FET to switch the supply.
I'd almost bet that the difference you see in the current is due to some capacitance in the sensors.

In both situations I am assuming you actually use an I/O pin on the Arduino:

  1. Using the external FET you are driving the FET gate from the Arduino pin. The gate does have some capacitance, but you'd be hard pressed to show the voltage rise on the pin without an Oscilloscope, and even more challenged to accurately measure the current from the I/O pin in charging the gate. This gate capacitance is why you see the series resistor added from the I/O pin to the gate ….to limit the maximum current drawn (you sacrifice turn on time). When the FET turns on, it is capable of delivering much more current from the VCC supply than the I/O pin, so charges the sensor capacitors very much more rapidly. The high current (it may actually be 10-100mA) during which the sensors supply voltage increases will be very short. Without an Oscilloscope you will never see this effect.

  2. When powering sensors directly from the I/O pin you have to directly charge any capacitors in the sensors (could be anything from 0.1-100uf depending on the sensor) via the I/O pin. To charge this capacitance you have to draw a lot of current from the I/O pin. The I/O pin exceeds its current rating and the voltage drops, which simply increases the time taken to charge the sensors capacitors.
    This allows you to see the current flow for much longer, and it's easier to see on a multimeter (I assume this is what you did).

Powering sensors directly from the I/O pins might in the extreme pop the fuse for that I/O block in the MCU. I'd advise against it unless you really understand your sensor circuitry.

For very low current functions such as a real time clock, you will see them controlled directly from an I/O pin. Again, providing you know exactly what the function/sensor circuit is you are taking a risk.


You don't describe your sensors in any detail, but the capacitance I'm talking about is that which would be used on the supply line:


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ Thanks for your answer! Very helpful. Just to clarify that your assumptions were right: • Yes, in both situations I am using the I/O pin of the Arduino • Yes, I measured the current with a multimeter Now, based on your answer I still have some questions: \$\endgroup\$
    – Difster
    Aug 23, 2018 at 10:05
  • \$\begingroup\$ 1.You said the difference in current is probably due to some capacitance in the sensors. The sensors I am using are: Float switch: consisting of a reed switch and activated by a magnet in the float; Flow sensor: Based on Hall effect sensor and activated by a ring magnet in an impeller; Temperature sensor: Consisting of a waterproofed thermistor; Moisture sensor: Consisting of two copper electrodes with, when present, moisture acting as a conductor between the electrodes. \$\endgroup\$
    – Difster
    Aug 23, 2018 at 10:10
  • \$\begingroup\$ (rest of question 1) All Sensors are used in combination with a resistor, serving as either a pull-up (float and flow sensor) or voltage divider (thermistor and moisture sensor) Would you say these sensors are likely to have some capacitance? \$\endgroup\$
    – Difster
    Aug 23, 2018 at 10:11
  • \$\begingroup\$ 2. You said there is current between the I/O pin and the gate, to charge the gate. Is that current draw not very small, since the resistance of the MOSFET is very large? Is a resistor therefore really necessary? Seems to have been working fine so far for me without one. How’s that possible? \$\endgroup\$
    – Difster
    Aug 23, 2018 at 10:12
  • \$\begingroup\$ 3. Why is the FET able to deliver more current than the I/O pin when it turns on? Because it discharges at the time of switching, comparable to a capacitator? Or is there another reason? \$\endgroup\$
    – Difster
    Aug 23, 2018 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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