Take the 2-minute tour ×

I've been researching pullup and pulldown resistors after seeing them used in many digital circuits and while I understand what their purpose is, I haven't found any resource on how to determine the resistance values to use in such circuits and how these values affect the circuit's behaviour.

One of the examples I have is...

ADC Keypad Circuit

...which is an A/D converter circuit for a keypad input. I have implemented this and it actually works very well but I can't quite pinpoint why a 1Mohm resistor was picked as the pullup and what exactly happens to it when one of the buttons are pressed - does it affect the voltage of the ADC input in such a small amount that it doesn't register or is it overridden somehow or...?

I know this is probably a very basic question but I can't seem to apply the thoery I have learned to this one.

share|improve this question
Possible duplicate: electronics.stackexchange.com/questions/1849/… –  endolith Oct 4 '10 at 13:54
Somewhat related: electronics.stackexchange.com/q/76376/2028 –  JYelton Jan 6 '14 at 16:56

2 Answers 2

up vote 15 down vote accepted

That 1M is there just to make sure that the ADC input pin isn't totally free-floating, and also gives a known voltage (+5) when no switches are pressed. This keeps the ADC from picking up ambient noise from the rest of the circuit.

The reason for the value of 1M is a compromise between a value low enough to keep the ADC input from acting like an antenna, and a value high enough to not overly skew the result you get when a switch is pressed. When a switch is pressed, that 1M is in parallel with the 'top half' of a voltage divider formed by the 1K resistors either side of the switch.

share|improve this answer
The other side of the compromise is that the resistor values are kept "reasonably" high so that the current and hence power dissipated through the resistor chain is kept small. They could all be made 1R in value but this would waste 1.4 watts compared to the 0.14mW in the chain above. –  ʎəʞo uɐɪ Oct 4 '10 at 12:13
that 1M should pull you to 5V. If you have too large a leakage current for your ADC, which is common, then it can still be pulled somewhere other than 5V. it is for power reasons that it is 1M. Justjeff, I do not know what you mean by antenna, I am 90% sure that the resistance has nothing to do with it being an antenna. –  Kortuk Oct 4 '10 at 14:19
So the 1M resistor wouldn't divide the voltage at ADC to 0V? Does that mean the voltage dividing rule only applies when there are multiple loads in series? –  Mr. Hedgehog Oct 4 '10 at 15:45
The 1M resistor creates a voltage divider with the input impedance of the ADC input pin. If the input impedance is quite high (tens of megohms) then the 1M pull-up becomes insignificant. The fact that there's a small drop across the 1M is not likely important as if the ADC is also powered from +5, there's probably a dead band on the high-side a few hundred millivolts below the supply rail. –  Adam Lawrence Oct 4 '10 at 16:40
Thank you for clearing that up. –  Mr. Hedgehog Oct 4 '10 at 17:52

Suppose we label the first switch num=1, the last switch num=16, then:

$$R_{hi} = \frac{1M\Omega \times num \times 10k\Omega}{1M\Omega + num \times 10k\Omega}$$ $$R_{lo} = (17 - num) \times 10k\Omega$$ $$V_{out} = \frac{5V \times R_lo}{R_{hi} + R_{lo}}$$

share|improve this answer

Your Answer


