Arduino Uno

resistors

Corner
-->

Temperature Sensor LM35

Description

The LM35 is quite similar to the TMP36 but there are still some minor technical differences.

If used remotely over a 3-wire cable, the sensor didn't give any stable results. After taking a deeper look at the examples given in the datasheet, I found a way to use it over a 2-wire twisted pair cable. I've run a test in which I used one sensor immediately on the breadboard and another identically one over a cable. The two sensors gave the very same result.

Schematics

LM35CZ

Sample code

01
02
03
04
05
float getTemperature(float sensor)
{
    float value = analogRead(sensor);
    return (value*5/1024.)/0.01;
}

Links

 Datasheet LM35