what is conversion system of LM35 (temperature sensor) in Celsius?

arduino, sensors

Solution

the truth always lies within the datasheets:

- http://www.ti.com/lit/ds/symlink/lm35.pdf on how to get the data from the LM35 ;

- http://atmel.com/Images/doc8161.pdf on how to use the Atmega ADC.

The Atmega ADC: Analog to Digital Converter

Your Atmega is powered by 5V, and the datasheet of the Atmega states that its ADC has a definition of 1024 values (i.e. 10bits). So in your formula, `5/1024` is representing each voltage step represented by a bit:

0.0000V -> 0b0000000000
0.0048V -> 0b0000000001
...
5.0000V -> 0b1000000000

Getting value out of the LM35

If you read the application notes in the LM35 datasheet, you'll find the following formula:

Vout=10mV/°C

if you're binding the LM35 with a 200ohms resistor. So if you use the rule of three, you'll get:

Vout=0.01/°C
°C=Vout/0.01
°C=Vout/0.01
°C=Vout*100

HTH

Problem

I see formula like ``` temp = (5*val*100/1024) ``` Can anyone tell me the details of this formula?

Original source