MCU Pull-up resistors maximum value

Thread Starter


Joined Jan 17, 2007
Question, what is the recommended maximum value for biasing an input in an MCU? In this case, I'm talking about the PIC16LF1823.

Of course, said MCU has its own internal pull up resistors, if one wishes to activate them. But I've discovered that they consume an unacceptable amount of power. My guess is that the distance between the MCU, the pull-up and (in this case) the switch is important. For instance, I'm sure it's not the same if the switch is only a few mm away from the MCU than if it's located one meter away.

In my case, the switch is located only about 2mm away. It's extremely close. Would a 1M resistor do the trick? Would 4M be too high? Or is it a question of trial and error?


Joined Aug 7, 2020
A good choice would by a tenth of the "off" resistance of the switch. At a guess the switch will measure at least 10M when new, so 1M should be fine. But what happens after a period of use? Is the switch still as good? Is there moisture on the pcb, or any other conductive contaminants.
Use a switch with gold-plated contacts, otherwise it needs some current through it to keep the contacts clean. If not they oxidise and then don't switch ON properly.
Is it a momentary switch? If so, how do the PIC's pull up resistors manage to consume any current? If the switch is OFF there is nowhere for the current to go. If I remember correctly, PICs can have pullups switched on and off individually. Are you sure that you are not switching on pullups that are permanently pulled down?


Joined Jan 18, 2008
Noise seems to be a limiting factor. Very low noise environment would allow a weaker P/U.


Input leakage current (D060) max is 125 nA. That current across an 8 MΩ pullup would give about a 1V drop. A pullup resistor of 8 MΩ seems huge.
The above table suggests that the minimum designed (but not tested) P/U current is 25 uA @ 5V ≈ 200kΩ

If that's acceptable for design, maybe your external P/U could be that big or a little more.

Thread Starter


Joined Jan 17, 2007
Thanks for the advice, John and Ian.

My device is working at 3.3V and the switch in question is a reed, which is encapsulated in glass, so no contamination will ever reach it. It's being powered by a set of four AAA batteries, and I'd like them to last as long as possible. Right now its drawing 14.7 µA and that means that good quality batteries will last for about up to 7 years... every micro amp counts...

In my design, the pull ups are only needed for biasing the MCU's inputs, so the datasheet's minimum current of 25 µA seems unnecessarily large to me. Thanks for pointing the appropriate section in the datasheet that I should've looked up. Of course I always check them but I'm not as experienced as other people and some nuances escape me.

I've tested a 4MΩ pull up and things seem to be working fine. Current has gone up by only 0.8µA after that. Now I'm going to buy 6, 8 and 10 MΩ resistors to test them and see how things work out. The device is in a very low noise environment so I'm fairly optimistic.

Again, many thanks for your help.


Joined Jan 29, 2010
hi cm,
I have had some poor experiences with Lithium batteries some years ago, after a couple of years or so. leaking a corrosive liquid.
I would advise checking with the battery manufacturer.