# Newbie Question: LM35 & Negative voltage on input pin

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!

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.

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).

Hi mate,