I am trying to use the built in ADC of a PIC 18F4520. The input is a voltage signal from an analog sensor whose output varies with temperature. It comes to be about 5.2 V at a certain temperature. I am getting fluctuating values from the ADC output (I checked the ADC output by printing the result with 4 seven segment display unit.) When the output seems to be 65 it fluctuates between 60-70. I am unable to understand the cause of this fluctuation. As I intend to measure temperature via the output of this analog sensor, the fluctuating ADC output is causing trouble. What can be the reason and a solution? Is there a way to know the output that 10 bit ADC will show for a particular input? [![The image gives the ADCON 1 register details. ][1]][1] Image source: [Microchip - PIC18F2420/2520/4420/4520 Data Sheet][2] I am also confused that if I had set the reference voltage bit VCFG0 to VDD i.e. 5 V. and VCFG1 to VSS i.e. 0, will my ADC be able to measure 5.2 or any voltage above 5 V? [1]: https://i.sstatic.net/5TG4n.jpg [2]: https://ww1.microchip.com/downloads/en/devicedoc/39631a.pdf