When I connect the sensor's +Vs and GND pin to arduino's 5V and GND pin the arduino seems to short-circuit (the power LED goes from bright to almost out)
When I switch the +5v and GND pins this behaviour doesn't occure.
But if i use it like this and connect the Vout pin of the sensor too an analog input of the arduino, I get an adc value of 146.
according to the datasheet the sensor's output is 10mV for every degrees. So this would be 71.7 °C (if an adc value of 0 is 0 °C..), which is a bit high for temperature
This value does change if the temperature changes though...
So to summarize:
My two questions are:
1 - did I connect the sensor wright in the first place?
2 - If i did connect it wright, is my conversion from adc too °C correct?
Not sure what 'this' is. You need a connection between +5V, ground and the arduino input. It sounds like you connected them wrong at first. This could explain why it is not working right.
Not sure what 'this' is. You need a connection between +5V, ground and the arduino input. It sounds like you connected them wrong at first. This could explain why it is not working right.
if i use it like this the arduino doesn't short circuit:
Sensor -- Arduino
+Vs -- GND
GND -- 5V
I know it's far from logical but if I switch those two it short circuits :-?
You're something like the 4th person I've seen in the last week who made that mistake. I would have made it myself, except that I'm used to reading datasheets for TO-92 parts. The side view is always (as far as I know) an illustration of the pins when you look straight at the flat side of the casing.
That wiring mistake is not unlike a frequent one made by some when using 79XX TO-220 voltage regulators, the pin out is different then with 78XX positive voltage regulators in the same package style. People sometimes quickly look at a positive regulator data sheet and assume the negitive regulators are wired the same.
And i use this code to convert the ADC value to °C
temperature = ( 5.0 * analogRead(0) * 100.0) / 1024.0;
I've checked the output voltage of the sensor by hooking up a voltage meter between the gnd and the Vout of the LM35, wich gave me 0,73 Volts, wich would be 73 °C... :-?
Also checked the supply voltage (between +Vs and GND) wich was 5,03V.
this is a brand new LM35, and all the previously tested LM35 gave the same results, could someone please point out the my what it is that i'm doing wrong?