# Why does a high-impedance input make it easy for pin to "change state"?

The the attachment, I’ve highlighted the sentence that I don’t understand:

“Pins configured this way [input] are said to be in a high-impedance state. Input pins make extremely small demands on the circuit that they are sampling, equivalent to a series resistor of 100Mohm in front of the pin. This means that it takes very little current to move the input pin from one state to another,…”

AFAIK, an “impedance” is a source of resistance whose resistive value (and phase) changes based on the voltage magnitude and phase applied across it. Ohm’s law (V=IR) tells us that the magnitude of high-impedance (a big impedance magnitude) is inversely proportional to the magnitude of the current flowing across that impedance.

When we connect a uC pin designated as input into a circuit, we essentially connect that high-impedance in parallel with the rest of the circuit. It does not draw much current, having high-resistance.

But applying ohm’s law to that high-impedance source and knowing that the current flowing through it is tiny, we can conclude that the voltage drop across the impedance is also small and even smaller when the voltage source that causes the current flow decreases (e.g., in a switch input). How does a small change in voltage used to “easily toggle pin state”?

One would think that “bigger change in voltage” is directly proportional to “easier toggling” of the pin state.

simple: The information tells you that you can connect anything to the IN-pin - it will practically draw no current.
Often an open input (nothing connected) will read logical '0'
A touch from your finger is enough to make it read '1' . (without a current you can measure)

I apologize in advance for the half-baked, poorly worded question. I did some more thinking and realized what that sentence meant: the higher the input impedance value, the less current is necessary to drive a change in voltage considered to be a "change in state".

This sparkfun article tells us that each of the two LOW-HIGH state is understood as two different ranges of voltages. The parameters we're interested in is ViH and ViL, the minimum input voltage considered by a 5V-TTL logic device to be HIGH and the maximum voltage level considered by a 5V-TTL logic device to still be LOW.

Suppose ViH = 2V, ViL = .8V (as is in the article) and the input impedance is 100Mohm. The current draw through the impedance is 20nA when the input is considered to be HIGH and 8nA when the input is considered to be LOW. We see a 1.2V decrease in voltage corresponding to a change in state (HIGH to LOW). This state change also corresponds to a decreasing change in current value of 12nA.

If we decrease the impedance value to 100Kohm, then a decreasing change in current value of 12uA change in current is necessary

Thus by decreasing the input impedance, we increased the amount of current needed to cause a state change (in this case 12nA to 12uA).

High impedance means low capacity ("little space for charges to fill up") and high resistance ("hard to get away for charges"). It is not surprising that under those circumstances, a potential change is easy to achieve.

Here's a crude (but hopefully illustrative) set of examples:

Imagine the input impedance was ridiculously low, say 1Ω. You'd have to somehow supply 5A to bring the input up to 5V. 5A is a gigantic amount of electricity. You could use it to keep nice and warm but your batteries wouldn't last very long.

If the input impedance was more sensible, say 10kΩ, you'd need to supply 500µA. Your Arduino would be happy working in this range.

If the input impedance is too high, say 100MΩ, then you'd need only 50nA to get 5V. This would make the input far too sensitive - it would pick up enough airborne electromagnetic noise to reach 5V then go back to 0V in an erratic and confusing manner. Every time there was a thunderstorm on a nearby continent, or a neighbour made a mobile phone call, your Arduino would show the pin going high, then low, then high, then low...

GypsumFantastic:
If the input impedance is too high, say 100MΩ, then you'd need only 50nA to get 5V. This would make the input far too sensitive - it would pick up enough airborne electromagnetic noise to reach 5V then go back to 0V in an erratic and confusing manner. Every time there was a thunderstorm on a nearby continent, or a neighbour made a mobile phone call, your Arduino would show the pin going high, then low, then high, then low...

Which wouldn't be a problem, because technically, you are not supposed to leave pins unconnected (Section 18.2.6 of the datasheet). Of course, Arduino is systematically ignoring that and usually, that is not a problem because the MCU doesn't care so much if the state changes, which it does. The ADC actually has an input impedance of 100MOhm.

Typical CMOS input pins have a really high impedance, more than 10^10 ohms DC, a few pF
for AC. This means the voltage on them will easily be affected by nearby signals via stray capacitance
or even ions floating around in the air! Think of such a pin as a voltage probe sticking out of the chip.

Often you see 100M or similar quoted, which is the lowest resistance across the full temperature
range - the room temperature impedance is usually loads larger, its dominated by the tiny
reverse leakage current in the input protection diodes which is very temperature sensitive.

Chips without input protection diodes may have 10^12 ohms input resistance or more (like the original
4000 series CMOS), since the input is completely isolated by the gate oxide from the rest of the chip.
Such chips are really easy to damage as charge can build up on the pins until the gate oxide is over-stressed and fails.

ElCaron:
Which wouldn't be a problem, because technically, you are not supposed to leave pins unconnected (Section 18.2.6 of the datasheet). Of course, Arduino is systematically ignoring that and usually, that is not a problem because the MCU doesn't care so much if the state changes, which it does. The ADC actually has an input impedance of 100MOhm.

The only downside to unconnected inputs is slightly higher current draw. And even then the fix is dead easy: use INPUT_PULLUP on every unconnected pin.