My fader value constantly changing (not fixed)

I use fader for midi controller (from behringer X32) and after it is connected I see that the value on analog input is slightly changing by itself, even if don’t touch the fader.

What it can be? I need to have constant value until user move the fader.

Many thanks!

How many are these "slight changes" in digits?

How much does the value change by ?

Consider revising the sketch that reads the value such that only significant changes of value are acted upon

So I have min () and max () values. When I don’t move it it changes from 386 to 387 and vice versa for example

Is there any Arduino involved? Which one.
And where is your diagram and code.
We are not mind readers.
Leo..

The changing about 2-3 ( or even more ADC uinits) are perfectly normal for Arduino analog input.
As @UKHeliBob said, you have to rework the code that the program takes to account only significant changing of the value - say more than 3 or 5 units.

I never saw jumps more than one up or down with an Uno and good connected hardware.
Code with hysteresis can stabilise that to no jumps at all.
Example sketch attached that prints a solid 0-255.
Leo..

int rawValue, oldValue;
byte potValue;

void setup() {
  Serial.begin(115200);
}

void loop() {
  rawValue = analogRead(A0); // read
  if (abs(rawValue - oldValue) >= 4) { // hysteresis
    oldValue = rawValue; // remember the change
    potValue = oldValue >> 2; // 10-bit to 8-bit
    Serial.println(potValue); // print changes
  }
}

I see your point. But the topic was created in “Other Hardware” branch, and I was thinking it is not about arduino but probably fader or something. But anyway thank you for your time and perfect solution

I ended up with the ResponsiveAnalogRead library.