I'm experimenting with a MOSFET that controls power to another component so that I can remove all current from it when it's not in use and save power. In regards to that, this question is awesome: Switching DC with MOSFET: p-Channel or n-Channel; Low Side Load or High Side Load?

But I'm running into some snags when it comes to practical use.

First approach:


simulate this circuit – Schematic created using CircuitLab

I was able to switch this off fine, but when it was on, I was only getting half voltage out. Turns out I was using an N channel MOSFET wrong, and it's not good as a high side switch like this.

Ideas to fix:

I could move the MOSFET to GND of the LED array with a 100 ohm resistor on the gate. I believe this would allow it to act like a switch in the manner that I really want. However, the addressable LEDs still draw a decent amount of power when their GND is disconnected! It seems the return path goes down the CLK and DAT lines. This is not a problem when VCC is disconnected. This means I would need three MOSFETS, one for each of CLK, DAT and GND, driven by one pin.

I could use a P-Channel on the high side, but to turn it off I need to supply voltage. When turned off, I want to be conserving power with the micro controller in a super low power mode . In that state wasting current holding the MOSFET closed seems wasteful, and I'm not the micro controller could do that in sleep mode.

Both those options seem kind of inelegant. What I seem to need is a simple 4 pin component (VCC, GND, GATE, OUTPUT) that can connect VCC and OUTPUT when I pull GATE high. Does such a thing exist?

What do you think is my best bet for making this work with the fewest/simplest components?

  • \$\begingroup\$ You REALLY, REALLY don't want to only switch power... \$\endgroup\$ Commented Jan 23, 2015 at 7:14
  • \$\begingroup\$ @IgnacioVazquez-Abrams indeed. However, I can easily ensure that the non-power pins have 0V when the MOSFET should disconnect. That should prevent any powering of the LEDs, right? I tested this with a multimeter and saw the current drop from 8mA to 0mA when I pulled the VCC wire out while in sleep mode. Where pulling out GND caused in increase in current to 13mA, which is obviously not good. \$\endgroup\$
    – Alex Wayne
    Commented Jan 23, 2015 at 7:19

2 Answers 2


Holding the P-channel MOSFET closed (gate at 5V) will use hardly any power. It is basically the same as holding an N-channel MOSFET gate at 0V.

(See http://www.vishay.com/docs/91076/91076.pdf for a p-channel version of the IRF530 - same gate-source leakage current of +-100nA max)

To prevent powering the LED array via CLK or DAT you will need to either drive them low or set them to high-impedence when the MOSFET is off. Since CLK and DAT are both outputs, simply driving low is fine.

Note: This does not apply to your circuit here, but for inputs you can use a tristate buffer like the 74LVC1T45 or similar to prevent powering via signal pins... See FTDI (FT232RL) powers itself through RX/TX lines for the solution I used.


Alternative solution with existing parts

Actually, you could just move the N-channel MOSFET to the low side and drive CLK and DAT to 5V when you want to turn the LEDs off and go to sleep. That would address the problem in your first idea.

  • \$\begingroup\$ Interesting. It looks likes my ATTINY85 can keep voltage on a pin in SLEEP_MODE_PWR_DOWN mode. So to turn off, I can set the MOSFET gate to 5V, and DAT and CLK to 0V and it should work as I expect. In this scenario the MOSFET is drawing max 100nA? \$\endgroup\$
    – Alex Wayne
    Commented Jan 23, 2015 at 7:50
  • \$\begingroup\$ Yep. I have an ATMega328P running at 20uA with a mixture of pins in low, high and high-impedence states. \$\endgroup\$ Commented Jan 23, 2015 at 8:05
  • 1
    \$\begingroup\$ @AlexWayne please see my edit. You make the low side switch work by driving CLK and DAT high when the N-channel MOSFET is off. \$\endgroup\$ Commented Jan 23, 2015 at 8:15

you can use an LT1157. Refer to the datasheet for the driving section. I used it for a similar application where my uC had to control the Vcc pin for a 5v@1A device.


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.