Potentiometer problems

Hi, I'm trying to wire up a 10k pot to my arduino uno and nothing seems to make it work. I'm using the example code provided for standard pots. The values that the serial monitor display is either 0, 1023 or random fluctuating values. The pot is a 10k volume control pot with 6 pins. I am only trying to use the 3 furthest away from the shaft. I also tried using another 3 pin pot that I got from taking apart a board and that also doesn't work, with the same problem. However, the second pot sometimes works, but only within a certain angle range, it shows consistently changing values between 200 and 700 somewhere in between half of the pot turning. Thanks for any help and happy holidays guys!

Well it's unlikely that 3 pots are all broken in the same way. Can you draw a schematic of your circuit?

Yes sounds like a miswiring problem.
You should have 5V on one outer leg, Gnd on the other, be able to measure a changing voltage on the middle leg/wiper pin of the pot. Get that figured out before you do any more Arduino reading.

I followed the wiring diagram provided here:

This is the potentiometer I'm using:
Potentiometer

This is how it's wired(Sorry, but the picture wasn't showing up correctly here):
Imgur

This is the code I'm using:

// These constants won't change.  They're used to give names
// to the pins used:
const int analogInPin = A0;  // Analog input pin that the potentiometer is attached to

int sensorValue = 0;        // value read from the pot

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
}

void loop() {
  // read the analog in value:
  sensorValue = analogRead(analogInPin);
  // print the results to the serial monitor:
  Serial.print("sensor = ");
  Serial.print(sensorValue);

  delay(500);
}
/code]

const int analogInPin = A0;

The wiper is connected to A2 tho.

Hi, so my setup is actually wired like this:

Sorry for the confusion. The pin is actually set at A0. Also, the int analogPin = A0 IS set at const. I've also tried removing it and putting it back in. Doesn't seem to make a difference. So with this pot, I can turn it all the way to the left until there's a click, at that point, the readout does correctly show 0. However, any point past that is just straight up 1023, no matter what position the wiper is at, there's no range either, just 1023. Thanks again for the help, man, and happy holidays again!

I think the pins on the bottom are a switch. Try using the three terminals on the side of the pot instead.

Wow dude! You were right! The lower 3 pins, were in fact for the pot, and the back 3 was for the switch. I think the other pot I tested was faulty. I also kinda assumed that the wiring would be more standard to a 6pin stereo pot since it was labeled as a volume control. Kinda makes me feel like an idiot for not trying the bottom 3 pins at all. Anyways, thanks for the help again.

6 pin stereo pot often has 2 concentric shafts and 2 sets of solder terminals.
The click made it clear to me that there was a switch.

That makes more sense, especially since the back of the bag said it had a SPDT switch, but I wasn't aware that it was pinned separately. Thanks again for the help and happy holidays!

I also kinda assumed that the wiring would be more standard to a 6pin stereo pot since it was labeled as a volume control.

FYI - Volume controls are special non-linear pots (approximately logarithmic) to match human hearing. So the mid-point the resistance is about 10% (or 90%, depending on which way it's wired). In audio applications, you get about 10% of the signal at the half-way point, but it sounds more-like half-volume to our ears.

Well then, show us a perfectly focussed and fully illuminated (outside daylight) photograph of your assembly.

Otherwise we - as with the first fellow - have no idea whatsoever what you are doing.