Analog input sensor voltage measurement jumps

Hello,
I'm trying to measure an external power source that ranges from 0-21V. I've created a voltage divider to limit the voltage going to the arduino to always be below 5V. My first voltage divider yesterday had less buffer than my current divider and it seems that it did reach the maximum 5V limit. I have changed that today to add more buffer and it has not gotten close to the limit with the current voltage divider, however, the analog input is jumping between 800 and 600 every few seconds. See example readings:
Sensor Value Voltage
808 3.416058394
809 3.419708029
809 3.419708029
809 3.419708029
809 3.419708029
810 3.425182482
598 2.527372263
809 3.419708029
598 2.527372263
599 2.532846715
809 3.419708029
809 3.419708029
808 3.416058394
809 3.419708029
810 3.425182482

I thought maybe I fried my arduino input yesterday when the voltage dividers did not have enough buffer, but I ran a basic circuit to the analog input pin using the boards +5V and ground pins and everything was normal.

To calculate current through the voltage divider circuit, I divided the voltage across resistor by the resistor value (3 different resistors are in series so I verified the number twice) and the current is .02 mA (.00002A).

What is causing the jump in the arduino reading? My voltmeter is not reading this jump when it occurs on the serial monitor, so I think it is just a problem with the board but I can't put my finger on it.

I'm trying to delete this post because I think I figured it out. I think the arduino is working just fine and it's just that the input voltage is actually jumping. I think my digital multimeter is averaging these spikes instead of reporting real time like arduino, so that is why it's off.

I'm measuring the voltage from a solar controller, which has an algorithm to change the voltage/current of solar panel so that it charges the battery correctly. It is float charging the battery right now at 13.55 volts (arduino is reading that correctly), but I think the panel voltage is jumping around because of quick changes in power output of the panel and slight changes of battery power consumption.

even a post that is self solved contains information for later reuse so please do not remove :slight_smile:

You could change the headline of the thread to being [solved].

Another suggestion, when reading voltages that may be higher than 5 volts (even with a voltage divider), it is a good idea to clamping diode on the analog input pin. If one of the resistors in your voltage divider slipped loose, it could easily fry your chip.