My Circuit:
I have two seperate 10nF caps, one for the LMT84 (3.2 kOhm resistor to Vout to 10nF to ground [as data sheet says]) and the other cap for the TMP36 (Vout to 10nF to ground). Then each of their respective Vout's goes to A0 and A1 respectively.
I also attached the results from the Arduino Serial Terminal, their temperatures are completely off. But it seems to be at consistent difference of either 6.225 C or 5.7367 C.
My multimeter is fairly accurate for each of the Vout values shown on terminal, the LMT84's temperature is correct ACCORDING to the table in the datasheet I posted above, so my transfer function in the IDE should be correct. And I know the TMP36G has been giving me correct temp readings, so what's going?! I know I have to be doing something incorrectly. I've been digging and digging, with no luck.
As always any insight or direction is greatly appreciated.
Yes you are correct, when I have no cap, the values are all off. When I have 1 cap on Vo-Gnd it's correct, when I have 1 cap on Vs-Gnd the temp is down by 0.5-1C , and when I have a cap on Vo and Vs, nothing changes.
But the LMT84's is currently reading 22-23.5 C , while the TMP36G is reading 17-17.8 C which seems more accurate cause right now it is freezing where I am working!
Could I be doing something wrong in the way I am converting my readings?
You must be close, because when I look at the data sheet http://www.ti.com/lit/ds/symlink/lmt84.pdf the lookup table shows that you should be between 28 and 29 C for the 879mv shown in the printout.
You are absolutely right, that is what I was saying. According to the LMT84 datasheet, the printout on the Serial Terminal for voltage and temperature is correct. But 28 C just can't physically be correct, it's freezing in my work space, this is why the subject heading is what it is
The LMT84, according to the datasheet, multi-meter, and Serial printout etc. it is reading correctly, but physically I know it just can't be correct at all.
The TMP36G, I know from past working with it, that it is correct, also it represents more closely what the thermostat is reading.
However, both of these can't be right which is why I was sure it was something to do with the way I was coding; but that seems to be in order (maybe I overlooked something?). So maybe I have the hardware hookup for the LMT84 done incorrectly?
10nF caps, one for the LMT84 (3.2 kOhm resistor to Vout to 10nF to ground [as data sheet says])
Try it without the resistor and the capacitor on the output. My understanding of the capacitance of the Arduino ADC is that it is below the 1100pf and you don't need the resisitor. With the 10nf capacitance you added, the resistor is specified and you should have been OK but you won't hurt anything to try without.
You could try the LM84 with the cap between Vcc an ground as a bypass like on the other TMP36.
The data sheet talks about moisture and leakage currents on the output causing inaccurate results, so I'd check for any contamination on your pins or board that could be causing leakage.
I've seen reference to stabilizing analog read with multiple reads and a delay.
The first analogRead() will switch the pin to the ADC. The delay will allow the voltage at the ADC to stabilize and the second analogRead() should get a stable value.
So that I could match the miliVolt reading on the LMT84 data sheet, to better replicate the TM36G. I realize this might be a work around, but both temperatures are roughly the same; and I know the LMT84 is better spec'd sensor, so I could effectively replace the TM36G.
Thanks again for all your help, really appreciate it!
PS: Posted results below !
EDIT/UPDATE: Realize now that the temperature is still a little off, don't know if this is because the LMT84 is more sensitive or something else. Might tweak that "+40" value to see if I can better replicate a result.
Hi
We are using LMT84 for our class project. Your code is a great help for me. May I ask why your are multiplying resolution by ''5000''? Is this value ''5000'' ref voltage?
Thanks