I have a TMP36 that I use to display the temperature in the room on a LCD screen.
I then convert the analog read Vout of the TMP36 to voltage and then the voltage to Celsius.
I uploaded the code using my laptop. The temperature it gave me was about 25 ?. But then I plugued the USB on my tower PC just to power it stationary and the temperature it was giving me got up to 27 ?. I know the 27 ? is about right because I have a thermometer in my alarm clock (I know right) and it gives me about 27 ? too. When I plug it back in my laptop, the temperature displayed drops to about 25 ?. It is not a constant value as it changes to +- 1 ? as normal.
The TMP36 works on voltage from 2.7V to 5.5V. I use the 5V out on my arduino to power it. Changing the Vin on the TMP36 should not change its output as long as the voltage stays in the range. (I tested it using a potentiometer and a multimeter.)
So the problem is, could the different computers output a different voltage and/or amperage? This change should not affect the TMP36, but could it affect the reading of the analog port?
If you are using the default analog reference voltage you very well could get different results in different computers. The default analog reference is Vcc which will be the USB voltage. Measure Vcc supplied by USB on the different computers. You always see analogRead(A0) * 5.0/1024 but it should be analogRead(A0) * Vcc/1024. And, yes, I use 1024, not 1023. Just because it makes sense to me
Same as before. Measure the Vref with your meter and use that in the reading conversion not 5V.
If your Vref is changing then it will change what you read.
Low voltage operation (2.7 V to 5.5 V) Calibrated directly in °C
10 mV/°C scale factor (20 mV/°C on TMP37) ±2°C accuracy over temperature (typ)
±0.5°C linearity (typ)
Stable with large capacitive loads
Specified ?40°C to +125°C, operation to +150°C Less than 50 ?A quiescent current
Shutdown current 0.5 ?A max
Specified operating range temperature is -40 to 125 = 165 degree range of possible values?
i did it this way... range = 165 possibly values
the chart shows something between 0-1700mV as the readable range of the middle pin
i got a reading of .66v = 660mV
660/1700 = .388 = 38.8% of the range of the device.
165 X .388 = 64.02 ( 38.8% of 165 possible points )
64.02 - 40 = 24.02 ( remove the negative values possible gives you the reading from zero which according to my temperature locally is very close! )
I expected to see 24C - for my house and my town....
IF instead I use the value from the TMP36 of 750mV = 25C and I say its 10mV per 1C
i get what the Arduino book says... which is
750mV - 660mV = 90mV difference... which should mean 90/10 = -9 degrees offset from 25C = 16C
which is what the serial output is showing - when I follow the directions and instructions according to the Arduino Projects Book...
Can anyone explain that one? seems like something is wrong.... I could just be my math or my logic...
but the reading on the Arduino does NOT agree with my expected reading - and the TMP36's own center point and 10mV for degree change also doesn't compute for me...
The simplest way of automatically measuring the Vcc and hence the Vref, is to switch the A/D input and mere the internal referance voltage. Then from this reading you can work out the value of Vcc.