Cross-Talk Analog Inputs, Mega 2560

Hello,

I built a Midi Controller with 10Faders, those are 10k linear from Alps (so the quality is good.)
However, after some usage, there is extreme crosstalk between the first 4 faders (they are on A0, A1, A2, A3). If I push up fader 1, the second goes on 40% (Mapped the analog read value), fader 2 on 20%. Same with the others. In the whole project, there are only low-frequent analog signals.

I built a voltage divider with the faders, so one end is connected to 5V, the other to ground and the signal is picked up in the center.

I've read that high impedance inputs can be a problem, are 10k already too much? I did not find other faders (with an acceptebale price), that have lower resistance and work with 5V.

The Arduino has a custom firmware, so that it can send MIDI via USB (GitHub - kuwatay/mocolufa: mocoLUFA (MIDI firmware for Arduino Uno)).

Somehow I have the feeling, that it is a hardware Problem, because it does not happen all the time. I measured the connections on the PCB between Faders and the back on the Arduino, there is nothing special ( ~ 0.1 Ohm)

So, what can i try or do?
Thank you in advance, I'm at a point where I really don't know what to do.



Code?

Try reading twice & discarding the first.

2 Likes

If you got a spare A:D input. Tie the spare A:D to ground, read the grounded A:D first to clear the sample and hold circuit then read the desired A:D input.

Also the read once discard, and read again works pretty well.

3 Likes

Thanks, I'll try the method with 2 readings.
Heres spimlified code for one fader: (the whole code is pretty long and all the same with just different inputs)


/////SETUP

//BUTTONS (with soldered pullups)
pinMode (aB4, INPUT);
pinMode (aB3, INPUT);
pinMode (aB2, INPUT);
pinMode (aB1, INPUT);


//FADER
pinMode (aF, INPUT);




///////LOOP


//Bahn a
aB4val = digitalRead(aB4);
aB3val = digitalRead(aB3);
aB2val = digitalRead(aB2);
aB1val = digitalRead(aB1);

aFval =analogRead(aF);

//MIDI, BUTTON
if(aB4valAlt == 0 && aB4val == 1){//Note ON
midi(144, 0, 127);
aB4valAlt = aB4val;
}else if(aB4valAlt == 1 && aB4val == 0){ //Note OFF
midi(128, 0, 0);
aB4valAlt = aB4val;
}

////FADER
if(aFvalAlt-2 > aFval || aFval > aFvalAlt+2){
aFvalMIDI = (int) map(aFval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,2,aFvalMIDI);
aFvalAlt = aFval;
}

//////copies for the other faders

Do I have to discard the first value explicit? Or just this way

val = analogRead(A0);
val = analogRead(A0);

For this project, there is a spare AD input, but I plan to expand it, then this one will be gone.

1 Like

Is this an UNO?

1 Like

Forgot to say it, it's a Mega 2560

analogRead(A0);
val = analogRead(A0);

would work.

2 Likes

I've tried, adding the second reading and discarded the first one.
Then I soldered A11 to ground and tested again, first reading A11, then the pin, I'm interested in.

Unfortunately it doesn't change anything.

What is this? This what? I cannot see your project, how the hack am I supposed to know what this is unless you state what is "THIS"!

Like what? If the software solutions did not work, then the issue is hardware. Could you post the current code in a message below so that we can review your software solution?

Post images of your project.

Post a schematic.

Please don't make this like we are pulling teeth.

1 Like

I've updated the first post too.

The adapted Code (with the second reading of A11, that is connected to GND)

int aPins[5] ={39, 23, A8, 4, 36};
int bPins[5] ={41, 25, A6, 5, 34};
int cPins[5] ={43, 27, A5, 7, 28};
int dPins[5] ={45, 29, A4, 8, 26};
int ePins[5] ={47, 31, A3, 9, 24};
int fPins[5] ={49, 33, A2, 10, 22};
int gPins[5] ={48, 35, A1, 11, 2};
int hPins[5] ={46, 37, A0, 12, 3};

//int gPins[5] ={47, 31, A3, 9, 24};
//int hPins[5] ={49, 33, A2, 10, 22};

//Bahn a
int aB4 = aPins[0];
int aB4val = 0;
int aB4valAlt = 0;
int aB3 = aPins[1];
int aB3val = 0;
int aB3valAlt = 0;
int aF = aPins[2];
int aFval = 0;
int aFvalAlt = 0;
int aFvalMIDI = 0;
int aB2 = aPins[3];
int aB2val = 0;
int aB2valAlt = 0;
int aB1 = aPins[4];
int aB1val = 0;
int aB1valAlt = 0;

//Bahn b
int bB4 = bPins[0];
int bB4val = 0;
int bB4valAlt = 0;
int bB3 = bPins[1];
int bB3val = 0;
int bB3valAlt = 0;
int bF = bPins[2];
int bFval = 0;
int bFvalAlt = 0;
int bFvalMIDI = 0;
int bB2 = bPins[3];
int bB2val = 0;
int bB2valAlt = 0;
int bB1 = bPins[4];
int bB1val = 0;
int bB1valAlt = 0;

//Bahn c
int cB4 = cPins[0];
int cB4val = 0;
int cB4valAlt = 0;
int cB3 = cPins[1];
int cB3val = 0;
int cB3valAlt = 0;
int cF = cPins[2];
int cFval = 0;
int cFvalAlt = 0;
int cFvalMIDI = 0;
int cB2 = cPins[3];
int cB2val = 0;
int cB2valAlt = 0;
int cB1 = cPins[4];
int cB1val = 0;
int cB1valAlt = 0;

//Bahn d
int dB4 = dPins[0];
int dB4val = 0;
int dB4valAlt = 0;
int dB3 = dPins[1];
int dB3val = 0;
int dB3valAlt = 0;
int dF = dPins[2];
int dFval = 0;
int dFvalAlt = 0;
int dFvalMIDI = 0;
int dB2 = dPins[3];
int dB2val = 0;
int dB2valAlt = 0;
int dB1 = dPins[4];
int dB1val = 0;
int dB1valAlt = 0;

//Bahn e
int eB4 = ePins[0];
int eB4val = 0;
int eB4valAlt = 0;
int eB3 = ePins[1];
int eB3val = 0;
int eB3valAlt = 0;
int eF = ePins[2];
int eFval = 0;
int eFvalAlt = 0;
int eFvalMIDI = 0;
int eB2 = ePins[3];
int eB2val = 0;
int eB2valAlt = 0;
int eB1 = ePins[4];
int eB1val = 0;
int eB1valAlt = 0;

//Bahn f
int fB4 = fPins[0];
int fB4val = 0;
int fB4valAlt = 0;
int fB3 = fPins[1];
int fB3val = 0;
int fB3valAlt = 0;
int fF = fPins[2];
int fFval = 0;
int fFvalAlt = 0;
int fFvalMIDI = 0;
int fB2 = fPins[3];
int fB2val = 0;
int fB2valAlt = 0;
int fB1 = fPins[4];
int fB1val = 0;
int fB1valAlt = 0;

//Bahn g
int gB4 = gPins[0];
int gB4val = 0;
int gB4valAlt = 0;
int gB3 = gPins[1];
int gB3val = 0;
int gB3valAlt = 0;
int gF = gPins[2];
int gFval = 0;
int gFvalAlt = 0;
int gFvalMIDI = 0;
int gB2 = gPins[3];
int gB2val = 0;
int gB2valAlt = 0;
int gB1 = gPins[4];
int gB1val = 0;
int gB1valAlt = 0;

//Bahn h
int hB4 = hPins[0];
int hB4val = 0;
int hB4valAlt = 0;
int hB3 = hPins[1];
int hB3val = 0;
int hB3valAlt = 0;
int hF = hPins[2];
int hFval = 0;
int hFvalAlt = 0;
int hFvalMIDI = 0;
int hB2 = hPins[3];
int hB2val = 0;
int hB2valAlt = 0;
int hB1 = hPins[4];
int hB1val = 0;
int hB1valAlt = 0;





//          große Knöpfe
int Pause = 6;
int PauseVal = 0;
int PauseValAlt = 0;
int GoMinus = 30;
int GoMinusVal = 0;
int GoMinusValAlt = 0;
int GoPlus = 32;
int GoPlusVal = 0;
int GoPlusValAlt = 0;

//große Fader
int gFL = A7;
int gFLval = 0;
int gFLvalAlt = 0;
int gFLvalMIDI = 0;
int gFR = A9;
int gFRval = 0;
int gFRvalAlt = 0;
int gFRvalMIDI = 0;

void setup()
{
//Bahn a
pinMode (aB4, INPUT);
pinMode (aB3, INPUT);
pinMode (aF, INPUT);
pinMode (aB2, INPUT);
pinMode (aB1, INPUT);

//Bahn b
pinMode (bB4, INPUT);
pinMode (bB3, INPUT);
pinMode (bF, INPUT);
pinMode (bB2, INPUT);
pinMode (bB1, INPUT);

//Bahn c
pinMode (cB4, INPUT);
pinMode (cB3, INPUT);
pinMode (cF, INPUT);
pinMode (cB2, INPUT);
pinMode (cB1, INPUT);

//Bahn d
pinMode (dB4, INPUT);
pinMode (dB3, INPUT);
pinMode (dF, INPUT);
pinMode (dB2, INPUT);
pinMode (dB1, INPUT);

//Bahn e
pinMode (eB4, INPUT);
pinMode (eB3, INPUT);
pinMode (eF, INPUT);
pinMode (eB2, INPUT);
pinMode (eB1, INPUT);

//Bahn f
pinMode (fB4, INPUT);
pinMode (fB3, INPUT);
pinMode (fF, INPUT);
pinMode (fB2, INPUT);
pinMode (fB1, INPUT);

//Bahn g
pinMode (gB4, INPUT);
pinMode (gB3, INPUT);
pinMode (gF, INPUT);
pinMode (gB2, INPUT);
pinMode (gB1, INPUT);

//Bahn h
pinMode (hB4, INPUT);
pinMode (hB3, INPUT);
pinMode (hF, INPUT);
pinMode (hB2, INPUT);
pinMode (hB1, INPUT);
Serial.begin(31250); // MIDi Bitrate
}

void loop(){


//Bahn a
aB4val = digitalRead(aB4);
aB3val = digitalRead(aB3);
analogRead(A11);
aFval =analogRead(aF);
aB2val = digitalRead(aB2);
aB1val = digitalRead(aB1);

//MIDI
if(aB4valAlt == 0 && aB4val == 1){//Note ON
midi(144, 0, 127);
aB4valAlt = aB4val;
}else if(aB4valAlt == 1 && aB4val == 0){ //Note OFF
midi(128, 0, 0);
aB4valAlt = aB4val;
}

if(aB3valAlt == 0 && aB3val == 1){//Note ON
midi(144, 1, 127);
aB3valAlt = aB3val;
}else if(aB3valAlt == 1 && aB3val == 0){ //Note OFF
midi(128, 1, 0);
aB3valAlt = aB3val;
}

if(aFvalAlt-2 > aFval || aFval > aFvalAlt+2){
aFvalMIDI = (int) map(aFval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,2,aFvalMIDI);
aFvalAlt = aFval;
}

if(aB2valAlt == 0 && aB2val == 1){//Note ON
midi(144,3, 127);
aB2valAlt = aB2val;
}else if(aB2valAlt == 1 && aB2val == 0){ //Note OFF
midi(128, 3, 0);
aB2valAlt = aB2val;
}

if(aB1valAlt == 0 && aB1val == 1){//Note ON
midi(144, 4, 127);
aB1valAlt = aB1val;
}else if(aB1valAlt == 1 && aB1val == 0){ //Note OFF
midi(128, 4, 0);
aB1valAlt = aB1val;
}

//Bahn b
bB4val = digitalRead(bB4);
bB3val = digitalRead(bB3);
analogRead(A11);
bFval =analogRead(bF);
bB2val = digitalRead(bB2);
bB1val = digitalRead(bB1);

//MIDI
if(bB4valAlt == 0 && bB4val == 1){//Note ON
midi(144, 5, 127);
bB4valAlt = bB4val;
}else if(bB4valAlt == 1 && bB4val == 0){ //Note OFF
midi(128, 5, 0);
bB4valAlt = bB4val;
}

if(bB3valAlt == 0 && bB3val == 1){//Note ON
midi(144, 6, 127);
bB3valAlt = bB3val;
}else if(bB3valAlt == 1 && bB3val == 0){ //Note OFF
midi(128, 6, 0);
bB3valAlt = bB3val;
}

if(bFvalAlt-2 > bFval || bFval > bFvalAlt+2){
bFvalMIDI = (int) map(bFval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,7,bFvalMIDI);
bFvalAlt = bFval;
}

if(bB2valAlt == 0 && bB2val == 1){//Note ON
midi(144,8, 127);
bB2valAlt = bB2val;
}else if(bB2valAlt == 1 && bB2val == 0){ //Note OFF
midi(128, 8, 0);
bB2valAlt = bB2val;
}

if(bB1valAlt == 0 && bB1val == 1){//Note ON
midi(144, 9, 127);
bB1valAlt = bB1val;
}else if(bB1valAlt == 1 && bB1val == 0){ //Note OFF
midi(128, 9, 0);
bB1valAlt = bB1val;
}

//Bahn c
cB4val = digitalRead(cB4);
cB3val = digitalRead(cB3);
analogRead(A11);
cFval =analogRead(cF);
cB2val = digitalRead(cB2);
cB1val = digitalRead(cB1);

//MIDI
if(cB4valAlt == 0 && cB4val == 1){//Note ON
midi(144, 10, 127);
cB4valAlt = cB4val;
}else if(cB4valAlt == 1 && cB4val == 0){ //Note OFF
midi(128, 10, 0);
cB4valAlt = cB4val;
}

if(cB3valAlt == 0 && cB3val == 1){//Note ON
midi(144, 11, 127);
cB3valAlt = cB3val;
}else if(cB3valAlt == 1 && cB3val == 0){ //Note OFF
midi(128, 11, 0);
cB3valAlt = cB3val;
}

if(cFvalAlt-2 > cFval || cFval > cFvalAlt+2){
cFvalMIDI = (int) map(cFval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,12,cFvalMIDI);
cFvalAlt = cFval;
}

if(cB2valAlt == 0 && cB2val == 1){//Note ON
midi(144,13, 127);
cB2valAlt = cB2val;
}else if(cB2valAlt == 1 && cB2val == 0){ //Note OFF
midi(128, 13, 0);
cB2valAlt = cB2val;
}

if(cB1valAlt == 0 && cB1val == 1){//Note ON
midi(144, 14, 127);
cB1valAlt = cB1val;
}else if(cB1valAlt == 1 && cB1val == 0){ //Note OFF
midi(128, 14, 0);
cB1valAlt = cB1val;
}

//Bahn d
dB4val = digitalRead(dB4);
dB3val = digitalRead(dB3);
analogRead(A11);
dFval =analogRead(dF);
dB2val = digitalRead(dB2);
dB1val = digitalRead(dB1);

//MIDI
if(dB4valAlt == 0 && dB4val == 1){//Note ON
midi(144, 15, 127);
dB4valAlt = dB4val;
}else if(dB4valAlt == 1 && dB4val == 0){ //Note OFF
midi(128, 15, 0);
dB4valAlt = dB4val;
}

if(dB3valAlt == 0 && dB3val == 1){//Note ON
midi(144, 16, 127);
dB3valAlt = dB3val;
}else if(dB3valAlt == 1 && dB3val == 0){ //Note OFF
midi(128, 16, 0);
dB3valAlt = dB3val;
}

if(dFvalAlt-2 > dFval || dFval > dFvalAlt+2){
dFvalMIDI = (int) map(dFval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,17,dFvalMIDI);
dFvalAlt = dFval;
}

if(dB2valAlt == 0 && dB2val == 1){//Note ON
midi(144,18, 127);
dB2valAlt = dB2val;
}else if(dB2valAlt == 1 && dB2val == 0){ //Note OFF
midi(128, 18, 0);
dB2valAlt = dB2val;
}

if(dB1valAlt == 0 && dB1val == 1){//Note ON
midi(144, 19, 127);
dB1valAlt = dB1val;
}else if(dB1valAlt == 1 && dB1val == 0){ //Note OFF
midi(128, 19, 0);
dB1valAlt = dB1val;
}

//Bahn e
eB4val = digitalRead(eB4);
eB3val = digitalRead(eB3);
analogRead(A11);
eFval =analogRead(eF);
eB2val = digitalRead(eB2);
eB1val = digitalRead(eB1);

//MIDI
if(eB4valAlt == 0 && eB4val == 1){//Note ON
midi(144, 20, 127);
eB4valAlt = eB4val;
}else if(eB4valAlt == 1 && eB4val == 0){ //Note OFF
midi(128, 20, 0);
eB4valAlt = eB4val;
}

if(eB3valAlt == 0 && eB3val == 1){//Note ON
midi(144, 21, 127);
eB3valAlt = eB3val;
}else if(eB3valAlt == 1 && eB3val == 0){ //Note OFF
midi(128, 21, 0);
eB3valAlt = eB3val;
}

if(eFvalAlt-2 > eFval || eFval > eFvalAlt+2){
eFvalMIDI = (int) map(eFval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,22,eFvalMIDI);
eFvalAlt = eFval;
}

if(eB2valAlt == 0 && eB2val == 1){//Note ON
midi(144,23, 127);
eB2valAlt = eB2val;
}else if(eB2valAlt == 1 && eB2val == 0){ //Note OFF
midi(128, 23, 0);
eB2valAlt = eB2val;
}

if(eB1valAlt == 0 && eB1val == 1){//Note ON
midi(144, 24, 127);
eB1valAlt = eB1val;
}else if(eB1valAlt == 1 && eB1val == 0){ //Note OFF
midi(128, 24, 0);
eB1valAlt = eB1val;
}

//Bahn f
fB4val = digitalRead(fB4);
fB3val = digitalRead(fB3);
analogRead(A11);
fFval =analogRead(fF);
fB2val = digitalRead(fB2);
fB1val = digitalRead(fB1);

//MIDI
if(fB4valAlt == 0 && fB4val == 1){//Note ON
midi(144, 25, 127);
fB4valAlt = fB4val;
}else if(fB4valAlt == 1 && fB4val == 0){ //Note OFF
midi(128, 25, 0);
fB4valAlt = fB4val;
}

if(fB3valAlt == 0 && fB3val == 1){//Note ON
midi(144, 26, 127);
fB3valAlt = fB3val;
}else if(fB3valAlt == 1 && fB3val == 0){ //Note OFF
midi(128, 26, 0);
fB3valAlt = fB3val;
}

if(fFvalAlt-2 > fFval || fFval > fFvalAlt+2){
fFvalMIDI = (int) map(fFval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,27,fFvalMIDI);
fFvalAlt = fFval;
}

if(fB2valAlt == 0 && fB2val == 1){//Note ON
midi(144,28, 127);
fB2valAlt = fB2val;
}else if(fB2valAlt == 1 && fB2val == 0){ //Note OFF
midi(128, 28, 0);
fB2valAlt = fB2val;
}

if(fB1valAlt == 0 && fB1val == 1){//Note ON
midi(144, 29, 127);
fB1valAlt = fB1val;
}else if(fB1valAlt == 1 && fB1val == 0){ //Note OFF
midi(128, 29, 0);
fB1valAlt = fB1val;
}

//Bahn g
gB4val = digitalRead(gB4);
gB3val = digitalRead(gB3);
analogRead(A11);
gFval =analogRead(gF);
gB2val = digitalRead(gB2);
gB1val = digitalRead(gB1);

//MIDI
if(gB4valAlt == 0 && gB4val == 1){//Note ON
midi(144, 30, 127);
gB4valAlt = gB4val;
}else if(gB4valAlt == 1 && gB4val == 0){ //Note OFF
midi(128, 30, 0);
gB4valAlt = gB4val;
}

if(gB3valAlt == 0 && gB3val == 1){//Note ON
midi(144, 31, 127);
gB3valAlt = gB3val;
}else if(gB3valAlt == 1 && gB3val == 0){ //Note OFF
midi(128, 31, 0);
gB3valAlt = gB3val;
}

if(gFvalAlt-2 > gFval || gFval > gFvalAlt+2){
gFvalMIDI = (int) map(gFval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,32,gFvalMIDI);
gFvalAlt = gFval;
}

if(gB2valAlt == 0 && gB2val == 1){//Note ON
midi(144,33, 127);
gB2valAlt = gB2val;
}else if(gB2valAlt == 1 && gB2val == 0){ //Note OFF
midi(128, 33, 0);
gB2valAlt = gB2val;
}

if(gB1valAlt == 0 && gB1val == 1){//Note ON
midi(144, 34, 127);
gB1valAlt = gB1val;
}else if(gB1valAlt == 1 && gB1val == 0){ //Note OFF
midi(128, 34, 0);
gB1valAlt = gB1val;
}

//Bahn h
hB4val = digitalRead(hB4);
hB3val = digitalRead(hB3);
analogRead(A11);
hFval =analogRead(hF);
hB2val = digitalRead(hB2);
hB1val = digitalRead(hB1);

//MIDI
if(hB4valAlt == 0 && hB4val == 1){//Note ON
midi(144, 35, 127);
hB4valAlt = hB4val;
}else if(hB4valAlt == 1 && hB4val == 0){ //Note OFF
midi(128, 35, 0);
hB4valAlt = hB4val;
}

if(hB3valAlt == 0 && hB3val == 1){//Note ON
midi(144, 36, 127);
hB3valAlt = hB3val;
}else if(hB3valAlt == 1 && hB3val == 0){ //Note OFF
midi(128, 36, 0);
hB3valAlt = hB3val;
}

if(hFvalAlt-2 > hFval || hFval > hFvalAlt+2){
hFvalMIDI = (int) map(hFval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,37,hFvalMIDI);
hFvalAlt = hFval;
}

if(hB2valAlt == 0 && hB2val == 1){//Note ON
midi(144,38, 127);
hB2valAlt = hB2val;
}else if(hB2valAlt == 1 && hB2val == 0){ //Note OFF
midi(128, 38, 0);
hB2valAlt = hB2val;
}

if(hB1valAlt == 0 && hB1val == 1){//Note ON
midi(144, 39, 127);
hB1valAlt = hB1val;
}else if(hB1valAlt == 1 && hB1val == 0){ //Note OFF
midi(128, 39, 0);
hB1valAlt = hB1val;
}


//     ------------------------------------------------------------------- große Fader und Taster
PauseVal = digitalRead(Pause);
GoMinusVal = digitalRead(GoMinus);
GoPlusVal =digitalRead(GoPlus);
analogRead(A11);
gFLval = analogRead(gFL);
analogRead(A11);
gFRval = analogRead(gFR);

if(PauseValAlt == 0 && PauseVal == 1){//Note ON
midi(144, 40, 127);
PauseValAlt = PauseVal;
}else if(PauseValAlt == 1 && PauseVal == 0){ //Note OFF
midi(128, 40, 0);
PauseValAlt = PauseVal;
}

if(GoMinusValAlt == 0 && GoMinusVal == 1){//Note ON
midi(144, 41, 127);
GoMinusValAlt = GoMinusVal;
}else if(GoMinusValAlt == 1 && GoMinusVal == 0){ //Note OFF
midi(128, 41, 0);
GoMinusValAlt = GoMinusVal;
}
if(GoPlusValAlt == 0 && GoPlusVal == 1){//Note ON
midi(144, 42, 127);
GoPlusValAlt = GoPlusVal;
}else if(GoPlusValAlt == 1 && GoPlusVal == 0){ //Note OFF
midi(128, 42, 0);
GoPlusValAlt = GoPlusVal;
}

if(gFLvalAlt-4 > gFLval || gFLval > gFLvalAlt+4){
gFLvalMIDI = (int) map(gFLval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,43,gFLvalMIDI);
gFLvalAlt = gFLval;
}

if(gFRvalAlt-4 > gFRval || gFRval >gFRvalAlt+4){
gFRvalMIDI = (int) map(gFRval, 3, 1020, 0, 127); //umrechnen in MIDI Daten
midi(145,44,gFRvalMIDI);
gFRvalAlt = gFRval;
}
 
}


void midi(int cmd, int pitch, int velocity) {
  Serial.write(cmd);
  Serial.write(pitch);
  Serial.write(velocity);
}

Given that changing one fader affects others, I'd suggest that changing currents are not properly isolated to the one fader; a high-impedance path returning bottom of fader common might do that, although it sounds like it's a VERY high impedance. But it's all moot, can't see the faders on the schematic.
On the board, I hope the tiny traces aren't return paths for the faders.

1 Like

The faders are those 8 pin objects, named F1 to F8. (They do have more features than i use)
A1 Signal
A2 GND
A3 5V

Adding, I hope your board has a ground plane?

I've read that high impedance inputs can be a problem, are 10k already too much? I did not find other faders (with an acceptebale price), that have lower resistance and work with 5V.

A filter cap on each analog input would have been a good idea.

1 Like

Nah, nothing of those. I will add capacitors, do you can recommend, which ones i can use?
On the board, the return paths are pretty big (i doubled the recommend width, maybe they look small on the picture). On commercial fader boards they are way smaller.

Maybe it helps,
This is the datasheet of the faders

All boards should have a ground plane, unless there is some special reason not to. It drastically reduces cross talk and interference.

0.1uF (100nF) would be about right for filter caps.

With regard to your problem, the individual returns are not at issue - it's the common connections that are suspect.

Thanks for the data sheet, however there is nothing to be learned from it in this case, they are just pots as far as the circuit is concerned.

What is this thing (yellow)? Is it a via? Looks pretty sus.
image
What does it look like in reality?

Have you metered out the ground and 5V connections to the pot array, with a DMM? Now would be a good time.

1 Like

Yes, it is. Here is a photo:

I measured all connections between the Arduino (on the Arduino) and the fader (for 5V, GND, and Signal). There was a max resistance of 0.1Ohm. I wanted to doublecheck this, and there was no change.

But I found something different, that could be the problem. Between the fader return paths the resistance depends on the position of the fader and goes from 10Ohm to 2k. I measured this without the Arduino attached to the board.
The only question is, where this low resistance comes from. Between digital pins (for the buttons), the resistance is above 1M, so its not the distance between the soldered pins. I'll inform you, as soon as I have new (measured) ideas

Perhaps you got the fader pins mixed up. You show a standard via, it's okay but it's a weak point in fabrication. Through holes are plated through, and it's a process that can fail when companies cut corners.

1 Like

Investigate. If I'm interpreting correctly, you're saying the signal path from the pin at the bottom of the slider, to the same point on other sliders, varys with slider position? Slider schematic is on the last page of the document linked to, and it's pretty basic, but somehow there's something wrong with the way you've routed it.

1 Like

Hi,
Have you a DMM?
If so, measure the inputs directly, at the Mega, with the DMM and see if you have the drift you describe in post #1.
Check the 5V directly across the pots as you change pot settings.

What other peripherals do you have on the 5V supply?
Are you using the Mega's 5V or an external power supply?

Tom.. :smiley: :+1: :coffee: :australia:

1 Like