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

It sounds like one of your question is: how to make a design decision as to the resistance value the Pot.

There is not "best" design, all choices have tradeoffs. I'll list the ones I can think of with a little description: (in no particular order)

  1. Lower resistance pots draw more current & power from your source. In general good designs do not consume any more power than needed.

  2. You have a particular part on hand. A perfectly valid design decision for a hobby circuit. That is as long as it doesn't severely violate any other design goal.

  3. High resistance is more likely to pickup noise, conversely low resistances are less likely to pick up noise. Probably not an important item for most circuits as a capacitor can remove most noise.

  4. Should be low comparted to the input of the next stage. In your case the next stage is the Arduino analog input, which is pretty high.

I'm sure there are likely some more but this is all I can think of at the moment.

Now the issue is to know how much value to put on each design decision. I'll tell you what I would do.

  1. Assuming you are not sampling audio and expecting to have very low sampling delay.

  2. I know the input to the Arduino analog is very high, so for practical purposes it is infinite (i.e. of no concern) So I would pick a pot between 5k and 50k. This would consume between 5milli Watts and 0.5 mW (pretty low).

  3. My series resistor would be about 10K. I think your 1meg ohm is too high with little benefit from being that high. The 10K would allow you to put 12 volts out of your pot circuit and not damage the Arduino. I.e. is accidently miss wired.

  4. I would put a 0.01µF capacitor right at the input of the Arduino analog pin, with the ground end of the capacitor connected very close to the Arduino (important if filtering noise)
    This capacitor will cause a slight delay and you should add a delay between enabling the input and the Analog conversion. Should be about 10K (series resistor) + 5k (what the pot looks like to the Arduino) times 0.01µF * 5 (5 times this calculation is the time needed to reach 99+% of the pot voltage.

A time constant is: τ (tau) = R * C = (5k + 10k) * 0.01µf
5 τ is the time it takes for the voltage on the capacitor to reach 99+% of the input value.

Hope this helps :slight_smile:

Thanks @JohnRob. I've never read any suggestion to add a 0.01µF capcitor in front of the input. Why is this delay needed? Doesn't it interphere with the S(H capacitor that already exists inside the ADC circuit?

When you do this:

  analogRead (A0) ;
  int val = analogRead (A1) ;

during the second call to analogRead the analog multiplexer is selected to A1 from A0, and then the ADC is triggered. In the Uno and similar Arduinos this means there is some thing like a couple of microseconds only between the multiplexer switching to A1 and the ADC sample-and-hold capacitor being sampled by the ADC for the first time. If the source impedance is 10k, the internal capacitor (which is 14pF) then there is a time-constant of
0.14µs for the S/H capacitor. To charge to an accuracy of 10 bits thus takes a microsecond or so.
This is why if the source impedance is significantly higher than 10k and you switch
betwen different analog inputs, you will get spurious readings from the ADC (which typically
appear as cross-talk between analog pins).

Having the source bolstered by 10nF is enough to charge the S/H cap to 10 bit accuracy
rapidly in this circumstance.

@MarkT so putting that cap in front of the input is like saying "hey, pot, wait a little bit to let the multiplexer complete the switch". Right?

No, it has much lower impedance that a 10k resistor in the timescale involved. Things happen faster, there's no waiting involved.

Ohh, I misunderstood the meaning of "the source bolstered by 10nF ". Please let me undestand it: does it mean that the effect of this tiny cap is to provide an extra amount of current (until it's not charged) that will help the charging of the S/H cap?

Please forgive the really basic questions. I'm a beginner and this thread is a great lesson for me .

@Klaus,
This is very useful, if not essential information
for all arduino users . One could make a good
case for the above being a 'Sticky' with the
title "Analog Input 101".

!You omitted the factor of 2π. the time constant for a capacitor is equal to 2πRC.

What isn't shown in the applications is the fact that electrical noise is picked up on any wire to some extent.

The input A/D is kind of like a flash photo, it captures a relative instant of the input voltage. If there is electrical noise on the input, it will measure the pot voltage + or- the noise at the conversion time.
A 0.01µF capacitor at the input of the arduino averages out much of the noise making a more accurate and stable measurement.

BTW it is a common suggestion in any book or article or this forum. Different folks might suggest different values but the concept is the same.

If you have the project (or just a test circuit) built you can easily see how the Analog voltage conversion is much more stable with the capacitor than without.

I believe you have the two forms of the equation mixed up.

image

You are correct, I did get it mixed up with the impedance. :roll_eyes:

1 Like

I just want to present the correct formulas so that the beginners are not
lead astray. RC time constant is calculated by multiplying R, resistance
in ohms, by C, capacitance in farads. The result is time in seconds. (2pi
is not a factor here.)
The formula 1/(2
pifC) is for capacitive reactance in ohms.
(But those are reactive ohms that do not dissipate power.)

@JohnRob the general suggestion to use shunt capacitors is well known.

My question was about the effect on the charging of the S/H cap. I have interpreted what @MarkT was saying before as the (transitory or high freq) effect of reducing the input impedence enough to give a bit more current that can help the charging. But I doubt my interpretation is correct...

But I doubt my interpretation is correct…

Your interpretation is correct. However from a practical point of view:

  • 1meg ohm and 15 p takes 75µseconds to charge.
  • 1 meg and 0.01µF the charge time is 50 mseconds.

so unless you are trying to capture some transient event it doesn't matter.

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.