After reading through various arguments for use of different transfer functions, this is my summary:
In order to achieve the manufacturer-stated absolute accuracy of ±2 LSB, you should use the manufacturer's equations and published guidelines on usage to ensure that accuracy (e.g. ensuring appropriate ADC clock speed / sampling time and implementing noise ...
the Atmega328P's datasheet, it indicates the conversion factor is
Indeed. And the datasheet is the only authoritative source. All the
other sources are second-guessing.
If Vin and Vref are 5V, then the ADC reading would need to be 1024 in
order to have a true reading of 5V
You can't get a true reading of 5 V. As per the datasheet (...
As others have said, the difference between 1023 and 1024 is quite small.
However, the fact is that your input range for the ADC is 0 to 1023. (That's 1024 steps, but since it starts at 0, it won't go up to 1024)
You'll get 0 at the minimum input, and 1023 at the maximum value.
If you're using a 5.0V reference voltage and no voltage dividers, that means ...
If issue with readings persist, put an RC circuit for measuring the voltage as it is similar to averaging done in software. Another thing that you can try is replacing the LM35 with a new one as sometimes it could be faulty or you might have damaged it(has happened with me). However u can easily check this by measuring the voltage at the sensing pin whether ...