Go Down

Topic: Multiple potentiometers (Read 1 time) previous topic - next topic

multivir

Hi,

I'm building a midi controller with a bunch of switches and potentiometers.
The switches are working fine. I installed one potentiometer and  - after quite a bit of debugging - got that to work too.

The never resting geek in me told me to install a second potentiometer. That causes problems, cause now I'm getting crosstalk between the two analog inputs. When I change value A, I will get (more or less) the same value on B.

The potentiometer is not installed on my arduino board. I use an external expression pedal with a 20k pot that is connected to my arduino via jack inputs. (Like a wah wah pedal wit a stereo jack - I have to connectors on my controller and was just using one pedal so far, unplugging it and connecting to the second connector when I wanted to try the second analog port)

Here's the code snippet I'm using to debug

Code: [Select]

void expPedalA(){
  int sensorAValue = analogRead(A0);
Serial.print("A: ");
Serial.println(sensorAValue);
}

void expPedalB(){
  int sensorBValue = analogRead(A6); 
   Serial.print("B: ");
Serial.println(sensorBValue);
}


When I check the output, I can see that both A & B change their values, although I only have one expression pedal connected. The other jack input is not connected to anything.

I checked all the connections and I think that's not the problem:
Pot CW goes to Arduino ground
Pot CCW goes to Arduino A6
Pot SL goes to Arduino 5.5 volts

I suspect that the problem the 20k Ohm that the expression pedal / pot is providing. But I can't just replace the pot in the expression pedal.

- Am I getting crosstalk because the potentiometer is too strong?
- If that's the case: Is there a way to resolve that without having to replace the potentiometer in my expression pedal?

Thanks for your help,

M.

AWOL

Try two analogue reads, discarding the first.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

multivir

I added the following lines before the analogRead. Didn't make a difference.

Code: [Select]
  int sensorATrash = analogRead(A0);

Code: [Select]
  int sensorBTrash = analogRead(A6);

multivir

So, if ignoring the first read doesn't help - is there a way to resolve this or is it just impossible to use an expression pedal with such a strong potentiometer?

AWOL

Quote
Pot SL goes to Arduino 5.5 volts

It goes where?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

multivir


MarkT

No, that's not the issue.  SL = slider right?  ie the wiper of the potentiometer?  That should be going to the analog input, and each end of the track should be 0V and 5V.  If you connect the supply between one end and the wiper then when you slide the pot to that end it will burnt out.
[ I won't respond to messages, use the forum please ]

multivir

I changed the wiring accordingly - I thought I had it right in the first place as it worked fine with just one analog in - but it didn't make a difference. I still get "crosstalk". The weird thing is that the range changes. I map the potentiometer values from 0 to 127 and it works perfectly the way I had it before. With the "corrected" wiring I only get values between 1- about 100. The crosstalk happens no matter how I wire it.

Is there an official maximum value for the correct usage of the Arduino analog port?

Grumpy_Mike

Quote
Is there an official maximum value for the correct usage of the Arduino analog port?

According to the processor's data sheet it says 10K is the optimin value. So 20K should be no problem.
Are you quite sure of the value? Can you measure it with a meter.
MarkT told you the right way to wire it so you might think you have wired it like this but you have not.

Are you sure there are three wires out of your pedal.

dc42


I have to connectors on my controller and was just using one pedal so far, unplugging it and connecting to the second connector when I wanted to try the second analog port


So you have one analog input connected to a pedal, and the second one not connected to anything. Under these conditions, the input that is not connected will typically give you a reading close to the reading from the last pin you read that was connected. It will work fine when you connect the second pedal.

You might want to connect a 100K resistor from each input to ground. This will affect the linearity of the pedal readings slightly, but it will also ensure that you get a reading close to zero on an input with no pedal connected. If you also connect a 10nF or 100nF capacitor from each input to ground then the readings you get will be more stable.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up