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);
}
}