LED powered with digital input pin?

Hey All,

Quick question, in playing around, I had accidentally hooked up an LED to a pin set as INPUT.

What got me is that the light lit-up, although it was very dim.

When an Arduino pin is set to INPUT, doesn’t that mean that current is to flow into it, and not out?

The current flow is irrelevant. It just has to sense the voltage on the pin. If there is a pullup it might turn on your LED.

Ah, a pull up might have been present! I was setting an INPUT pin to HIGH, which I believe activates the 10K pull up.

So, to confirm then, changing a pin to INPUT does not change the direction of current? It still flows out of the pin, and not into it?

Current will flow based on the Thevenin equivalents of the two circuits. It really doesn’t matter whether it is an input or output. It all depends on the equivalent voltage source and impedance of each circuit. Since the input only cares what the voltage is, the direction of current flow does not matter. However, if there is too much voltage/low impedance in the input circuit (compared to the driver), it can affect the voltage at the input pin.

Often, if the input is measuring a high voltage current will flow into the pin, and if it is measuring a low voltage, current will flow out.

Keith, that makes a lot of sense. Thanks so much for your replies.

I feel though that I could grasp this just a bit better. Would you be so kind as to setup an example, not only for my education, but everyone else might come by the thread? I would really like to understand this situation inside and out.

For example, what would you define as the two circuits?

Also, I’m not 100% sure what this means “However, if there is too much voltage/low impedance in the input circuit (compared to the driver), it can affect the voltage at the input pin.”

Thanks again from a young aspiring hobbyist!

The first circuit is the input which might look like a 2.5 V voltage source with a 100K ohm resistor in series. The Input voltage is sensed at the end of the resistor. (i.e., not between the battery and the resistor. The other circuit might look like a 5V source with a 100 ohm resistor in the high state and a 0V source (a short) with the same 100 ohm resistor in the low state. When the circuits are connected, the voltage is pretty much 5 V for the high state and 0 V for the low state. But the current flow will reverse for each state.

If the other circuit’s impedance should switch to 1M ohm, the voltage at the input will be much closer to the 2.5 V, than 0 or 5.