readAnalod does not correspond with Voltage

Hello everybody,

I have a Arduino Nano wich I want to use as a Temperature Controller. i use a LM335 Temp. Sensor with a 1mA current source made of a LM334. The sensor is mounted on a aluminium block together with an heating-resistor and a Fluke 179 Multimeter measuring the Temperatur of the Aluminium. The analog part of the project works fine. Pin 11 swiches a BUZ21 that controlles the heating resistor.

I heat the Alu to a Temperatur of 57°C (measured with the Fluke 179). The Voltage of the LM335 is 3,287 wich means 3,287/0,01-273,15=55,55°C. That is not very good but OK.

But my internal threshold for my is 694. 5/1024*694=3,38V. If the LM335 would have this Voltage it would be 3,38V/0,01-273,15=65°C.

I hope you can help me.

Here's my code.

int sensorPin = A1;    // select the input pin for the LM335
int heatPin = 11;      // select the pin for the Heater
int sensorValue = 0;  // variable to store the value coming from the sensor
int thresh = 694; //Threshold for the "Controller"

void setup() {
  // declare the heatPin as an OUTPUT:
  pinMode(heatPin, OUTPUT);  
}

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead( sensorPin );


  if(sensorValue <= thresh)
{
  digitalWrite(heatPin, HIGH);
}
else
{
  digitalWrite(heatPin, LOW);
}

}

What is your question?

You mean it should be ~ 674 ? Error approx. 100 mV ?
Try to "average" your reading, taking 10 or more measurements, sum them up and divide by number 10.

MUltiple analog readings will help, I second that,

Furthermore you might need the use of the AREF pin, see - analogReference() - Arduino Reference -

Measure the 5V supply on the Nano to make sure it is 5.0V?