Go Down

Topic: Prevent Arduino taking power from input pin. (Read 261 times) previous topic - next topic

neilbaker86

I have a 5V DC signal coming from an external device, which is there permanently, even when my Arduino is powered down.

I need to be able to monitor this signal, to see if it ever goes low (to ground), and also be able to short it to ground myself.

What is the best way of connecting this to my Arduino, as I've read that the Arduino will attempt to power itself through the digital input pin from this external device when it itself has no power.

Any help or advice would be much appreciated!

DaveEvans

#1
Jun 14, 2018, 10:58 pm Last Edit: Jun 15, 2018, 03:18 am by DaveEvans
....deleted...because @Wawa's advice is so much better...

Wawa

The solution depends on the '5volt signal'.

If grounds can be shared, and the signal can sink:
Use internal pull up on the pin, and a diode (1N4148) between pin and signal (cathode to signal).

If grounds can be shared, and the signal can source:
Use internal pull up on the pin, and an NPN transistor between pin (collector) and ground (emitter),
with a 100k resistor to the 5volt signal.

If grounds can't be shared:
Use internal pull up on the pin, and an opto coupler, with opto transistor between pin and ground,
with the opto LED driven by the signal via a (~5k) current limiting resistor.
Leo..

ted

#3
Jun 15, 2018, 03:55 am Last Edit: Jun 15, 2018, 03:56 am by ted
The inputs have high resistance, I think the leakage current is in range 5uA @ 5V

westfw

Quote
The inputs have high resistance, I think the leakage current is in range 5uA @ 5V
It's not leakage that's the problem.  The protection diodes present on IO pins will conduct when the AVR is otherwise unpowered and inputs are connected to +V, and this will power the chip (perhaps unreliably, since it may not include all the power pins.)

ted

I measured the resistance on one of pins when power is off it is 2.5 MΩ, to that pin is connected LCD, 60% pins are connected to something.

septillion

#6
Jun 15, 2018, 10:06 am Last Edit: Jun 15, 2018, 10:30 am by septillion
@ted, you might want to watch this. I don't know how you measured it but you can't do it just in the ohms range of a DMM. The diodes are non-linear and the current depends on what else is connected to the uC. Just don't connect power to an input when it's off ;)
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

ted

You right, I connected 3V trough 10k resistor = 100uA,

Go Up