Actually a pull-down or pull-up resistor is of no benefit for analog input pins, unless for example the driving signal is a open collector or open drain transistor which requires an external pull-up to establish the output voltage and source impedance.
Yes that is the case.
What is required is that the source impedance of the external voltage divider presents a 10k ohm or lower impedance. Adding external pull-ups or downs to an existing voltage divider just changes the divider ratio thus upsetting the 'calibration' constant assumed only defined by the original external divider ratio.
If the ratio of one side of the parallel circuit and the other are large enough the difference is small enough not to be a problem.
Say you put 10k and 2.2M in parallel the resulting resistor value is 9999.995 with a tolerance of 5% this difference is non existent.
What is required for your external mult-tapped voltage divider using manual switches to present the 'fixed' voltage taps for reading on the analog input switch, is proper sizing of all the resistors such that the source impedenace as seen by the analog input pin is always 10,000 ohms or lower.
All the voltage dividers I have seen only use a part of the 5V supply. And the division is rarely even.
What I wanted to do is this
+5V
| 4
R
| 3
R
| 2
R a_______ Analog Pin
| 1 |
R Rp
| |
GND GND
R is 10k Rp is 2.2M
button are connected between
a and the pins
1 to
4Now the voltage value can be easily calculated by the program processing the input. Just divide by the number of buttons add some hysteresis and voila. I could add 12 buttons without the need to calculate every single resistor.
I find this much preferable than all the other solutions out there to get buttons working on analog pins.
If you want to add a button just add a 10k resistor. When you have to do that with all the other ways to construct a voltage divider when you want to add a button you have to recalculate all resistors to get an even spread.
Now the question is what would be the minimum current needed on the analog pin to make it read 0.