2

I have a 10kOhm linear Potentiometer. I connected it to analog 0, as in https://www.arduino.cc/en/Tutorial/Potentiometer.

The analogRead() gives a value between 0 and 1023, so I was expecting 0 if the potentiometer is at the lowest position, 1023 if it is at the highest position and 500 somewhere in the middle.

In fact I get ~40 at the lowest position, I get 1021 at the highest position (that's okay, I guess), and I also get 1021 at the middle. 500 is at a 1/4 position, I expected to have ~255 there.

I measured the resistance of the potentiometer. It reads ~200 Ohm at the lowest postion, 10kOhm (as expected) at the highest position and ~5kOhm in the middle, so, exactly as I expected.

So, what did I get wrong?

  • What arduino are you using? It sounds a bit like you are using a 3.3v arduino, but connected the pot to 5v. – Gerben May 26 '16 at 18:34
  • I am using an Arduino mega 2560. – Alex May 26 '16 at 19:53
  • I tried the 3.3V instead of the 5V, but I have the same effect. Good results in the lower 1/4 of the poti, no change as soon as I go higher up. – Alex May 26 '16 at 19:55
  • 2
    Take the multimeter and measure the voltages you see at the Arduino pin. – Posipiet May 27 '16 at 5:49
  • 1
    Note the comment by @Posipiet is a very important one - measure the voltage at the Arduino pin, with the potentiometer in circuit. Just to rule out the possibility of, say, a poor 5V or 0V connection or something similar. Also the 200 ohm value at lowest resistance is a bit suspect... – Andy May 27 '16 at 7:47
1

Unfortunately I cannot comment. I can't really think of a reason why your readings are the way they are. Though you did not present to us an image of what potentiometer you are using and how you are really wring it up.

It is possible that your potentiometer is a center tapped type with 4 pins. You could have possibly connected the positive rail to the center tap pin, ground to the side pin and the wiper pin to the Arduino pin so that you would have the result you are getting.

Or potentially, you wired it correctly except for the fact the positive rail you connected to was 10V, but that is really dangerous.

Have you tried measuring the resistance of the potentiometer from one side pin to the other side pin?

  • Well, not sure what was going on, but rotating the cables helped. So probably something was connected wrongly. – Alex May 28 '16 at 16:07
  • Do you mean as in swapping the cables? – Bradman175 May 28 '16 at 16:08
  • Yes, but, looking more closely, it did not help. – Alex May 28 '16 at 16:14
  • @Alex measure the voltage of the wiper at different positions. Also make sure you are not using any other components in the circuit (except for Arduino and power supply). An image would help us greatly. – Bradman175 May 28 '16 at 16:16
  • @Alex basically follow the suggestions in the comments under your question. They will lead you to solving your problem. – Bradman175 May 28 '16 at 16:24
0

It sounds like you have a log taper potentiometer rather than a linear taper potentiometer. These are used in audio applications.

You can tell the difference by looking at the resistance code. It may be written as:

103 B

or

10K B

both of which are 10KΩ LOG taper. The letter A or B as a suffix is the taper type. A is linear, and B is logarithmic. That's the "normal" standard, though, but Japan does it differently. They use A for Audio taper (log taper) and B for linear.

  • 2
    That was my thought too, but the OP claims that he measured it to be 5K in the middle. – JayEye May 27 '16 at 3:33
  • 500 (50%) at a quarter turn says logarithmic to me. – Majenko May 27 '16 at 7:51
  • oh, at quarter-turn. Yes, of course. I should have reread that part before referring to it :) – JayEye May 28 '16 at 3:45
  • The interesting thing is: I did measure 5kOhm in the middle, which says linear. But I also read 500 at a quarter position, which says log. So, WTF! – Alex May 28 '16 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.