# TMP36 -40 Degree?

Hello everybody, today are arrived 2 TMP36 that I had ordered. After setting up and copy paste the code from internet I get this valus:

``````0.22 volts
-28.03 degrees C
-18.45 degrees F
0.24 volts
-25.59 degrees C
-14.05 degrees F
0.05 volts
-44.63 degrees C
-48.33 degrees F
0.11 volts
-39.26 degrees C
-38.66 degrees F
0.07 volts
-42.68 degrees C
-44.82 degrees F
0.06 volts
-43.65 degrees C
-46.57 degrees F
0.10 volts
-39.75 degrees C
-39.54 degrees F
0.10 volts
-39.75 degrees C
-39.54 degrees F
0.08 volts
-42.19 degrees C
-43.94 degrees F
0.17 volts
-32.91 degrees C
-27.24 degrees F
0.21 volts
-29.49 degrees C
-21.09 degrees F
0.10 volts
-40.23 degrees C
-40.42 degrees F
0.18 volts
-31.93 degrees C
-25.48 degrees F
0.20 volts
-29.98 degrees C
-21.96 degrees F
0.16 volts
-34.38 degrees C
-29.87 degrees F
``````

The code that I'm using is this:

``````//TMP36 Pin Variables
int sensorPin = 0; //the analog pin the TMP36's Vout (sense) pin is connected to
//the resolution is 10 mV / degree centigrade with a
//500 mV offset to allow for negative temperatures

/*
* setup() - this function runs once when you turn your Arduino on
* We initialize the serial connection with the computer
*/
void setup()
{
Serial.begin(9600);  //Start the serial connection with the computer
//to view the result open the serial monitor
}

void loop()                     // run over and over again
{
//getting the voltage reading from the temperature sensor

// converting that reading to voltage, for 3.3v arduino use 3.3
float voltage = reading * 5.0;
voltage /= 1024.0;

// print out the voltage
Serial.print(voltage); Serial.println(" volts");

// now print out the temperature
float temperatureC = (voltage - 0.5) * 100 ;  //converting from 10 mv per degree wit 500 mV offset
//to degrees ((voltage - 500mV) times 100)
Serial.print(temperatureC); Serial.println(" degrees C");

// now convert to Fahrenheit
float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;
Serial.print(temperatureF); Serial.println(" degrees F");

delay(1000);                                     //waiting a second
}
``````

Took from adafruit site at this link: https://learn.adafruit.com/tmp36-temperature-sensor?view=all Anyone can help me? Im very angry because this cheap sensor is real creap nonetheless more people said thatt they are precise and suggested! Thank you all (PS all wired is connected in the right way)

Post a diagram of [u]your[/u] wiring (hand drawn, not Fritzing).

Am I missing something?- what's your actual question?

Am I missing something?

Do you think it is -28 C on the OP's workbench?

jremington: Do you think it is -28 C on the OP's workbench?

He didn't say, so for all I know he's a cryogenicist.

Check the printing on the sensor.
The reading is consistent with an LM35 (if the sensor is in a ~22C or 71.6F environment).
Leo…

ahah No man, I’m not!
My question is why there is this temperature instead of the real one?
After some little software resetting
TMP36 = 8 degrees
Current Temp = 18 degrees
Why this difference? I connect al wired in the right way but they are still not working properly…

Post a real picture of the setup. Many things can go wrong. A clasic example is the use of a long breadboard with interrupted power rails. Leo..

As you request here the picture of my TMP36 connect to Arduino

Ground of analogue type sensors should not be shared with other things.
Ground of the TMP36 should go directly to an Arduino ground pin.
Try connecting the TMP36 directly to the Arduino with short-ish wires.
Try this sketch. It uses the internal 1.1volt reference and averaging.
Maybe better to power the TMP36 from the more stable 3.3volt pin.
Leo…

``````// TMP36 temp sensor output connected to analogue input A0
// power pin connected to 3.3volt

unsigned int total; // A/D readings
float tempC; // Celcius
float tempF; // Fahrenheit

void setup() {
analogReference(INTERNAL); // use the internal ~1.1volt Aref | change to (INTERNAL1V1) for a Mega
Serial.begin(9600);
}

void loop() {
for (int x = 0; x < 64; x++) { // 64(max) analogue readings for averaging
}
// temp conversion
tempC = total * 0.001632 - 50.0; // Calibrate by slightly changing 0.0016xx
tempF = tempC * 1.8 + 32; // Celcius to Fahrenheit

Serial.print("The temperature is  ");
Serial.print(tempC, 1); // one decimal place
Serial.print(" Celcius  ");
Serial.print(tempF, 1); // one decimal place
Serial.println(" Fahrenheit");

total = 0; // reset total