Noise margin on analog input

Hi guys. My first post here.
I'm new to arduino, just started with an uno. I wanted to know if there are normal or acceptable range of noise while reading analog inputs?
My setup is fairly simple, reading a potentiometer on A0, and sending it to pc for plot. Tried diffrent pots, shortened the wires, diffrent inputs rather than A0, but I still see some noise are picking up. in worse case I read +-16 units and in best case which I used two resistors as deviders I still pick up to +-4 value errors.
Is this normal? I was supposed to read same number while I dont change anything.
Using a single resistor tied to Vcc I still get reverse spikes and only while I pull it down to ground I get a constant value of 0.
Really appreciate your help.

What setup. How do you power it. Is there a breadboard involved.
What is the value of the pot. Is it log or linear.
How do you read it (code).
The attached sketch jumps 1 value with a 10k lin (10kb) pot connected to A0.
Leo..

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

void loop() {
  Serial.println(analogRead(A0));
  delay(250);
}

Wawa:
What setup. How do you power it. Is there a breadboard involved.
What is the value of the pot. Is it log or linear.
How do you read it (code).
The attached sketch jumps 1 value with a 10k lin (10kb) pot connected to A0.
Leo..

void setup() {

Serial.begin(9600);
}

void loop() {
 Serial.println(analogRead(A0));
 delay(250);
}

Powered by the usb port, the breadboard holds the pot and three jumper wires to Uno board, nothing's attached to power rails or anywhere else.
Does it differs to use A or B type pot? I tried both at 5k, 10k, 50k.
The code is much like yours.

void setup() {
  pinMode(A0, INPUT);
  Serial.begin(9600);
}

int i;

void loop() {
  i = analogRead(A0);
  Serial.println(i);
  delay(100);
}

Still the data is not stable and there are a little noise in plot.

In my experience, printing over serial link may affect analog reading. Better to do sampling and printing separately in time, for example saving data into an array.

Sarax:
Does it differs to use A or B type pot? I tried both at 5k, 10k, 50k.

5kb and 10kb are both fine. 50kb still ok, but outside the recommended <=10k input impedance of the MCU.
A 100n cap from A0 to ground might be needed for the 50k pot.

An "A" type (log, audio) pot is not recommended.
A lin "B" type has the analogue values evenly spread over it's rotation.
An old/used/dirty pot could give random values when turning.

What are you using it for.
Code could "lock in" the values.
Try this sketch that I wrote for 0-100% (101 values).
Leo..

// converts the position of a 10k lin(B) pot to 0-100%
// pot connected to A0, 5volt and ground

int rawValue;
int oldValue;
byte potPercentage;
byte oldPercentage;

void setup() {
  Serial.begin(115200); // set serial monitor to this baud rate, or change the value
}

void loop() {
  // read input twice
  rawValue = analogRead(A0);
  rawValue = analogRead(A0); // double read
  // ignore bad hop-on region of a pot by removing 8 values at both extremes
  rawValue = constrain(rawValue, 8, 1015);
  // add some deadband
  if (rawValue < (oldValue - 4) || rawValue > (oldValue + 4)) {
    oldValue = rawValue;
    // convert to percentage
    potPercentage = map(oldValue, 8, 1008, 0, 100);
    // Only print if %value changes
    if (oldPercentage != potPercentage) {
      Serial.print("Pot percentage is: ");
      Serial.print(potPercentage);
      Serial.println(" %");
      oldPercentage = potPercentage;
    }
  }
}

MasterT:
In my experience, printing over serial link may affect analog reading. Better to do sampling and printing separately in time, for example saving data into an array.

Thank you, did that but still noisy... Same results.

Wawa:
An "A" type (log, audio) pot is not recommended.
A lin "B" type has the analogue values evenly spread over it's rotation.
An old/used/dirty pot could give random values when turning.

What are you using it for.

Yea, I know that but I want to understand what causes this messy readings.
Finally Connected two 10k resistors to Uno and eliminated the breadboard now the value is at 511 with rapidly random jumps to 512 and 510. And this is good for nothing. So I'm wondering if i can read out a single value or I must do filterings either software or hardware or both.

Sarax:
Hi guys. My first post here.
I'm new to arduino, just started with an uno. I wanted to know if there are normal or acceptable range of noise while reading analog inputs?
My setup is fairly simple, reading a potentiometer on A0, and sending it to pc for plot. Tried diffrent pots, shortened the wires, diffrent inputs rather than A0, but I still see some noise are picking up. in worse case I read +-16 units and in best case which I used two resistors as deviders I still pick up to +-4 value errors.
Is this normal? I was supposed to read same number while I dont change anything.
Using a single resistor tied to Vcc I still get reverse spikes and only while I pull it down to ground I get a constant value of 0.
Really appreciate your help.

With battery power and a low-noise environment the noise on an analog input can be a lot less than 1 LSB
for the ATmega processors - slowly changing values can be used to show this, such as a capacitor self-discharge.

(the SAM processor in the Due on the other hand has a hopelessly noisy analog performance).