5

A TMP35/36/37 is giving very high voltage readings, which results in high temperature readings. The serial monitor looks like this: enter image description here

As you can see, the sensor value is in the 900s, voltage is almost 5, and temp is in the 400s. The circuit is very simple, just a TMP connected to 5V and ground and pin A0. Here is my code:

const int sensorPin = A0;
const float baselineTemp = 20.0;

void setup() {
  Serial.begin(9600);


}

void loop() {
  int sensorVal = analogRead(sensorPin);
  Serial.print("Sensor value: ");
  Serial.print(sensorVal);

  float voltage = (sensorVal / 1024.0) * 5.0;
  Serial.print(", volts: ");
  Serial.print(voltage);

  Serial.print(", degrees C: ");
  float temperature = (voltage - .5) * 100;
  Serial.println(temperature);
  delay(1000);
}

This is a very simple program and a very simple circuit, so I'm not sure what is going on. Maybe the problem is the sensor itself. I have also tried this sensor with multiple other circuits and programs and the same thing happens.

If anyone knows anything about this, help would be great.

  • 1
    Can you hook up a voltmeter to the Vout of the TMP? If the voltage is actually that high, then yes, you've got a broken part. Try another TMP sensor. This is to just rule out the arduino. – krol Nov 5 '15 at 17:12
  • When I connect a voltmeter to the TMP it says 5V. So it must be the part. – MICROexchange6 Nov 5 '15 at 20:11
  • 1
    Yeah, must've gotten damaged somehow. Just for the sake of being thorough you could: 1. double check your circuit, 2. double check the the TMP orientation (I've hooked them up backwards before), 3. double check the supply voltage and make sure it's between 2.7v and 5.5v (per the data sheet). But, you probably already did these things. I just thought I should mention them just in case. – krol Nov 6 '15 at 16:34
  • Thanks for the comment but yes, I checked all these multiple times. Too bad they only give you one TMP in the starter kit. – MICROexchange6 Nov 8 '15 at 2:51
  • Just curious: where does the - .5 come from, in float temperature = (voltage - .5) * 100;? TMP35 outputs 10mv/degC, with 0v at 0degC. (Not that it would help if this is a coding error; it would make your results look 50degC higher.) – JRobert Oct 3 '16 at 11:59
1

I use voltage dividers a lot and have seen this before.

In each and every case where ALL my readings are high, yet they vary predictably (like on my solar panels - they go up during day and down at night), there has always been proven to be a very simple, single cause.

Resistance in the ground lead.

Such as if it is plugged into a breadboard hole that is not holding it well, or if I have extended it and have connections along the way.

So that would be the first thing I would look for.


Having said that, if the readings are very high and do NOT vary predictably, then I would look for a disconnected ground lead.


If all the connections are good but it still misbehaves then I would swap it out with another one to make sure the part itself isn't the problem.

0

Part seems to be broken; voltage is unusually high.

  • 1
    Before you toss it, it's worth trying another ADC pin. Also make a divider with some resistors and verify you can get a range of values from the ADC. And be sure you have the sensor, not some random transistor, and that you have the wiring correct, including its ground connected. – Chris Stratton Nov 8 '15 at 4:23
  • Thanks, tried different ADC pins, all same results. It is definitely a temperature sensor and the wires are correct. I will try to make a divider to test the ADC, but the other pins were giving me the same results. – MICROexchange6 Nov 14 '15 at 0:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.