Here's a graph of my temperature curve and stability at 130 degrees over about 4 hours. If you look closely you can see that upon reaching 130, it actually only needed to kick on the heat for 30 seconds about once an hour. The average temperature over the whole 4 hour run was 130.7 degrees. That's pretty damn cool, if you ask me. Click on it for a larger version.
Alright, without further ado, in the spirit of open source, here's my code. No PID control on this one, that's my Steve Jobs code, so I won't be sharing it. But as the graph above shows, this version works pretty well. Also, it includes a pretty handy serial out so you can data log the temperature as you go.
Control the temperature of a Sous-Vide Cooker. Set the temperature and minimum cook time in this program.
The circuit:
* Digital Pin 13 controls the relay for the heating element.
* Digial Pin 12 is the heating element status indicator LED.
* Digital Pin 11 controls the relay for the circulating fan.
* Digital Pin 10 is the circulating fan indicator LED.
* Analog Input Pin A0 is the first LM34 temperature sensor.
* Analog Input Pin A1 is the second LM34 temperature sensor.
* Note: This is an extremely simple temperature controller. For PID temperature control, look elsewhere. Perhaps v2.0.
Created 19 Sept 2010
By Alex Waller
http://abstractedengineer.blogspot.com/2010/09/arduino-projects-1-sous-vide-cooking.html
*/
const int HeatingRelay = 13; // 5V input to AC relay controlling heating element
const int HeatingLED = 12; // LED indicating AC relay is closed
const int CircFan = 11; // 5V input to AC relay controlling circulating fan
const int CircFanLED = 10; // LED indicating AC relay is closed
int sensor1Pin = 0; // Set pin for LM34 Sensor 1
int val1 = 0; // Value 1 from LM34 Sensor 1
int sensor2Pin = 1; // Set pin for LM34 Sensor 2
int val2 = 0; // Value 2 from LM34 Sensor 2
double val3 = 0; // This is the average value of val 1 and val 2
float Temp = 130; // THIS IS WHERE YOU PICK YOUR SET TEMPERATURE
int Time = 24; //THIS IS THE NUMBER OF HOURS YOU WANT TO RUN AT SET TEMP
float DigitalTemp = Temp; //This is the initial value that will be replaced by the calc later
int RunTime = 0;
int OnTime = Time * 60;
void setup() {
// initialize the digital pins as an output:
pinMode(HeatingRelay, OUTPUT);
pinMode(HeatingLED, OUTPUT);
pinMode(CircFan, OUTPUT);
pinMode(CircFanLED, OUTPUT);
Serial.begin(9600);
}
void loop()
{
while (RunTime < OnTime)
{
val1 = analogRead(sensor1Pin);
val2 = analogRead(sensor2Pin);
val3 = (val1 + val2) / 2 *.48828125;
if (val3 < DigitalTemp)
{
digitalWrite(HeatingRelay, HIGH);
digitalWrite(HeatingLED, HIGH);
digitalWrite(CircFan, HIGH);
digitalWrite(CircFanLED, HIGH);
Serial.print(DigitalTemp, DEC);
Serial.print("\t");
Serial.println(val3, DEC);
delay(60000);
}
else if ( val3 >= DigitalTemp)
{
digitalWrite(HeatingRelay, LOW);
digitalWrite(HeatingLED, LOW);
digitalWrite(CircFan, LOW);
digitalWrite(CircFanLED, LOW);
Serial.print(DigitalTemp, DEC);
Serial.print("\t");
Serial.println(val3, DEC);
delay(30000);
}
}
RunTime++;
}
Good luck to you!
Recipes and images of cooked food to come.
_
Sunday, 17 April 2011
TAE's DIY Arduino Sous Vide Cooker - Part V: The Software
Posted on 13:33 by hony
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment