Analog pin value fluctuating

Hello,

I was getting a huge variation in my voltage measurement value, hence I wanted to look after the ADC value (1023 usually) and the VCC (5 V usually) and calibrate accordingly to the values, to get correct sensor voltage measurements.

On measuring the VCC value, I got it to be around 5.03V and I plugged the analogread to the pin in order to see the adc value it is generating for the full-scale VCC value(based on which, I will be changing in the code)

But as and when I read the raw analog value, I noticed it was fluctuating. I have even attached screenshot regarding that. Initially, my adc value read 1022(I don't have the screenshots for it), but later I got a reading of 989 and kept fluctuating to 999 and then 991, I just continue further, but I am sure this fluctuation occurs for a long range of values.

Can someone sort out on why my analogread values are fluctuating??

I think you need to post the code you use and how it is all connected up.

Until then, I googled 'arduino analog fluctuation' and these might help you out....

https://forum.arduino.cc/index.php?topic=6261.0

An unconnected pin will act as an antenna for local electric fields, stray ions in the air, anything...

The ADC on most Arduino boards is ratiometric - it measures the ratio between the analog pin voltage and
Vcc (unless you've configured it otherwise), so connecting an analog pin to Vcc should always give 1023.