ATTiny parasitic power from Digital Inputs

Hi, I'm using an ATTiny84 in a project to read some digital input pins, and control some digital outputs.

Most of the time, the ATTiny is powered externally from a 5v power supply. However I've discovered that the ATTiny will still be powered if VCC is disconnected, but one of the Digital In pins is high. I thought initially this was through one of the pull up resistors, but it still happens when I disable the internal pull-up's.

It looks now like this is happening because of the protection diodes: Voltage on analog pin arduino when arduino turned off - Arduino Stack Exchange

Is there any way to disable or work around this behaviour, to safely allow the digital in's to see 5v on the input, when VCC is not connected? When VCC isn't connected, I'm not worried about what the ATTiny does when it's in that state - at the moment it just sits in a reset loop every few seconds, which is ideal.

I'd rather avoid having external resistors, diodes, or relays (as I've seen suggested in some places) if possible, that's all.

Is that possible? If not, how likely is it that the chip would be damaged being powered in this way for short periods. 99.9% of the time, there will be external VCC.

Thanks

Very likely.
You shouldn't connect 5v directly to an input. Place at least a 5K resistor betwen the 5V and pin. In general it's not a good idea to have powered devices connected to non-powered devices.

2 Likes

I've experienced near instant death in such a situation. Not only the chip, but also an LED was parasitically powered. Took a second or so and it was dead.

If you can not guarantee that your input is not powered when your chip is powered down, use optocouplers. A resistor in the input line is also a possible solution but just a little less robust, and in that case you still need to share grounds between the circuits. An optocoupler allows for complete electric separation.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.