Go Down

Topic: LMT84 vs. TMP36G - Both Technically Working, but Something Wrong!  (Read 43 times) previous topic - next topic



I'm using the LMT84 Temperature sensor from T.I (http://www.ti.com/lit/ds/symlink/lmt84.pdf)

I'm trying to compare it to the TMP36G which I know has been reading accurate temperatures for me for some time now.

My code:

Code: [Select]

const int tempPin = A0; // LMT84
float tempC = 0;
const int temp36 = A1; //TMP36G
float tempC36 = 0;

void setup()

void loop()
  int tempRead = analogRead(tempPin);
  float tempmV = ((float) tempRead) / 1024.0 * 5000;
  tempC = ((5.506 - sqrt(sq(-5.506) + (4 * 0.00176 * (870.6 - tempmV))))/(2 * -0.00176)) + 30; //LMT84 temp sensor transfer function
  Serial.println("LMT84 Temp Sensor: ");
  Serial.print("Analog: "); Serial.println(tempRead);
  Serial.print("mVolts: "); Serial.println(tempmV,4);
  Serial.print("Temp: "); Serial.println(tempC, 4);
  int tempRead36 = analogRead(temp36);
  float tempVolt = (float) tempRead36 / 1024.0 * 5.0;
  float tempmV36 = tempVolt * 1000;
  tempC36 = (tempVolt * 100.0) - 50.0;  // this was for the TMP36 sensor
  Serial.println("TMP36 Temp Sensor: ");
  Serial.print("Analog: "); Serial.println(tempRead36);
  Serial.print("mVolts: "); Serial.println(tempmV36,4);
  Serial.print("Temp: "); Serial.println(tempC36, 4);

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.



cap for the TMP36 (Vout to 10nF to ground)
The data sheet for the TMP36 shows that cap going from Vsupply to ground.

What are the readings like when you move the cap over?, or use two caps one on Vs and the other on Vo?

When I was using this sensor I remember seeing different values based on the cap position.

Go Up