# What is the relationship between potenziometer resistence and pin input current?

I’m a newbie, sorry for the very basic question. I’m doing a simple circuit wtih Arduino Uno (and Micro) where I need to make an analogRead from a potentiometer. Reading the datasheet (and other sources) the suggested potentiometer should be 10kΩ. Being curious I wanted to understand the reason for that value, and I’ve read many explanations: 1) a higher resistence becomes a high impedence seen from the input, making it more sensible to interferences / current fluctuations; 2) a higher resistence would reduce too much the input current, making the ADC work worse (because of the S/H cap charging, etc.).

Both the exaplantions assume a clear understanding of the relationship between the pot resistence and the input, which it doesn’t look to me a simple voltage divider situation.

Here below I depitcs three states of the pot (full open, half, full closed) as if it was one or two resistences

How the the pot resistence influences the input pin in these three cases? I consider them as distinct cased since the position of the pot resistence (in relation to the pin) changes when the wiper moves, isn’t it?

Explanation 2 assumes that current leaking into the pin passes through the potentiometer resistence. If it’s higher less current is drawn. But, for example, in the top case I thought that a higher resistence would let more current flow into the pin rather then to ground…

I suppose someting is wrong in my understanding of current paths The higher the resistance the lower the current.

The input resistance of an Arduino analog input > 100 mega ohms.

A 10k potentiometer is a good trade off for input stability readings.

A 100nF ceramic capacitor from the analog input pin to GND can help reduce noise too.

An Arduino input does not draw a significant amount of current (the input impedance is somewhere around 100 MOhms), but the analog to digital converter has a small capacitor that must be charged quickly in order to make fast measurements.

In order to charge the capacitor quickly enough, the source resistance should be less than 10K Ohms. If the source resistance is higher than that, add an additional capacitor (e.g. 10 nF) from the input to ground. That also lowers the rate that you can collect analog data.

You should remove the “Ri” from your circuit, and ALWAYS connect the grounds.

Thanks for your answers. Probably my question is so basic that it’s difficult for you to understand my doubt I know that the potentiometer uses the voltage divider principle to control its output voltage. My problem is understanding how voltage and current divide in relation to the input pin when 1) the pot outputs 5V and the resistence is “after” the pin toward ground 2) when the pot outputs 0V and its resistence is “before” the pin toward ground.

@jremington you say what I read in other places, the resistence affects the charge of the cap. My doubt is how the pot resistence relates to the current which charges that cap.

Probably I should have posed the question without throwing in the pot. The following schema is enough to tell my doubt when the pot is acting as a simple resistence. If the input pin could be simulated with EasyCircuit I would run it’s animation to see the paths of current and the graphs of voltages You can simulate the input pin with a 15 pF capacitor and 100 Megohm resistor in parallel: 1 Like

Hi,
Please when drawing circuits include grounds, they are important to measuring input signals. Tom…    Just think of the analog input as if it was a DMM.

A DVM has ‘basically’ an infinite resistance that draws ‘no’ current from that which is being measured.

The output resistance of a potentiometer will be the resistance above the wiper in parallel with the resistance below it. For the 3 example you posted in the first post, they will be 0, 25, and 0 ohms (not counting the 1 megohm resistor).

The maximum output resistance will be 1/4 the full resistance, when the wiper is set at the half point.

Have a look at the datasheet of the microcontroller on the Arduino Uno. It has a very good description of the A/D converters analog input circuit with the associated values and how it is connected.

You can find the datasheet link in the Ardunio store under Overview.

https://store.arduino.cc/arduino-uno-rev3

The time it takes to charge a capacitor depends on two values, the capacitor and the resistance. If you multiply the capacitor value in Farads by the resistance in ohms you get a number that is a time.* This is known as the time constant.
It is the time it takes to charge the capacitor to about 70% of the charging voltage. This voltage rise across the capacitor is not liner in time, it is in fact exponential.

A capacitor would take an infinite time to rise up to the charging voltage, that is it will never actually get there. But after four time constants it is as good as there.

The resistor is the amount of track on the pot from the positive end. If this is too high it will take too long to charge the input capacitor before the analogue to digital converter starts to measure the voltage on the input capacitor. This input capacitor is known as a “sample and hold” capacitor and once the conversion begins it is disconnected from the input pin so that the voltage to be measured is kept constant during the measurement process.

The current charging the capacitor can be found by ohms law current = voltage across the resistor / the resistor value. So this current is at its maximum when starting to charge an uncharged capacitor and it decreases as the voltage across the capacitor increases. As I said by four time constants it has dropped almost to zero.

• it is interesting that these two seemingly different quantities produce a time when multiplied together. However if you do a simple analysis by units of these two quantities everything cancels out except one unit of time.

@Grumpy_Mike thanks, my doubt is that the amount of resistence in series with the capacitor will changes when the wiper moves from Vcc to ground, isn’t it? When the wiper is at Vcc the resistence will be (ideally) zero, and when it’s at ground it will be 100k (for a 100k pot).

So the current charging the cap depends on the position of the wiper, and it changes when I rotate the pot, am I wrong?

Quite correct.

Again correct. You are altering the resistor that is charging the capacitor, therefore you are altering the time constant of the RC circuit.
So suppose you are using a 1M pot, then it will take a lot longer to charge the capacitor than it would when the wiper was at the other end. That would incidentally discharge the capacitor to the ground, its a two way street.

If you want something to worry about note that theoretically when you start charging a capacitor the current is potentially infinite if the pot is up at the Vcc end.
In practice this never happens.

But what is interesting is why you are worrying about this charging current? It only happens for a tiny fraction of a second, as I said for four time constants or so. After that the steady state current is so very very small it is not worth bothering about.

Not normally true. DMM’s usually have 10M ohms input resistance, and will show
incorrect values when monitoring very high impedance circuitry. For instance you’d
get 10% error reading a 1M circuit, or 0.1% error reading a 10k circuit.

An ADC such as on the Arduino has > 10 gigaohms input resistance typically - this
really is effectively zero current for practical purposes, as its down in the picoamp
range which most measuring equipment even can’t detect.

However if you change which analog pin used between successive readings there is
very little time to charge the internal capacitances - in this circumstance you want the
circuit being measured to have an impedance of 10k or less for accurate readings.
If you only ever read one analog pin this is not an issue at all.

OMG, really ?

ATMega328 ADC input current is approx 50nA.
I=5V/100Mohms=50nA

@Grumpy_Mike thanks for conforming my understanding.

What I wasn’t able to understand was the answers saying that the current to the capacitor was the point, but as you confirm what this current is depends on the pot position (its output resistence changes).

This current will differ between pots when the the wiper rotates toward ground, but when the wiper is at Vcc it doesn’t matter if the pot is 10k or 1M. I hope this conclusion is correct! Mine was mainly a theoretical question, not a practical one. For my purposes I’ve already seen that using a 10k or a 100k pot doesn’t make any noticeable difference.

That is only true for the pin and not the ADC. When the ADC is not sampling e.g., converting or connected to another input, the pin has an input resistance of 100MOhm. When the ADC is sampling it closes a switch to the sampling circuit and the input resistance is 1 to 100kOhm (see figure 23-8 on page 212) of the datasheet.

Another way to look at this is the time constant of the RC circuit.

• @ 100MOhm and 14pF you get 0.0014s

• For 10-bit ADC you need around 7 times that to charge the capacitor enough (1LSB)

• 7 x 0.0014s = 0.0098s, this would give around 102Hz while the datasheet says 15ksps

• @ 100kOhm you get 102kHz which comfortably larger than 15ksps and would allow charging the sampling capacitor longer than 7 tau, decrease the error and have some tolerance across device deviation and temperature, voltage …

Yes that is correct.

Again correct but 100K is pushing things and you will notice some small differences depending on what you do. For example suppose you had a 100K at its mid point, so that gives a resistance of 50K. And another 100k pot turned right down, so that gives a nominal 0 ohm resistance.
Now read them very quickly repeatedly one after the other and you might see a difference if this is made by 10K pots rather than 100K ones. The reading might be a few points lower with the higher pot. This difference will increase when you use 1M pots.

Now read them very quickly repeatedly one after the other and you might see a difference if this is made by 10K pots rather than 100K ones. The reading might be a few points lower with the higher pot. This difference will increase when you use 1M pots.

Sure. That’s becose with a 10k the cap charging time is more in sync with the sampling clock, and the difference between wiper at half or ground is 5k, so still within the 10k reference resistence. With 100k the S/H is not working at its best and the higher difference between the two pots also exacerbates the inaccuracies when comparing the readings. If you say “correct” again I’m satisfied! Thanks very much @Grumpy_Mike (and all the others) for your time.