Hi all. Just thought I would give a quick update on this project.
I have myself an Uno and a few components. For the temperature sensor I decided to go with a AD22100STZ. Its quite user friendly, it does all the linearisation on the chip so all I have to use is an equation given by the manufacturer on the data-sheet. I get about 0.2 DegC sensitivity due to the -50 to 150 and 10bit ADC ranges. I have here a quite precise stand alone temperature probe that I am going to carry out some comparison tests with which I will post when I have the results. I may be able to tweak the equation to get better accuracy.
The code is coming along nicely with some variable integer and floats. I am communicating and printing through the serial port. I have some if statements based on my required temperature setpoints which are currently just controlling a digital output which I will soon change to a PWM output to my servomotor which I just need to sort a power supply out for.
//temperature readout code
int outputpin = 13;
int inputpin = 1;
int inputmemory = 0; //use for the serial read
float tempout = 0; //use for temperature out
float setpointhigh = 26.00; //high temperature setpoint
float setpointlow = 25.00; //low temperature setpoint
inputmemory = analogRead(inputpin); //read analogue pin on pin 1
tempout = ((inputmemory*(5.0 / 1024))- 1.375) / 0.0225;
Serial.print ("Temperature: ");
Serial.println(tempout); //print temperature value to serial
Serial.print ("ADC value: ");
Serial.println(inputmemory); //print ADC value to serial
if (tempout >= setpointhigh) digitalWrite(outputpin, HIGH); //high setpoint
if (tempout <= setpointlow) digitalWrite(outputpin, LOW); //low setpoint
delay(1000); //delay 1 second before next read
The forum is rubbish for uploading pictures so I will also be doing a blog over at http://partecsolutions.blogspot.co.uk/ if you want to check that out.
Any constructive criticism would be cool so just drop a message on here!