0

I have a potentiometer of 10k and I connected it this way:

5v -> potentiometer -> analog input pin of Arduino

When I turn the potentiometer I change the resistance of the circuit but in the Arduino documentation they say that an analog pin in INPUT mode will have 1 megaohm resistance. So, for example, if I turn the potentiometer to the middle it will generate 5k of resistance + 1 megaohm of the analog pin it will result in a tiny, very tiny current. If I use U = R x I across the potentiometer it will be:

U = 5000 x 0.0000001

U ~ 0 across the potentiometer. So U will be 5 V at the analog input because there was no drop of voltage in the circuit. If turn the potentiometer all way up to 10k resistance the voltage in the analog input will also be 5 V because the voltage drop across the potentiometer is still really small.

I know that an analog pin in INPUT mode will read 0 V as 0 and 5 V as 1023. But as I showed you it should always read 5 V even when I turn the potentiometer all way up because the voltage is not being changed. I know I am wrong cause when I log the input pin it shows different values as I turn the potentiometer. So how does this work?

per1234
  • 4,088
  • 2
  • 22
  • 42
Samul
  • 215
  • 2
  • 9
  • Potentiometers have 3 pins. One for 5v, one for ground, and one that outputs the voltage in between (depending on the orientation of the knob). – Gerben Nov 23 '14 at 19:48

1 Answers1

1

The potentiometer and the internal resistance form a voltage divider. The voltage created by this voltage divider is essentially indistinguishable from 5V regardless of what the pot is set to because the internal resistance is so high.

What you want to do is to create an external voltage divider that will cause the voltage to vary full scale between 5V and 0V. You do so by connecting one end of the pot to 5V and the other end to 0V, and drawing the voltage from the wiper.

Ignacio Vazquez-Abrams
  • 17,663
  • 1
  • 27
  • 32
  • Hi Ignacio! Thank you for helping me but I still didnt understad how a 10M ohm resistor inside the input pin helps it to read the voltage. What am I missing? – Samul Nov 22 '14 at 22:39
  • It doesn't. The ADC reads the voltage. The 10Mohm resistance means that the ADC will draw very little current when taking a measurement, but that a comparable external resistance will distort the results. – Ignacio Vazquez-Abrams Nov 22 '14 at 22:42
  • This is incorrect. A potentiometer is by defintion a three terminal device. It forms its own voltage divider. The input impedance of the ADC, if substantially higher, has minimal loading effect. Your answer would be correct if the poster had a simple two terminal variable resistor rather than a potentiometer. – Chris Stratton Nov 23 '14 at 03:18
  • @ChrisStratton: The asker never describes connecting the second terminal, only the first and the wiper. – Ignacio Vazquez-Abrams Nov 23 '14 at 03:25
  • If that were the case, then the question would be erroneous and as they would not be using a poteniometer. Their results suggest that either they have wired a potentiometer, or the input impedance is lower than imagined. – Chris Stratton Nov 23 '14 at 03:33
  • Or that they completely botched the circuit analysis. – Ignacio Vazquez-Abrams Nov 23 '14 at 03:49
  • I am using the 5v wire and the middle wire of my pot. I must be very dumb cause I still dont understand how an analog pin works. Please take a look at this formula (wikipedia) http://upload.wikimedia.org/math/4/4/b/44b8b16db945a778e558f2c5ffd70157.png . If Z2 is 10M ohm and Z1 a small resistor then Vout will be always the same value as Vin, it will never be 2, 3... it will always be the same as Vin independentrly of what my potentiometer effective resistance. – Samul Nov 23 '14 at 14:24