Electronic – Temperature measurement using LM35

adcbeaglebone blacktemperature

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.

Best Answer

It appears that the reading has already been scaled by the software, since the 315 ADC reading you are seeing is very close to the 312 you'd expect with a room temperature of 31.2°C (which, in turn, seems about 10°C too hot for comfort, but that's just my opinion).

As you've found, you only need to divide the number (which is the mV) by 10.0 (mV/°C) to get the temperature in Celsius.