Skip to content Skip to sidebar Skip to footer

How to read the Arduino ADC value stable and reduce noise

How to read the Arduino ADC Stable 

How to read ADC Arduino becomes stable reducing noise - in certain applications, the ADC becomes very important. Reading a stable value will affect the final results of the reading.

Like the example in the following image using a 10k potentiometer connected to the A0 analog pin.

Wiring ADC Arduino

Please use the circuit above, turn the potentiometer to the middle and leave position, the results of the ADC will be found that the final score sometimes changes like 515, 516, 517, 515, 517 and so on.

How do we make this change not happen too? The answer is with a smooting technique. So, the program will be made to read the ADC value for 10 times and from 10 times it will be taken on average.

The progam is as follows:

int adc = 0;                 
const int jumlah_baca = 10;
int baca[jumlah_baca];
int jumlahArray = 0;
int nilai = 0;

void setup()

void loop()
  nilai = nilai - baca[jumlahArray];
  baca[jumlahArray] = analogRead(A0);
  nilai = nilai + baca[jumlahArray];
  jumlahArray = jumlahArray + 1;

  if (jumlahArray >= jumlah_baca) {
    jumlahArray = 0;

  adc = nilai / jumlah_baca; //get average value


Please upload it and viewed on the monitor series, if you want more smoot again, change the value of the number_baca to even greater. Thank you for visiting the website Chip Piko.

1 comment for "How to read the Arduino ADC value stable and reduce noise"

  1. did you know how to combine it for my program?

    this is my program
    #define STEPS 200
    Stepper stepper(STEPS, 2, 3);
    #define motorInterfaceType 1
    int adc = A0;
    int dirPin = 2;
    int stepPin = 3;
    int buzz = 4;

    void setup() {
    pinMode (dirPin,OUTPUT);
    pinMode (buzz,OUTPUT);

    void loop() {
    int adc = analogRead (A0);

    Serial.println (adc);
    if (adc < 1000)
    digitalWrite (dirPin, HIGH);
    digitalWrite (buzz,LOW);

    else {
    digitalWrite (dirPin, LOW);
    digitalWrite (buzz,HIGH);