From here, I see below illustration about the pull-up resistor.

enter image description here

And the article says:

With a pull-up resistor, the input pin will read a high state when the button is not pressed. In other words, a small amount of current is flowing between VCC and the input pin (not to ground), thus the input pin reads close to VCC.

It gives me an impression that the current in and out of a MCU is so small that it can be ignored when analyzing the behavior of the circuit external to the MCU.

Such assumption may simplify things a bit. But is it OK?

  • \$\begingroup\$ An input pin usually has fairly high impedance. But it depends on how it is configured, too. If it is simply a digital input pin, it's likely that the input impedance is on the order of \$100\:\text{k}\Omega\$ or better (to both rails.) \$\endgroup\$
    – jonk
    Commented Oct 25, 2020 at 4:08
  • \$\begingroup\$ @jonk It seems for a digital input pin, the higher the input impedance is the better. \$\endgroup\$ Commented Oct 25, 2020 at 4:09
  • \$\begingroup\$ The datasheet for the MCU will tell you a lot more detail. It's not hard to read one. And if you were asking (I cannot tell), then yes higher values (such as \$1\:\text{M}\Omega\$) is better. \$\endgroup\$
    – jonk
    Commented Oct 25, 2020 at 4:10
  • \$\begingroup\$ @jonk Yes, I believe a datasheet can give me a specific value. But I just want to know why high input impedance is better. Is it because high input impedance can make the disturbance of connecting a MCU insignificant? Just more like nothing is connected. \$\endgroup\$ Commented Oct 25, 2020 at 4:12
  • 1
    \$\begingroup\$ Yeah. Infinite impedance would have zero interference. So big numbers are better. \$\endgroup\$
    – jonk
    Commented Oct 25, 2020 at 4:16

1 Answer 1


Maybe. For values in K ohms usually you can ignore it, unless you're doing something with unusual operating environment or high reliability. It never hurts to read the datasheet thoroughly when you are considering spec'ing a new part though.

Of course if you enable internal pull-ups or pull-downs then you will generally have to take those into account.

If you try to minimize switch-closed consumption by using a resistor value like 10M then you will find that the MCU maker won't necessarily guarantee that will work.

For example, the Microchip ATMega328p has the following guaranteed characteristics:

enter image description here

1uA of leakage is enough to overcome the few hundred nA from the 10M resistor, so it might not work. Chances are the current will be much lower at Ta << 105°C so it might be okay for a toy or consumer device.

There are reasons not to use too low a resistor value (wasted power, possibly switch wear in extreme situations) and too high a value (switch reliability, leakage due to the semiconductors or contamination on the PCB and possible pickup of EMI).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.