How to wire Slide Potentiometer

Heythere,
i trying to build a 8 step Midi sequencer. I want to use slide Potentiometers to determine out the pitch of each step.
I'm having Problems wiring the slide Potentiometers...
i googled and found some pictures for the wiring but still am not getting it to work.

Here is the way i hooked it up...and i could swear it worked this way....

Imgur

I have the 5V connected to the two Leg part.
The GND on the opposite side of 5V on the Four leg Part.
And i get the analog signal right next to the GND and go to A1.

I tried all combinations that i could imagine but am not getting values from 0-108.....it just jumps around 20- 50, or gives me 0 and jumps to like 5 here and there, it only changes when i move the potentiometer...
I'm going nuts here would really appreciate some help :slight_smile:

Heres my code (real simpel just the read out the values):

unsigned long previousMillis=0;
unsigned long interval=100;
int oldValue = 0; 
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A1);

  // print out the value you read:
  if ((unsigned long)(millis() - previousMillis) >= interval) {
    previousMillis = millis();
    Serial.println(sensorValue/8);
  }
  delay(1);        // delay in between reads for stability


}

Each slide pot will have 3 terminals like a regular pot. These might be stereo pots containing two separate pots in one slider. Typically, the 3 terminal types have the full resistance across lengthwise from each other, and the third adjustable terminal often offset a bit up and to one side. So, assuming these are stereo, and assuming none of these 6 terminals go to the case (shield), then on the side marked A, there will be one end terminal for each pot in the housing. The other terminal for the particular pot, will be in line with it at the other end, and the first terminal next to it will be the adjustable terminal. Do you have a manufacturer and part number for the pot? The datasheet for the part will show what terminal goes where. I agree if I understand your wiring description that it should work, so long as the grounds on the 4 pin side only go to the pins directly across from the ones on the other side, AND, only one of the two extra pins goes to A1.

1023/8 =127.75. (sensorValue/8). Because the variable is defined as an int, you will see 127.
12/8 = 1.5...you will see 1...etc.
You still should see a fairly smooth transition from~0 - ~127.
BUT, if these are audio pots, they will favor a faster change in resistance at one end, so it won't be linear response with the handle/slider. They call it an audio taper and it is logarithmic in nature. There are different rates of taper available.

You also need to know what the value of the overall pot is? 1K or higher should be fine, but if they are 500 ohm or less, then you might be asking a lot of your power supply. If you don't have an ohmmeter, or volt meter, or do and don't understand it, it can be hard to figure out.

Connect in only ONE pot and remove the 5V from all the others until you have one working, then wire in one at a time.

Hope this Helps,
-fab

|...........................................|
^..............|
|...........................................|
^.................|

This is how I "think" they are wired.

Looks better in the editor...

-fab

Silly question but , did you ever measure the resistance at the wiper to the leads connected to GND ?

This is an incredibly simple thing to troubleshoot. If you measured the resistance on the wiper and it was
changing when you moved the slide, the ONLY explanation for what you are seeing is the pots leads are not connecting to the breadboard contacts. You need to do a continuity test from the contacts in the breadboard from one end to the destination end by connecting your meter using jumpers plugged into the exact same row of pins the pot is plugged into and checking the other end where it is supposed to be connected.

So.
I have 10kohm Alps Slider potentiometers.
I found the Pin layout thing.
here:

So i have it hooked up the right way.
I tried it again and the only thing i get out is 127....
i can't change the Value at all as if there is no resistance.

Thanks for the help :slight_smile:

Did you remove the pot from the breadboard and measure the resistance with a meter ?

NOTE: The circuit in the link you posted is using RED for GND and BLUE for +5V which is BACKWARDS from the intention of the manufacturer. (red should be +5V and Blue should be GND). You can wire it any way you want but everyone looking at the photo will expect the BLUE to GND and the RED to be +5V.

Also, FYI, there are two GND pins and two OUTPUT pins at the end with 4 pins.

You need to measure the resistance of the pot . What you are telling us makes no sense.

Why are dividing the sensor value by 8 ? that makes no sense . (1023/8 = 127)

1023/8 =127.75. (sensorValue/8). Because the variable is defined as an int, you will see 127.
12/8 = 1.5...you will see 1...etc.
You still should see a fairly smooth transition from~0 - ~127.

 Serial.println(sensorValue/8);

You will NEVER get a reading of 1023 if you are dividing the sensorvalue by 8 ! (what's the reason for that ?)

Don't have a meter...
Could get one and check it on Tuesday

READ REPLY#5 AGAIN. I JUST EDITED IT.

Do you see a smooth transition from 0 to 127 as mentioned ?

The datasheet for the exact part you have will have the pin-out, otherwise get out
the multimeter and check. Simple.

No im not getting smooth values from 0-127.
It only gives out 127,127,127

We are waiting for you to get a DMM and measure the resistance on the pot terminals IN CIRCUIT FIRST and then remove one and measure the resistance DIRECTLY ON THE TERMINALS.

Get a piece of paper and draw your test setup showing a pot and ALL the terminals. Show WHERE you are
connecting the DMM (on resistance scale). Show the range you get measuring the resistance IN THE BREADBOARD FIRST, then REMOVE the pot from the breadboard and measure it by itself. Post your results
along with the photo of your drawing. That's where we're at. We cannot proceed until that is done.

Hey guys, hi,

i'm using slide pots to create an midi controller and i have wire the terminals in another way. This is how they worked for me:

https://scontent.fgru3-2.fna.fbcdn.net/v/t1.0-0/p280x280/18813725_10212700421576313_1711620454132060506_n.jpg?oh=b6b8250ae0065228028f20c0d105da54&oe=59B10E8A

=)

Oh, that explains everything...

??

But I suspect the OP has wired the pots incorrectly.

A circuit diagram would be helpful, plus the code you're using

Allan

Just to make sure anybody viewing this thread will be immediately helped, here's the picture:

Thanks Victor, for taking the time to create this.
[/sarcasm]

Last time I checked a slide pot has 3 terminals not 4.

SLIDE POT.JpgHow to wire a slide pot

I only see 3 terminals there. Posted photo has GND on the right instead of input and also has two terminals labeled “3” and two labeled “3”.

What’s that all about ?

There is no indication of what any of the terminals is connected to. (GND is obvious though)

How is that supposed to explain anything ?

Might have a 4th or even more to ground the metal case as a shield and provide a solid mounting.......

cheapo ones I've seen only have a thin paxolin base. Not very strong.
Allan