Arduino drawing power from the IOs

Hi there,

My arduino is monitoring the 5v output of a regulator (both of which share a common ground) the arduino will read the voltage on a digital pin to know if the regulator is on or not.

but sometimes the arduino is not powered.

but if the arduino is not powered but the regulator is, then the arduino still boots up by drawing power through its IO pin.

so firstly, has anyone else had this problem? and secondly is there any way to isolate the pin but still monitor the supply using minimal extra components?

thanks

“so firstly, has anyone else had this problem?”
It’s not really a “problem” as much as mis-use of the hardware. High level signals will power the '328P processor thru the input diode clamp protection circuit. That’s why the spec says not to put more than VCC + 0.5V on the IO pins.

" is there any way to isolate the pin but still monitor the supply using minimal extra components?"

You can instead use the regulator to drive the base of an NPN transistor, with the emitter to Gnd, and the collector to an IO pin that is set to input with its internal pullup resistor enabled. When the base is high from the regulator, the transistor turns on and pulls the input pin low. If the 328P is not powered, the pin is just low.

Example circuit

Other simple solution is to put a resistor (like 10k) between the regulator output and the arduino input.

Ciao, Ale.

Would that prevent the clamping diode from conducting or just limit the current flowing into the processor?

I guess limit the current, to the point where the voltage drop to low to switch on the mcu.

Ciao, Ale.


When the Arduino is powered off, the diode will bypass the small current to Vin, which will be not near enough for Arduino's regulator to even "think" of powering up.

Bite the bullet, just leave the Arduino powered.

.

thanks for the replies everyone,

i like the idea of a simple transistor, that is only 2 components more and provides better isolation than a resistor.

i was also thinking that an opto would work as the best way to isolate the pin.

the regulator is 5v its exactly the same voltage as the VCC to the arduino, but i guess when the arduino is off, the regulator is a lot higher than the VCC that the arduino sees when off.

the ATmega cannot be powered constantly as it is on a battery and i can’t have any drain on the battery.

thanks again for the help guys, i have a few ideas now, and i understand what i did wrong.