# Considering input pin impedance when calculating pull-up resistor value

When calculating the value of a pull up resistor , i am dividing the Vcc voltage by the desired current value. simulate this circuit – Schematic created using CircuitLab

But since impedance of the input pin and my pull up resistor are connected in series, shouldn't we take the 1 Mega Ohm input impedance into account when calculating the expected current value ?

• Try it out and you will see how big the difference is. – PlasmaHH May 25 '16 at 19:32
• 5 mili A , dont you think it is sort of a big difference. – Dogus Ural May 25 '16 at 19:37
• $I = \frac {V}{R} = \frac {5}{1M} = 5~\mu A$ and not 5 mA. – Transistor May 25 '16 at 20:08
• he asked the current difference between 1M ohm+ 1k ohm vs 1k ohm. – Dogus Ural May 25 '16 at 20:20

You can if you want.

Let's see what we get:

Vio = Vdd * Ri/ (Ri + R1)

Vio = 5 * 1e6 / 1.001e6

Vio = 4.995 which we engineers like to call 5, or since you are using this as a digital input, 1.

If you follow the manufacturer's recommendations in the datasheets and app notes, you really don't need to worry about the input leakage current.

You may care in high precision applications or extremely low power applications, but not as a button input.

• So maximum amount of current a pin can handle is calculated without the input impedance . Is this corrent ? – Dogus Ural May 25 '16 at 19:40
• Yes. Sinking and sourcing current limits are given for low impedance (output) mode (typically). – Ryan B May 25 '16 at 19:48

The current rating for an I/O pin is the maximum current that the pin can source or sink when it is used as an output. When the pin is used as an input, the current in or out of the pin will be near zero.

When selecting a pull-up resistor for an input pin, you should look at the current the device driving that input can handle, and, for faster signals, the effect of the resistor value on the signal risetime. For a switch input, 5K - 10K is a reasonable pull-up resistor value.