Hi All,
I am having an Arduino Uno connected with two TMP36 sensors. I have followed the tutorial from Overview | TMP36 Temperature Sensor | Adafruit Learning System and I get very weird results which i show you below.
I have to say that I am using 3.3V not 5V cause I found after a little search that gives more accurate temperature.
0.49 volts sensor 0
-0.69 degrees C sensor 0
0.49 volts sensor 1
-1.02 degrees C sensor 1
0.49 volts sensor 0
-1.02 degrees C sensor 0
0.49 volts sensor 1
-1.34 degrees C sensor 1
0.49 volts sensor 0
-1.02 degrees C sensor 0
0.49 volts sensor 1
-1.34 degrees C sensor 1
0.49 volts sensor 0
-1.02 degrees C sensor 0
0.49 volts sensor 1
-1.02 degrees C sensor 1
0.49 volts sensor 0
-1.02 degrees C sensor 0
0.49 volts sensor 1
-1.34 degrees C sensor 1
0.49 volts sensor 0
-1.02 degrees C sensor 0
0.49 volts sensor 1
-1.02 degrees C sensor 1
My code is the following:
int sensorPin = 0;
int sensorReading ;
float temperatureC ;
float voltage ;
int sensorPin1 = 1;
int sensorReading1 = 0;
float temperatureC1 = 0;
float voltage1 = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
sensorReading = analogRead(sensorPin);
voltage = sensorReading * 3.3;// converting that reading to voltage for 3.3v
voltage /= 1024.0;
Serial.print(voltage); Serial.println(" volts sensor 0"); // print out the voltage
temperatureC = (voltage - 0.5) * 100; //converting from 10 mv per degree wit 500 mV offset (to degrees ((volatge - 500mV) times 100))
Serial.print(temperatureC); Serial.println(" degrees C sensor 0");// print out the temperature degrees C
sensorReading1 = analogRead(sensorPin1);
voltage1 = sensorReading1 * 3.3;// converting that reading to voltage for 3.3v
voltage1 /= 1024.0;
Serial.print(voltage1); Serial.println(" volts sensor 1"); // print out the voltage
temperatureC1 = (voltage1 - 0.5) * 100; //converting from 10 mv per degree wit 500 mV offset (to degrees ((volatge - 500mV) times 100))
Serial.print(temperatureC1); Serial.println(" degrees C sensor 1");// print out the temperature degrees C
delay(1000);
}
Does anybody seen anything like that?
Is there any chance my sensors to be faulty?
Any help will be much appreciated!
Many Thanks!