Cannot read TMP36 values correctly, please help

hey guys, I hope this is the right place to post this.
Basically I am going through Sparks Fun tutorial #7, reading temperature off a TMP36 sensor.
My problem is that I am reading very low values on A0 from the sensor. I hooked it up correctly and when I read the voltage off the sensor with a multimeter, I get 520mV-550mV, which corresponds to a temperature of about 12C-15C (my heating is broken so that could make sense).

Do you guys know what the problem is? If it’s not the setup and not the sensor, why would the board read in really low values from A0? I am using an Arduino Uno, the relevant part of the code is below, atm the raw values on the A0 pin are close to 0, they do go up when I hold and warm the sensor.

const int temperaturePin = 0;


Serial.println(analogRead(temperaturePin));

Circuit wired as in this pic
https://learn.adafruit.com/assets/476

Cheers,
Gero

Please post the code you are using and how you are wiring up the circuit. :wink:

Don’t forget to read the Forum tips and tricks on how to paste code properly here :wink:

I had similar issues with my Arduino Mega 2560 before, it would read around 0 no matter the input. Eventually i found it that my ADC converter was broken (the thing that actually reads the voltage and converts it into a value).

Try another Analog pin and see if that works.

@Gero, if you do a search in the forum for “TMP36” you will see how others solved the measurement issues. Most solutions involve adding a 0.01uF capacitor across the analog input pin and ground. :smile:

2 Likes

thanks I had a look, unfortunately I don’t have a capacitor at hand, I guess I should order one, however I am still puzzled as to why a capacitor would raise the voltage read out on A0. The thing is with a multimeter I am reading 520mV between GND and Vout on the sensor.
If it’s an ADC issue how would I even go about investigating it?

I have tried A1/A2 also, no difference.

Edit: I just restarted the Arduino software and now A0 is reading 1.93V…I am not really sure anymore, I guess I will try the capacitor method.

@Gero, the capacitor acts to “match” the impedance of the analog input (and average the signal). This was discussed at length in this topic:

A multimeter samples slowly and averages its input. Once you put in the capacitor, you will find the readings more in line with what you expect. :smile:

2 Likes

Put a 1k resistor between Vout and GND on the TMP36 - it needs a load resistor on Core. Suddenly it will become accurate and reliable sensor! Explanation here: http://www.doctormonk.com/2015/02/accurate-and-reliable-readings-from.html

2 Likes