Go Down

Topic: Newbie Question: LM35 & Negative voltage on input pin (Read 2181 times) previous topic - next topic

Armus

Hello guys! Newbie in electronics here. (hope it's in the right place of the forum)

I'm trying to learn by myself with a brand new Uno, but I'm really afraid of trying wild new stuff and frying my new toy.  :)
The thing is, I used my Arduino to create a simple thermometer with a LM35 (http://pdf1.alldatasheet.com/datasheet-pdf/view/8866/NSC/LM35/+5757uIOzZKMAN+/datasheet.pdf) sensor.
I simply hooked up everything according to a tutorial I saw like this:
      LM35
  /     |     \
+5v   A0     ground
and everything worked perfectly, I got the correct voltage in A0 for room temperature in Celsius and everything.
But then, I was looking at the datasheet and realized that below 0 degrees Celsius, LM35 would output an negative voltage. So, if I'd go below 0, would that damage the input pin (A0)?
In the datasheet there's a circuit configuration that allows one to measure down to -55C (Figure 7). I'm still trying to understand that, but meanwhile, I came out with an alternate way of doing almost the same thing. I would like someone to confirm or explain to me why that wouldn't work.
If I hook it up like this:
      LM35
  /     |     \
D9   A0     D10

And then, I'd analogwrite  5v to output pin D9 and 1v to D10 (thus giving an difference in potential of 5-1=4v) so that when LM35 outputs a negative value (let's say, -1v) I would read it in A0 as 0v. Does that make sense or I'm way off course?

Thanks!

pbrouwer

The LM35 won't go negative if there is no negative supply rail. If you think you will encounter negative tempratures, you can connect the lm35's ground pin to ground using two diodes and the output pin to ground with ~18kOhm of resitance. This way the output will be offset. To measure the temperature, you need to connect the output pin to an analog input and the ground pin to another analog input, and use the difference between the two. See the LM35 datasheet for the details of this schematic.

MarkT

Quote
And then, I'd analogwrite  5v to output pin D9 and 1v to D10 (thus giving an difference in potential of 5-1=4v) so that when LM35 outputs a negative value (let's say, -1v) I would read it in A0 as 0v. Does that make sense or I'm way off course?


Way off course I'm afraid, analogWrite () doesn't output analog values.  It generates pulse-width modulation, despite the name.

Since the device takes less than 60uA current you could, at a pinch, provide the 1V rail for the gnd terminal of the LM35 from a resistor divider - use 1k and 3k9, so you'll get about 1V at the gnd terminal - you then measure that as well as the output voltage using two analog inputs and take the difference.  Don't forget the load resistor on the output in this mode (which should be about 20k).
[ I won't respond to messages, use the forum please ]

paopaolo

Hi mate,

here reference I found: http://www.ti.com/lit/ds/symlink/lm35.pdf

I cannot give you a sure answer as I'm starting now to search for a temperature sensor, the LM 35 looks great beacuse you just have to go throug a simple math to get the result, I'll buy one and try.
connecting betwen GND and 5v is ok but you'll measure only from 2 to 150° C. Because A0 may analog read from 0 to 1023 linear corresponding 0 to 5V, I believe we will read with pitches of 0.5°C.
Infact Arduino read in pitches of 0.00488 Volts, or 4.88281mV; the LM35 will output 1500 mV at 155°, and linear down to 20 mV at 2° wich is A0 reading respectively 306 and 4. The temperature is therefore A0/2.
However minimum temperature with your connection is 2°.
Analog PWM outputs cannot be used for this.

to read negative temperature you need to put a negative voltage and adequate resistor. Arduino borad cannot power the LM35 in this case.
This said there should be a theoretical combination of resistors such as to make the LM35 powered between 1 and 5 volts (to its minimum of 4V) so as to have GND being relatively to the LM35 equal to -1V.
If we find such combination output readings would be shifted up by 1000mv or 205 pitches. The A0 reading would therefore be converted in temperature with this formula: A0/2-102.
If you get results in this area please give me shout!

Paolo

Go Up