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....
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
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.
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 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.
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 ?)
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.