I am using a TMP36 and arduino (like shown in the connection below ) to measure temperature, and my temperature sensor is changing values abruptly (like from 25deg to 36 deg and back to 25 deg in just a matter of 1sec ).
It looks like there is an error . Can you please tell me if this is normal or not ?
But just for the information i soldered cables on The pins of the TMP36 , i don't know if it affects any how the reading
Thanks
the output looks like this
It looks like there is an error . Can you please tell me if this is normal or not ?
But just for the information i soldered cables on The pins of the TMP36 , i don't know if it affects any how the reading
Thanks
Code:
int sensorPin = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
int reading = analogRead(sensorPin);
float voltage = reading * 5.0;
float calculated = voltage /= 1024.0;
float temperature = (voltage - 0.5) * 100 ;
Serial.print("voltage is "); Serial.println(voltage);
Serial.print("calculated is "); Serial.println(calculated);
Serial.print("temperature is "); Serial.print(temperature) ;Serial.println(" degrees C");
Serial.println("");
delay(1000);
}
the output looks like this
Attachments
-
26.9 KB Views: 16
-
34.5 KB Views: 11
Last edited: