# Analogread value jumping around

**URL:** <https://forum.arduino.cc/t/analogread-value-jumping-around/1371045>\
**Category:** General Guidance\
**Created:** [April 6, 2025, 9:40pm UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045 "2025-04-06T21:40:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![unartifficialunintelligence](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/unartifficialunintelligence/32/1209625_2.png) [@unartifficialunintelligence](https://forum.arduino.cc/u/unartifficialunintelligence)\
**Post date:** [April 6, 2025, 9:40pm UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/1 "2025-04-06T21:40:49Z")

</div>

hey,  
topic : "analogread value jumping around"  
function : pwm signal to motordriver on buttonpush etc.  
connections: endswitches gnd to A2/A3 norm. closes, pwm & dir out on D8/D9  
3 buttons : like in the picture, R220 GND to A1, 5V via different resistors for every button, connected to A1  
([https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button](https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button))  
i have made a lot of theese, they are almost all working, but with some the analogread value tends to jump around big time and i am out of ideas what the problem might be.

do you have any suggestions what it could be?  
Thanks

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [April 6, 2025, 9:44pm UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/2 "2025-04-06T21:44:02Z")

</div>

Hi, @unartifficialunintelligence  
Welcome to the forum.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?  
Hand drawn and photographed is perfectly acceptable.  
Please include ALL hardware, power supplies, component names and pin labels.

Thanks.. Tom.... 😃 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![unartifficialunintelligence](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/unartifficialunintelligence/32/1209625_2.png) [@unartifficialunintelligence](https://forum.arduino.cc/u/unartifficialunintelligence)\
**Post date:** [April 6, 2025, 9:57pm UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/3 "2025-04-06T21:57:24Z")

</div>

![nano wiring](https://europe1.discourse-cdn.com/arduino/original/4X/d/9/b/d9b4510176840e4dab88a795329448f53c9e978e.png)

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [April 6, 2025, 10:12pm UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/4 "2025-04-06T22:12:05Z")

</div>

Measurements always have random errors. Please post some examples, so forum members can get an idea of what you mean by "jump around".

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [April 6, 2025, 10:17pm UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/5 "2025-04-06T22:17:41Z")

</div>

Hi, @unartifficialunintelligence  
Thanks for the schematic.

Can you please post your code and some images of your project?  
So we can see your component layout.

Do you have a DMM? Digital MultiMeter?

Thanks.. Tom.... 😃 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![unartifficialunintelligence](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/unartifficialunintelligence/32/1209625_2.png) [@unartifficialunintelligence](https://forum.arduino.cc/u/unartifficialunintelligence)\
**Post date:** [April 6, 2025, 10:27pm UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/6 "2025-04-06T22:27:55Z")

</div>

i have a +- tolerance of 80  
value can also jump to 0 while button pushed  
not much to see on photos,

 ![PXL_20250406_222337174](https://europe1.discourse-cdn.com/arduino/original/4X/7/c/1/7c14c0d87b3c4a632b6b6337430d0044b9c8be52.jpeg)

```arduino
#include "PWM.h"
#include "Arduino.h"
#include "EEPROMextent.h"
#define buttonwires 2 
//buttonresistors : A450/B20/C45
int i;
bool EEPwritten =false;
char incomingByte = 0;
bool m_interrupt=false;
unsigned long actionbegin=0;
#define buttonsvaluelimit 15
#define oldbuttonsvaluelimit 80
int buttonstatcountback=3;
#define oldbuttonAvalue 320
#define oldbuttonBvalue 510
#define oldbuttonCvalue 845
//#define buttonAvalue 45
//#define buttonBvalue 75
//#define buttonCvalue 105
float spdmod=10;
long speed_up= 30000;
long speed_down=40000;
int buttonpressedat=0;
int buttonswitchdelay=500;
#define commandenddelay 800
enum direction {UP, DOWN};
enum spinUp {ACCELERATE, DECELERATE};
#define accelsteps 200
#define deccelsteps 800
#define steppin 9
#define dirpin 8
#define startfreq 0
int buttonsvalue;
#define buttons A1
#define endswitchtop A2 
int endswitchbottom=17; 
bool dirHelp = false;
int32_t maxfreq = 300000;
int32_t freq = 0;
int buttonAstate;
int buttonBstate;
int buttonCstate;
int endswitchtopState;
int endswitchbottomState;
int interrupt = 0;
long actualpos = 0;
long movebeginfrompos =0;
long favpostop = 15000;
long favposlow = 0;
int startup = 1;
int pos = 1;
float stepstaken=0;
void countposition_acc_dcc() {
  if (dirHelp == true) {
  stepstaken=(((micros()-actionbegin)*0.00000001)*speed_up );
  actualpos=(movebeginfrompos+stepstaken)/2;}  
  if (dirHelp == false) {
  stepstaken=(((micros()-actionbegin)*0.00000001)*speed_down);
  actualpos=(movebeginfrompos-stepstaken)/2; }}
void countposition() {
  if (dirHelp == true) {
  stepstaken=(((micros()-actionbegin)*0.00000001)*speed_up );
  actualpos=movebeginfrompos+stepstaken;}  
  if (dirHelp == false) {
  stepstaken=(((micros()-actionbegin)*0.00000001)*speed_down);
  actualpos=movebeginfrompos-stepstaken; }}
void Inputread() {
  m_interrupt=false;
  buttonAstate=HIGH;buttonBstate=HIGH;buttonCstate=HIGH;
  if (buttonwires==4){
   if (digitalRead(A5)==HIGH && digitalRead(A5)==HIGH) buttonAstate = HIGH; else buttonAstate=LOW;
   if (digitalRead(A4)==HIGH && digitalRead(A4)==HIGH) buttonBstate = HIGH; else buttonBstate=LOW;
   if (digitalRead(A3)==HIGH && digitalRead(A3)==HIGH) buttonCstate = HIGH; else buttonCstate=LOW;}
 if (buttonwires==2){
  buttonsvalue = analogRead(buttons);
  if ((digitalRead(endswitchtop)==HIGH) && (digitalRead(endswitchtop)==HIGH)) endswitchtopState = HIGH;
   else endswitchtopState = LOW;
  if ((digitalRead(endswitchbottom)==HIGH) && (digitalRead(endswitchbottom)==HIGH)) endswitchbottomState = HIGH;
   else endswitchbottomState = LOW;
  if (buttonstatcountback==0){buttonAstate=HIGH;buttonBstate=HIGH;buttonCstate=HIGH;}
  buttonstatcountback--;if (buttonstatcountback<0) buttonstatcountback=0;
  //a
  if ((buttonsvalue > (oldbuttonAvalue - oldbuttonsvaluelimit) && buttonsvalue < (oldbuttonAvalue + oldbuttonsvaluelimit)) 
   || ((buttonsvalue > (45 - buttonsvaluelimit) && buttonsvalue < (45 + buttonsvaluelimit))))
  {buttonAstate = LOW;buttonstatcountback=3;}
  //b  
  if ((buttonsvalue > (510 - oldbuttonsvaluelimit) && buttonsvalue < (510 + oldbuttonsvaluelimit)) 
   || ((buttonsvalue > (75 - buttonsvaluelimit) && buttonsvalue < (75 + buttonsvaluelimit)))) 
  {buttonBstate = LOW;buttonstatcountback=3;}
  //c
  if ((buttonsvalue > (845 - oldbuttonsvaluelimit) && buttonsvalue < (845 + oldbuttonsvaluelimit)) 
  || ((buttonsvalue > (105 - buttonsvaluelimit) && buttonsvalue < (105 + buttonsvaluelimit))))
  {buttonCstate = LOW;}}
  incomingByte =0;
  if (Serial.available() > 0) {
  incomingByte = Serial.read();}
  if (incomingByte=='a') buttonAstate=LOW;
  if (incomingByte=='b') buttonBstate=LOW;
  if (incomingByte=='c') buttonCstate=LOW;
  if (incomingByte=='0') {buttonAstate=LOW;buttonBstate=LOW;buttonCstate=LOW;}
  if (buttonAstate == LOW || buttonBstate == LOW || buttonCstate == LOW) m_interrupt=true;}
void HoldSpeed(){
   SetPinFrequency(steppin, freq); pwmWriteHR(steppin, 32786);
   }
void turnOn(spinUp speedup){
  buttonpressedat=actualpos;
  if (dirHelp == false) maxfreq = speed_down; 
  else maxfreq = speed_up;  
  switch (speedup) {
    case ACCELERATE:
      { for (freq = startfreq; freq <= maxfreq; freq += accelsteps) {HoldSpeed(); }
        break; 
          Serial.print("freq : ");Serial.println(freq);}
    case DECELERATE:
      {for (freq = maxfreq; freq >= startfreq; freq -= deccelsteps) {HoldSpeed();}
    pinMode(steppin, LOW);}}}
void moveToDirection(direction dir){
  digitalWrite(dirpin, dir);
  if (dir == UP) dirHelp = true;
  else dirHelp = false;}
void favpos_save() {
  favpostop = actualpos;
  EEPwritten=false;
  Serial.print("favpos_save ");
  printvariables();
  noise();
  pinMode(steppin, LOW);
  }
void noise() {
  SetPinFrequency(9, 615000); // make the noise
  pwmWriteHR(steppin, 32786);
  delay(50);
  pinMode(steppin, LOW);
  delay (1000);}
void ButtonA() { 
  Serial.println("ButtonA");printvariables();
  actionbegin=micros();
  movebeginfrompos=actualpos;
  if (endswitchtopState == LOW) {pos = 1;
  moveToDirection(UP);
  turnOn(ACCELERATE);
  countposition();
  actionbegin=micros();
  actualpos=(actualpos-movebeginfrompos)/2+actualpos;
  movebeginfrompos=actualpos;
  //autoupbuttondelay
   while ((actualpos-buttonpressedat < buttonswitchdelay) && (endswitchtopState == LOW) &&
           (buttonAstate == LOW))     
    { Serial.print("autoupbuttondelay ");
      printvariables();
      HoldSpeed();
      Inputread();
      countposition();
      }
  //manualup
    while (buttonAstate == LOW && buttonBstate == HIGH
           && buttonCstate == HIGH && endswitchtopState == LOW && Serial.read()!=0) {
      if (pos == 1) pos = 0;
      Serial.print("manualup ");
      printvariables();
      HoldSpeed();
      Inputread();
      countposition();
      m_interrupt=true;}
    //autoup
    while (endswitchtopState == LOW && actualpos < favpostop && m_interrupt==false) {
      Serial.print("autoup ");
      if (pos == 1) {favposlow = buttonpressedat;pos = 0; }
      printvariables();
      HoldSpeed();
      Inputread();
      countposition();}
      turnOn(DECELERATE); 
      delay(commandenddelay);}
    EEPwritten=false;
    Inputread();}
void ButtonB() {
  Serial.println("ButtonB");
  actionbegin=micros();
  movebeginfrompos=actualpos;
  if (endswitchbottomState == LOW) {
    moveToDirection(DOWN);
    turnOn(ACCELERATE);
    countposition();
  actionbegin=micros();
  actualpos=(movebeginfrompos-actualpos)/2+actualpos;
  movebeginfrompos=actualpos;
  //autodownbuttondelay
    while ((buttonpressedat-actualpos < buttonswitchdelay) && (endswitchtopState == LOW) &&
           (buttonBstate == LOW))     
    { Serial.print("autodownbuttondelay ");
      printvariables();
      HoldSpeed();
      Inputread();
      countposition();
      }
     //manualdown
    while (buttonAstate == HIGH && buttonBstate == LOW
           && buttonCstate == HIGH && endswitchbottomState == LOW && Serial.read()!=0) {
      Serial.print("manualdown ");
      printvariables();
      HoldSpeed();
      Inputread();
      countposition();
      m_interrupt=true;
    }
 //autodown
     while (endswitchbottomState == LOW && actualpos > favposlow 
     && Serial.read()!=0 && m_interrupt==false) {
      Serial.print("autodown ");
      printvariables();
      HoldSpeed();
      Inputread();
      countposition();
    }
    turnOn(DECELERATE);
    delay(commandenddelay);}
  EEPwritten=false;
  Inputread();}
void selfcheck() {
  Serial.println("selfcheck");
  noise();noise();
  delay(2000);
  Inputread();
  while (buttonCstate==HIGH){
  Inputread();
  if (endswitchtopState == LOW) {
   moveToDirection(UP);
   turnOn(ACCELERATE);
    while (endswitchtopState==LOW && buttonCstate==HIGH) {
     HoldSpeed();
     Inputread();
     if (buttonAstate == LOW ) {
      spdmod=spdmod+0.5;
      spdmod=constrain(spdmod,4,12);
      Eepromwrite();
      Serial.print("spdmod : ");Serial.println(spdmod);
      delay(500);}
     if (buttonBstate == LOW) {
      spdmod=spdmod-0.5;
      spdmod=constrain(spdmod,4,12);
      Eepromwrite();
      Serial.print("spdmod : ");Serial.println(spdmod);
      delay(500);}
     speed_up=30000*spdmod;speed_down=40000*spdmod;
     if (dirHelp==true) freq=speed_up;
     if (dirHelp==false) freq=speed_down;
   }
  turnOn(DECELERATE);
  delay(1000);
  if (buttonCstate == LOW) spdmod=10;
  Eepromwrite();
  }
  if (endswitchtopState == HIGH) {
   moveToDirection(DOWN);
   turnOn(ACCELERATE);
   while (endswitchbottomState==LOW && buttonCstate==HIGH) {
    HoldSpeed();
    Inputread();
    if (buttonAstate == LOW) {
      spdmod=spdmod+0.5;
      spdmod=constrain(spdmod,4,12);
      Eepromwrite();
      Serial.print("spdmod : ");Serial.println(spdmod);
      delay(500);}
     if (buttonBstate == LOW ) {
      spdmod=spdmod-0.5;
      spdmod=constrain(spdmod,4,12);
      Eepromwrite();
      Serial.print("spdmod : ");Serial.println(spdmod);
      delay(500);}
     speed_up=30000*spdmod;speed_down=40000*spdmod;
     if (dirHelp==true) freq=speed_up;
     if (dirHelp==false) freq=speed_down;
   }
   turnOn(DECELERATE);
   }
  }
  Eepromwrite();
  startup = 0;}
void Buttonstatecheck(){
  if (buttonAstate == LOW) ButtonA();
  if (buttonBstate == LOW) ButtonB();
  if (buttonCstate == LOW) favpos_save(); }
void printvariables(){
  Serial.print("eswt:");Serial.print(endswitchtopState);Serial.print("|");
  Serial.print("eswb:");Serial.print(endswitchbottomState);Serial.print("|");
  Serial.print("A:");Serial.print(buttonAstate);Serial.print("|");
  Serial.print("B:");Serial.print(buttonBstate);Serial.print("|");
  Serial.print("C:");Serial.print(buttonCstate);Serial.print("|");
  Serial.print("actpos:");Serial.print(actualpos);Serial.print("|");
  Serial.print("fptp:");Serial.print(favpostop);Serial.print("|");
  Serial.print("fplo:");Serial.print(favposlow);Serial.print("|");
  Serial.print("irrup:");Serial.print(m_interrupt);Serial.print("|");
  Serial.print("spdmod:");Serial.print(spdmod);Serial.print("|");
  Serial.print("bpres@:");Serial.print(buttonpressedat);Serial.print("|");
  Serial.print("butval:");Serial.print(buttonsvalue);Serial.print("|");
  Serial.print("pos:");Serial.print(pos);Serial.print("|");
  Serial.print("micros:");Serial.print(micros());Serial.print("|");
  Serial.print("actbegin:");Serial.print(actionbegin);Serial.print("|");
  Serial.print("intrpt:");Serial.print(m_interrupt);Serial.print("|");
  Serial.print("EEPwrt:");Serial.print(EEPwritten);Serial.print("|");
  Serial.println();
   }
void startuptest(){
  if (startup == 1) {
    Inputread();
    printvariables();
    if (buttonCstate == LOW) {spdmod=10;Eepromwrite();selfcheck();}
    startup = 0; }}
void Eepromwrite(){
 if (m_interrupt==false && EEPwritten==false) 
  {EEPwritten=true;
  EEPROMextent.clear(0, 100);
  EEPROMextent.writeAnything(10, actualpos);
  EEPROMextent.writeAnything(20, favpostop);
  EEPROMextent.writeAnything(30, spdmod);
  Serial.print("WritetoEEPR : ");
  printvariables();
  }}
void Eepromgetdata(){
  EEPROMextent.readAnything(10, actualpos);
  EEPROMextent.readAnything(20, favpostop);
  EEPROMextent.readAnything(30, spdmod);
  if (spdmod==0 || spdmod!=spdmod) spdmod=10;}
void setup() {
  pinMode(A1, INPUT);		
  if (buttonwires==4) {endswitchbottom = 15;pinMode(endswitchbottom, INPUT_PULLUP);}
  delay(1000);
  Serial.begin(115200);
  Serial.println(" ________________________");
  InitTimersSafe(2200);						
  delay(1000);
  pinMode(A3, INPUT_PULLUP);
  pinMode(A4, INPUT_PULLUP);
  pinMode(A5, INPUT_PULLUP);
  pinMode(endswitchbottom, INPUT_PULLUP);		
  pinMode(endswitchtop, INPUT_PULLUP);
  pinMode(dirpin, OUTPUT);					
  //bool succes = SetPinFrequency(steppin, freq);
  Eepromgetdata();
  movebeginfrompos=actualpos;
  speed_up=speed_up*spdmod;
  speed_down=speed_down*spdmod;
  startuptest();
  noise();
  }

void loop() {
 //printvariables();
 Inputread();
 Buttonstatecheck();
 Eepromwrite();}

```

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [April 6, 2025, 10:33pm UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/7 "2025-04-06T22:33:01Z")

</div>

> [@unartifficialunintelligence](#):
>
> +- tolerance of 80

If that means "jumps of 80 units" then you probably have an intermittently or fully open circuit at the analog input.

If fully open, waving a hand near the input will usually produce a response. Double check all connections and wiring for continuity or appropriate resistance.

---

<div class="post-metadata">

**Author:** ![unartifficialunintelligence](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/unartifficialunintelligence/32/1209625_2.png) [@unartifficialunintelligence](https://forum.arduino.cc/u/unartifficialunintelligence)\
**Post date:** [April 6, 2025, 10:40pm UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/8 "2025-04-06T22:40:38Z")

</div>

basic stuff like connections are all tested, and i have this build multiple times, and just some do it, mostly when they are still "cold" just switched on, later the problem might occur not so often.  
Still in debugging, trying to find circumstances when it occurs or not, couldn´t determine yet.  
All works fine on the desk, but at customer some circuits just do their own thing ....(headscratch:)

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [April 6, 2025, 11:18pm UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/9 "2025-04-06T23:18:33Z")

</div>

> [@unartifficialunintelligence](#):
>
> at customer some circuits just do their own thing

Sounds like a quality control problem.

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [April 7, 2025, 1:07am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/10 "2025-04-07T01:07:33Z")

</div>

Hi, @unartifficialunintelligence  
Thanks for the info.

You might need to dress your wiring a bit better.  
Keep mains AC away from other low voltage signal wires.

Check you gnd wiring.

Do you have a DMM?  
Measure the AC voltage on the analog input to see if you have any noise?

Do you have access to a oscilloscope?

Tom.... 😃 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![alto777](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/alto777/32/317385_2.png) [@alto777](https://forum.arduino.cc/u/alto777)\
**Post date:** [April 7, 2025, 4:24am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/11 "2025-04-07T04:24:57Z")

</div>

I'm curious about this pattern you've used multiple times:

```arduino
   if (digitalRead(A4)==HIGH && digitalRead(A4)==HIGH) buttonBstate = HIGH; else buttonBstate=LOW;

```

What is the purpose of reading the pin twice within a handful of microseconds?

a7

---

<div class="post-metadata">

**Author:** ![mikedb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mikedb/32/1098613_2.png) [@mikedb](https://forum.arduino.cc/u/mikedb)\
**Post date:** [April 7, 2025, 4:57am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/12 "2025-04-07T04:57:43Z")

</div>

> [@alto777](#):
>
> What is the purpose of reading the pin twice within a handful of microseconds?

Debouncing ?

---

<div class="post-metadata">

**Author:** ![mikedb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mikedb/32/1098613_2.png) [@mikedb](https://forum.arduino.cc/u/mikedb)\
**Post date:** [April 7, 2025, 5:09am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/13 "2025-04-07T05:09:26Z")

</div>

> [@unartifficialunintelligence](#):
>
> i have a +- tolerance of 80

Do you have a 100nF cap on A1 to GND?  
What is the resistor values?

---

<div class="post-metadata">

**Author:** ![alto777](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/alto777/32/317385_2.png) [@alto777](https://forum.arduino.cc/u/alto777)\
**Post date:** [April 7, 2025, 10:56am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/14 "2025-04-07T10:56:28Z")

</div>

> [@mikedb](#):
>
> Debouncing ?

I am unaware of switches that finish bouncing in 7.2 ~~musi rose condos~~ microseconds.

> [@mikedb](#):
>
> What is the resistor values?

Read the diagram in #3 above. The resistors are unnecessarily low in value, but should work. The maximum current the voltage divider consumes is \< 20 mA.

a7

---

<div class="post-metadata">

**Author:** ![unartifficialunintelligence](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/unartifficialunintelligence/32/1209625_2.png) [@unartifficialunintelligence](https://forum.arduino.cc/u/unartifficialunintelligence)\
**Post date:** [April 8, 2025, 6:43am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/15 "2025-04-08T06:43:18Z")

</div>

exactly

---

<div class="post-metadata">

**Author:** ![unartifficialunintelligence](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/unartifficialunintelligence/32/1209625_2.png) [@unartifficialunintelligence](https://forum.arduino.cc/u/unartifficialunintelligence)\
**Post date:** [April 8, 2025, 6:47am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/16 "2025-04-08T06:47:20Z")

</div>

hey, thanks, there is no cap, not sure if i tried that already, is long time since i made this project. Will try that also, buttonresistors are 440 / 220 / 47 , and gnd resistor is 220.

---

<div class="post-metadata">

**Author:** ![unartifficialunintelligence](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/unartifficialunintelligence/32/1209625_2.png) [@unartifficialunintelligence](https://forum.arduino.cc/u/unartifficialunintelligence)\
**Post date:** [April 8, 2025, 6:49am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/17 "2025-04-08T06:49:23Z")

</div>

will try to debug today, with logic analyzer.  
Was just curious if you guys see any, simple thing i might have overseen/ignored,

Thanks!

---

<div class="post-metadata">

**Author:** ![mikedb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mikedb/32/1098613_2.png) [@mikedb](https://forum.arduino.cc/u/mikedb)\
**Post date:** [April 8, 2025, 7:52am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/18 "2025-04-08T07:52:39Z")

</div>

> [@alto777](#):
>
> Read the diagram in #3 above.

> [@unartifficialunintelligence](#):
>
> exactly

R47 is 0.47 Ω

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/0/d/2/0d2f1bf2d15e1399b06a5974fc412e57bf394e2d.png)

---

<div class="post-metadata">

**Author:** ![unartifficialunintelligence](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/unartifficialunintelligence/32/1209625_2.png) [@unartifficialunintelligence](https://forum.arduino.cc/u/unartifficialunintelligence)\
**Post date:** [April 8, 2025, 9:47am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/19 "2025-04-08T09:47:14Z")

</div>

no.. it´s 47 ohm, in the end it must be some kind of EMI, since like 50 of them are working as they suppose to do , and only a few make problems.  
Trying to recreate the problem.

---

<div class="post-metadata">

**Author:** ![2112](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/2112/32/1129664_2.png) [@2112](https://forum.arduino.cc/u/2112)\
**Post date:** [April 8, 2025, 10:07am UTC](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045/20 "2025-04-08T10:07:13Z")

</div>

Deleted

[Next page](https://forum.arduino.cc/t/analogread-value-jumping-around/1371045.md?page=2)
