Go Down

Topic: How to get LM35 to read negative temperature with arduino? (Read 4953 times) previous topic - next topic

simonreuben

Anyone have any idea on how I can get negative values on my LM35 through an Arduino UNO? According to figure 7 on the datasheet, it needs to be connected to two power source or two analog pins? Any help would be appreciated.

Wawa

A diode (or two diodes) in the ground wire of the LM35 can lift the ground pin by Vf of the diode.
See Figure 18 of the TI datasheet.
Then you have to measure the output AND the ground pin (two analogue inputs), and subtract the values.

Maybe easier to use a TMP36.
Easier still is a DS18B20 digital temp sensor.
Leo..

simonreuben

Hi Leo,

could you maybe elaborate on the two analogue part i've got the diodes and resistor but still dont get how to program the two analogue ports.

Wawa

You could make three int variables called rawDiode, rawOutput and rawDifference.

In void loop()
rawDiode = analogRead(A0);
rawOutput = analogRead(A1);
rawDifference = rawOutput - rawDiode;

Then use rawDifference for the value to temp conversion.
Leo..

allanhurst

Don't see the problem - the LM35 is rated -55... 150C,  and give 10mV / K..

so 0 C = 273 K => 2.73 volts

-10 C is 2.63 volts

and so on.

regards

Allan

olf2012

Don't see the problem - the LM35 is rated -55... 150C,  and give 10mV / K..

so 0 C = 273 K => 2.73 volts

-10 C is 2.63 volts

and so on.

regards

Allan
It does not work this way, it gives 10mV/C, so at 20C you get 200mV.
I agree with Wawa recommending a TMP36 or a OneWire digital sensor

Wawa

Yes, the LM35 is 10mV per degree C, with 0C being 0volt.
With a diode (or two) in the ground line, device ground voltage is raised a volt or so.
A resistor from out to ground can then pull the output below device ground pin.
Downside is that you have to measure both diode and output voltage.
The TMP36 has an offset of 500mV@0 degrees C, so can measure to almost -50C without additional parts.

Default Aref gives a rather coarse resolution of 0.5C per digital step.
Better to use these sensors with 1.1volt Aref. Stable, and a 5x higher resolution.
1.1volt Aref gives the LM35 a temp range of about 5C to 105C.
And the TMP36 a range of about -45C to 55C.
Leo..

allanhurst

Ah.... 
yes  - misread the datasheet.

regards

Allan.

simonreuben

Hi Leo,

Thanks for the help. Will try it out and let you know if it works.

Just to be sure, the resistor goes from output to ground of the lm35 right? And the two diodes are also connected to ground?

Go Up