1

I've seen other posts on this board which related to output from the LM35 sensor, but mine seem to be more 'extreme' than anything else I've seen.

I've connected the pins as is commonly suggested - left hand to 5v, middle A0, and right to GRN and used the folowing code

const int sensorPin = A0;

float sensorValue; float voltageOut;

float temperatureC; float temperatureF;

void setup() {

pinMode(sensorPin, INPUT); Serial.begin(9600);

}

void loop() {

sensorValue = analogRead(sensorPin); voltageOut = (sensorValue * 5000) / 1024; temperatureC = voltageOut / 10;

Serial.print(sensorValue); Serial.print("\n"); //Serial.print(temperatureC); //Serial.print("\n");

delay(10000); }

I commented out the temperature printing lines to avoid the error being in the conversion.

Leaving it run for a while I get the following

756.00
0.00
27.00
7.00
16.00
64.00
0.00
0.00
0.00
6.00
82.00
20.00
10.00
3.00
38.00
0.00
73.00
0.00
78.00
68.00
0.00
80.00
0.00
2.00
29.00
48.00
10.00
0.00
23.00
64.00
27.00
0.00
79.00
0.00
0.00
56.00
60.00
9.00
0.00
15.00
82.00
2.00
2.00
40.00
76.00
18.00
43.00
17.00
74.00
49.00
21.00
14.00
0.00
74.00
0.00
3.00
81.00
3.00
55.00
20.00
0.00
41.00
72.00
40.00
0.00
54.00
27.00

Our house is fairly stable in temperature, and the sensor is in a location out of anything which could drastically alter the temperature.

If anybody can suggest a reason for this I'd be grateful.

Mat
  • 464
  • 1
  • 4
  • 8
Andy_Smart
  • 11
  • 1

0 Answers0