Arduino Pull Up Resistor Question

Hey Everyone,

I have two arduino digital pins hooked together they both have INPUT_PULLUP enabled on pin 5. A wire connects the two, when I ground one of the pin 5 the other gets grounded as well. Which is what I want to happen. Now this is the part I cant figure out, when I unplug one of the arduinos the other one that is still running pin 5 will get grounded. So I figured the internal pull up is too weak and theres some weirdness with a floating ground. So I turned off INPUT_PULLUP and just switched to INPUT on pin 5 and added a 1k pull up resistor to 5v on the arduino that stays on. Even after that when I turned off the second arduino, the arduino that stayed on pin 5 is grounded. Is there something that I am missing, I dont see how the second arduino without power is overriding a 1k pullup still?

Thanks

You can't apply an external voltage to an Arduino that exceeds Vcc - otherwise the device will be backpowered through the protection diode - every pin has an internal diode connected to Vcc and Gnd, to keep the voltage on the pin from getting higher than Vcc or lower than Gnd (which would damage the part). However, these diodes are very small, and can only carry a very small amount of current - you don't want more than 1mA going through them.

Luckily you did it via a pullup resistor; had you done it through an output driven high, you could have damaged the powered down Arduino (backpowering the board through a pin, and exceeding output current limits are the two most common ways to blow a pin).

Thanks DrAzzy, after doing some research came to the same conclusion and figured it was the ESD protection diodes. So because I have the 5v when I turn off the other device the voltage powers the diode and connects the powered arduinos pin 5 to GND essentially?

I think my solution will be to switch the logic and have pull down resistors then on the shared pin 5.

amano001:
I think my solution will be to switch the logic and have pull down resistors then on the shared pin 5.

This will likely NOT help you. Idle state will be GND and powering off the second Arduino will not interfere with it. But when the something pulls up the common line it will again backpower the powered down Arduino - probably damaging it if the driver is strong enough. For this you need some external hardware. I think simple diode between pin 5 and the common signal will be enough (with internal pullups enabled):

Pin 5 of the first Arduino – |>| – signal here – |<| – pin 5 of the 2nd Arduino

Hmmm I see what you are saying. Pin 5 of the powered off arduino will get back powered when the switch pulls 5v up. Since no resistor like in my original design to limit current it could end up damaging the ESD Diodes?

Also had a question if I have the 5v going into those inline diodes what kinda specs would I need. The voltage requirement is fairly low but how will the current be since when the diode is forward biased from the intenral pull up and the switch going to gnd will is not be very small. Therefore causing a large current to flow from the pin (possibly blowing it?). Guessing I need a resistor inline with the diode to limit current?

Thanks

Use a (Schottky) diode inline as I tried to suggest on the previous "picture".

Sorry I am not following, Schottky from my understanding usually just have a lower voltage drop than normal silicon diodes. Would there still not be a slightly large current flowing from pin 5 to Gnd through the schottky?

Thanks for your help!

When you put a voltage on a powered down micro, the internal diode that conducts is the one between that pin and Vcc of the unpowered microcontroller. If you have a low-impedance voltage source connected, you can actually start to power the device through that diode (hence "backpowering").

amano001:
Sorry I am not following, Schottky from my understanding usually just have a lower voltage drop than normal silicon diodes. Would there still not be a slightly large current flowing from pin 5 to Gnd through the schottky?

Thanks for your help!

It will work for high side switching (connected GND and cut power to one Arduino) with your original logic. Advantage of Shottky is lower forward drop so when the Arduino is powered and the something pulls down the pin 5 will see lower voltage - more "in specs" for LOW. But normal silicon diode "should be OK".

Hey DrAzzy,

If I use the 5v source from the powered arduino and use a pulldown resistor, is it possible that it will not backpower or blow the esd diodes when I connect the 5v from the powered arduino to pin 5 of the unpowered arduino?

The switch on both schematics is just referring to a SPST switch that I have hooked in to either 5v or gnd

pin 5------pull down resistor-------------------pull down resistor--------pin 5
+
+
+
Arduino Source 5V Switch

Smajdalf I will give the diode circuit a try! Pin 5s will have internal pullup enabled

pin 5 ----------schottky---------------------schottky-----------pin 5
+
+
+
GND Switch

Just wanted to say it worked great! Diodes inline solved the issue. Thanks for the info both of you!