2
\$\begingroup\$

I'm planning to use an Arduino to control another chip by switching its power on and off using an N-Channel MOSFET, sort of like a SPI chip enable.

schematic

simulate this circuit – Schematic created using CircuitLab

I'm just a little worried that doing this could damage the chip because there still might be (logic-level) voltages coming in on its IO pins.

Should I be worried about this or will it be safe to use this circuit to switch the power off to the chip?

Any other comments about this circuit? Should it work?

\$\endgroup\$
  • 2
    \$\begingroup\$ Generally no, it is not proper, and in many cases you will end up dragging down the I/O lines while "sort of" powering the chip through I/O protection diodes. But there are chips that can tolerate this including those that would not load the lines. You have to read the data sheet of the specific part. \$\endgroup\$ – Chris Stratton Sep 27 '16 at 5:58
  • \$\begingroup\$ If you need to save power just use a low power state of the micro. I do not see many hobby applications where some uA cannot be tolerated. \$\endgroup\$ – Vladimir Cravero Sep 27 '16 at 7:17
  • 1
    \$\begingroup\$ Your worries are very well justified. I have seen your example scenario do very strange things to a microcontroller. And to many CMOS chips in general. It involves parasitic SCR's hidden in the chip substrate. Extremely hard to troubleshoot. Very strange, bizzare, otherworldly....yikes. \$\endgroup\$ – glen_geek Sep 27 '16 at 20:47
9
\$\begingroup\$

Probably not, unless specifically stated as such. One indication it isn't is a specification such as this one:

enter image description here

When Vcc is 0V, it is not recommended to have more than 0V at the inputs.

However, there are ways to isolate the chip you want to power down - for example using a voltage translator chip such as the 74LVC1T45 which is fully specified for leakage with one of the Vcc rails at 0V.

As well, you should use a P-channel MOSFET to switch the power. Low = ON.

\$\endgroup\$
  • 1
    \$\begingroup\$ Thanks, I just checked the datasheet and it says that the input to any pin must be less than 0.5V+Vcc. So that won't work. \$\endgroup\$ – localhost Sep 27 '16 at 6:44
4
\$\begingroup\$

Warning

This circuit will not work as expected.

A MOSFET can be thought of as a voltage controlled device. What this means is that the MOSFET will only turn on when there is a large enough voltage between the MOSFETs gate and the MOSFETs source. This is known and Vgs(th) (voltage between gate and source threshold) in the MOSFETs datasheet.

In this circuit, lets say the Vgs of the MOSFET is 2V. This means that for a source voltage of 5V, the gate of the MOSFET has to be at 7V to be fully turned on. Since the gate voltage is maximally 5V, the source can never be at 5V.

What will happen is the MOSFET will be in its "linear region" where it will behave almost like a resistor. It will drop some of the voltage and the source will not see 5V.

Is it safe to switch Vcc of Chip while IO still connected?

In general, no. This is only safe if you can make sure that there are no voltages present on the other pins.

\$\endgroup\$
2
\$\begingroup\$

If Chip Vcc and Arduino Pin Output has the same voltage level (at least it seems so) then you cannot simply drive M2 MOSFET. Because an N-Ch. MOSFET requires its gate voltage to be greater than its source voltage by at least VGS(th) given in the datasheet. For the MOSFET you're planning to use, VGS(th) is about 1V (Please check it under "Electrical Specifications" table in the datasheet: https://www.sparkfun.com/datasheets/Components/General/RFP30N06LE.pdf).

Of course you can switch the chip on and off by its Vcc pin:

schematic

simulate this circuit – Schematic created using CircuitLab

By the way, if I were you, I would simply disable the CLK pin externally without cutting off Vcc.

\$\endgroup\$
1
\$\begingroup\$

Many datasheets are severely underspecified with regard to such issues. Some devices will explicitly specify that pins can have voltage applied whether or not VDD is powered, but on most devices there is some sort of inherent diode or transistor structure which will clamp pin voltages to VDD. If the presence of a diode would prevent a circuit from meeting requirements when power is cut, and the chip doesn't specify that a pin can have voltage applied without VDD, the chip cannot be presumed to meet such requirements. In cases where a diode would not prevent a circuit from meeting requirements, most chips will generally meet those requirements. Unfortunately, "most" does not mean all, and data sheets seldom provide guidance sufficient to know what will work in any particular case.

Generally, there is some amount by which a pin voltage can exceed VDD without any effect whatsoever. No current will flow from the pin to VDD, and no other aspect of device operation will be affected. If the voltage exceeds VDD by more than some amount, current will flow somewhere. If the current flowing into the pin is externally limited, there will be some amount of current below which no aspect of device operation will be affected.

In practice, it should be possible to specify many things about a device:

  1. If the voltage on a pin is kept below some threshold, no excess leakage currents will flow anywhere.

  2. If the current into a pin is limited to a certain amount, leakage will be limited to certain paths and will not affect device operation (except that if some of those paths are to other pins, the leakage may affect operation of whatever is attached to those pins).

  3. If current is limited to a certain [likely higher] amount, it will not cause damage to the device but may disrupt operation.

4-5. If the voltage on a pin is kept below some thresholds [which would likely be higher than #1] the current may exceed the values given for #2 or #3, but will not be high enough to disrupt operation (#4) or damage the device (#5).

Unfortunately, manufacturers seldom provide such detailed specs. In many cases, all they give is spec #1, which is in many situations the least useful. If chips could specify parameters #2 and #4, that would make it possible to construct input-protection circuits with series resistors and/or clamp diodes and know that they were specified to work correctly.

Incidentally, leakage into pins on an unpowered microcontroller which is insufficient to damage it or power it successfully will often be sufficient to prevent the micro from reliably resetting in the absence of a brown-out circuit or external reset logic. When cutting power to a microcontroller, it's often good to ensure that its reset line will get pulled low; you may be able to share the same I/O control pin for the reset and the power-enable if the reset is active low and the power-enable is active high.

\$\endgroup\$

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.