I'm doing a project on beaglebone black and I'm interfacing a LM35 temperature sensor (datasheet) to one of the ADC pins of the beaglebone. As per the Beaglebone datasheets the reference voltage of the inbuilt ADC is 1.8V and it has a resolution of 12 bits. I'm using the below formula for the temperature calculation but I'm getting the wrong values.
$$Temperature = \frac{1.8}{4095} \times (ADC\,Reading) \times 100$$
The ADC reading is 315 and room temperature as measured by the thermometer is 31.2 degree celsius and if I apply the above temperature I get reading as 18.3 centigrade which is not correct.
Not sure where I'm going wrong, I followed this blog to do my experiment.