I did built one version of the controller using Delphi and the LabJack. And cooked a few meals with it. But, as I said in my last post Barbara didn’t appreciate the cord having to be hooked up each time you wanted to use the oven. She had some idea that you should be able to walk up to it, hit a button or turn a knob and it should cook.

So the Arduino version 1 was made. I had some solid state controllers from way back when. They were 25 amp on the output, 3-5vdc on the input. Perfect. Using the Arduino system I made a program that would bring the oven to 325 in convection bake mode. It worked pretty good. The temp on fast a thermocouple moves up and down about 10-15 degrees but the oven thermometers read steadily.

I then expanded the circuit and added a resistor ladder switch network with 5 switches. Took a florescent readout I had and hooked that up. Here are it’s features in this version:
If the oven is off, after a few minutes shut the display off so we don’t get screen burn in. Any time a switch is pressed in this mode the screen turns on to the main menu.
The main menu has one switch for turning it on. And a couple to turn the oven light on and off in case we want to use it as a night light. I’m not sure why we would, but I the switches and the light and why not.

Once the oven is turned on it goes to the last temp that it was set for. I will probably change this to go to no temp yet unless you tell it too in case it was on a real high temp the last time, you may not want that the next time.

I’m not home right now so i don’t have the code handy to publish but I’ll describe the circuit then publish it when I can get online and get it.

The circuit is wired so the original oven probe is to a divider network and the output hooked to one of the analog inputs on the Arduino. Another divider and analog input is wired to the meat probe. The digital outputs are wired to:
1 – Case Fan
2 – Convection fan low (bake mode)
3 – Convention fan high (roast mode)
4 – Broiler element
5 – Bake (lower) element
6 – Oven Light

Things I didn’t hook up yet but will:
A – Door Lock (for cleaning)
B – Door lock feedback
C – Door open/closed switch

After I got a preliminary program going I would set the target reading I wanted from the oven temp and have it cycle the element off and on as needed. I found building in a bit a hysteresis helped. What’s nice is the solid state controllers switch on and off at zero crossing so there’s not a ton of electrical noise generated.

I went through a bunch of steps and ended up with an array of temps vs probe readings. So know you can use the up down switches to set the temp you want and it goes to that temp and stays there. I also added in a feature that if the temp wanted was x above the current temp it turns on both the top and bottom elements. This gets it up to temp very quickly but I do need to check what the broiling affect will be on various things that I’m cooking. For example it may brown the top of cake – not exactly what you want.

I have one of the buttons as a “Quick On” button – you press that and it presets the temp to 325′ convection bake. That is used probably 80% of the time. The other button brings up a Mode menu. From there you can pick bake, broil, conv bake or conv roast.

Next steps are to make a front panel and mount the switches and readout. That way amazingly enough you’ll be able to walk up, touch a button and have an oven that will cook something. What a novel idea!
And of course I have to add a self cleaning cycle. I did write one but it’s not integrated into the regular program yet.

One button makes the temp go up a step, one goes down a step.

<code>
#include #include </code>

const int numRows = 2;
const int numCols = 16;
LiquidCrystal lcd(3, 2, 7, 6, 5, 4);

const int switchPin = A1; // select the input pin for the switch ladder
const int bakeHeaterPin = 8; // bakeing element
const int broilHeaterPin = 9; // broil element
const int caseFanPin = 10; // oven box fan
const int caseFanOnTemp = 622; // temp box fan comes on
const int convLowFanOnPin = 11; // convection low speed fan pin low
const int convHighFanOnPin = 12; // convection high speed fan pin low
const int ovenLight = 13; // oven light
const int ovenSpeaker = 1;
const int inTempPin = A0;
const int probeTempPin = A2;
const int tempDiff = 0;
// switches
const int moveUp = 1;
const int moveDown = 2;
const int quickSet = 3;
const int mode = 4;
const int onOff = 5;
const int debug = 0; // debug 1= on

// states
const int on = 1;
const int up = 1;
const int off = 0;
const int down = 0;
const int switchModeTemp = 1; // change temp
const int switchModeMode = 2; // change conv, bake, clean …

int switchValue = 0;
int targetTemp = 100;
int quickTempIndex = 20;
int offOrOn = 0; // offOrOn
int inTemp = 0;
int probeTemp = 0;
int isConv = 1; // convection usually
int isBroil = 0; // is it Broil ?
int isClean = 0; // is it Clean ?
int switchMode = switchModeTemp; //
enum state { CONVBAKE, CONVROAST, BAKE, BROIL };
int whatState;
const char* stateNames[] = {“CNVBAK”, “CNVRST”, “BAK “, “BRL “};
unsigned long modeTime;
const int modeWaitTime = 3000; // if no mode touch in 3 secs, go to temp
int wasASwitch = 1;
const unsigned long displayTimeToBeOn = 15000; // if not switch in this time, go to display wait mode
unsigned long timeIsNow = 0;
unsigned long displayTurnedOn = millis();

int maxTemps = 31;
// 0 1, 2, 3, 4, 5, 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
int reading[31] = {100,550,568,572,577,582,587,592,597,602,607,612,617,622,627,632,602,612,617,627,632,637,642,647,652,662,667,672,677,682,707};
int temps[31] = { 40,100,145,155,160,155,160,165,170,175,180,185,190,195,200,205,210,270,275,320,325,350,360,375,400,430,460,475,500,525,550};
int realTemp = 0;
int actualTemp = 0;
int tempIndex = 0;

int myTime = 2;
int myTimeMax = 8;
int myTimeDirection = 0; // 0 is going up, 1 is going down
int myTimeOn = 1;

void clearScreen() {
lcd.setCursor(0,0);
lcd.print(” “);
lcd.setCursor(0,1);
lcd.print(” “);
}

int showOffScreen() {
clearScreen();
lcd.setCursor(0,0);
lcd.print(“To turn oven on”);
lcd.setCursor(0,1);
lcd.print(“press RIGHT button”);
}

void beep(int howmany) {
while (howmany) {
digitalWrite(ovenSpeaker, HIGH);
delay(200);
digitalWrite(ovenSpeaker, LOW);
delay(200);
howmany = howmany – 1;
}
}

void showOnScreen() {
lcd.begin(numCols,numRows);
lcd.setCursor(15,0);
lcd.print(“Oven”);
lcd.setCursor(16,1);
lcd.print(“ON”);

lcd.setCursor(2,0);
lcd.print(“Light”);
lcd.setCursor(0,1);
lcd.print(“ON”);
lcd.setCursor(5,1);
lcd.print(“OFF”);
beep(3);
}

void shouldDisplayBeOn() {
if ((offOrOn == on) or (wasASwitch == 1)) {
displayTurnedOn = millis();
lcd.display();
} else {
timeIsNow = millis();
if (timeIsNow – displayTurnedOn > displayTimeToBeOn ){
lcd.noDisplay();
} else {
lcd.display();
}
}
}

void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ovenSpeaker, OUTPUT);
digitalWrite(ovenSpeaker, LOW);
pinMode(bakeHeaterPin, OUTPUT);
digitalWrite(bakeHeaterPin, LOW);
pinMode(broilHeaterPin, OUTPUT);
digitalWrite(broilHeaterPin, LOW);
pinMode(caseFanPin, OUTPUT);
digitalWrite(caseFanPin, LOW);
pinMode(convLowFanOnPin, OUTPUT);
digitalWrite(convLowFanOnPin, LOW);
pinMode(convHighFanOnPin, OUTPUT);
digitalWrite(convHighFanOnPin, LOW);
pinMode(ovenLight, OUTPUT);
digitalWrite(ovenLight, LOW);

lcd.begin(numCols,numRows);
showOffScreen();
}

int whichSwitch() {
switchValue = analogRead(switchPin);
if (switchValue < 20) { wasASwitch = 1; return moveUp; } else if ( (switchValue>505) && ( switchValue640) && ( switchValue670) && ( switchValue690) && ( switchValue BROIL) {
whatState = CONVBAKE;
}
} else{
whatState–;
if (whatState < CONVBAKE) {
whatState = BROIL;
}
}
}

void checkCaseFan() {
if (inTemp < (caseFanOnTemp-6)) { digitalWrite(caseFanPin, LOW); } if (inTemp > (caseFanOnTemp)){
digitalWrite(caseFanPin, HIGH);
}
}

void loop() {
switchValue = analogRead(switchPin);
switchValue = whichSwitch();
// lcd.setCursor(5,1);
// lcd.print(switchValue);

if (switchValue == mode) {
modeTime = millis();
if (switchMode == switchModeTemp) {
switchMode = switchModeMode;
} else {
switchMode = switchModeTemp;
}
}

if (switchValue == onOff) { // is it the on off switch ?
lcd.setCursor(1,1);
if (offOrOn == on) { // if oven is on, turn the oven off
// lcd.display();
offOrOn = off;
lcd.print(“OFF”);
digitalWrite(bakeHeaterPin, LOW);
digitalWrite(broilHeaterPin, LOW);
digitalWrite(convHighFanOnPin, LOW);
digitalWrite(convLowFanOnPin, LOW);
digitalWrite(ovenLight, LOW); // light is off if oven is off
whatState = CONVBAKE;
showOffScreen();
} else {
offOrOn = on;
digitalWrite(ovenLight, HIGH); // light is on while oven is on
clearScreen();
lcd.print(“ON”);
}
delay(100);
}

if (offOrOn == off) { // if oven is off
if (switchValue == moveUp) {
digitalWrite(ovenLight, HIGH);
}
if (switchValue == moveDown) {
digitalWrite(ovenLight, LOW);
}
inTemp = analogRead(inTempPin);
shouldDisplayBeOn();
}

if (offOrOn == on) { // if oven is on
shouldDisplayBeOn();
lcd.setCursor(0,0);
lcd.print(“Temp: “);
lcd.setCursor(5,0);
lcd.print(realTemp);
#if 1
if (switchValue == moveUp) {
if (switchMode == switchModeTemp) {
if (tempIndex < (maxTemps-1)) { tempIndex = tempIndex + 1; } } if (switchMode == switchModeMode) { changeMode(1); } if (modeTime != 0) { modeTime = millis(); } } if (switchValue == moveDown) { if (switchMode == switchModeTemp) { if (tempIndex > 0) {
tempIndex = tempIndex -1;
}
}
if (switchMode == switchModeMode) {
changeMode(0);
}
if (modeTime != 0) {
modeTime = millis();
}
}
if (switchValue == quickSet) {
tempIndex = quickTempIndex;
delay(500);
}

targetTemp = reading[tempIndex];
realTemp = temps[tempIndex];

#else

if (switchValue == moveUp) {
targetTemp = targetTemp + 1;
}
if (switchValue == moveDown) {
targetTemp = targetTemp – 1;
}
realTemp = targetTemp;

#endif

inTemp = analogRead(inTempPin);
actualTemp = inTemp;
int i = 0;
while (reading[i] < inTemp) {
// actualTemp = temps[i];
i = i + 1;
}
// lcd.setCursor(5,0);
// lcd.print(“A:”);
// lcd.setCursor(7,0);
// lcd.print(actualTemp);
// lcd.setCursor(12,0);
// lcd.print(“T: “);
// lcd.setCursor(14,0);
// lcd.print(targetTemp);
// delay(250);
// probeTemp = analogRead(probeTempPin);
// lcd.setCursor(0,1);
// lcd.print(“P: “);
// lcd.setCursor(2,1);
// lcd.print(probeTemp);
// lcd.print(temps[i]);
if (whatState == CONVBAKE) {
digitalWrite(convLowFanOnPin, HIGH);
} else {
digitalWrite(convLowFanOnPin, LOW);
}
if (whatState == CONVROAST) {
digitalWrite(convHighFanOnPin, HIGH);
} else {
digitalWrite(convHighFanOnPin, LOW);
}
if ((inTemp+2) < targetTemp) { if (whatState == BROIL) { digitalWrite(broilHeaterPin, HIGH); digitalWrite(bakeHeaterPin, LOW); lcd.setCursor(18,0); lcd.print(“-“); } else if (whatState == BAKE) { digitalWrite(broilHeaterPin, LOW); digitalWrite(bakeHeaterPin, HIGH); lcd.setCursor(18,0); lcd.print(“-“); } else if (whatState == CONVBAKE) { digitalWrite(bakeHeaterPin, HIGH); if (targetTemp > (reading[i] + tempDiff)) {
digitalWrite(broilHeaterPin, HIGH);
lcd.setCursor(18,0);
lcd.print(“=”);
} else {
digitalWrite(broilHeaterPin, LOW);
lcd.setCursor(18,0);
lcd.print(“-“);
}
} else if (whatState == CONVROAST) {
digitalWrite(bakeHeaterPin, HIGH);
if (targetTemp > (reading[i] + tempDiff)) {
digitalWrite(broilHeaterPin, HIGH);
lcd.setCursor(18,0);
lcd.print(“=”);
} else {
digitalWrite(broilHeaterPin, LOW);
lcd.setCursor(18,0);
lcd.print(“=”);
}
} else { // should never get here
digitalWrite(broilHeaterPin, LOW);
digitalWrite(bakeHeaterPin, LOW);
lcd.setCursor(18,0);
lcd.print(“_”);
}
} else {
lcd.setCursor(18,0);
lcd.print(“_”);
digitalWrite(broilHeaterPin, LOW);
digitalWrite(bakeHeaterPin, LOW);
}

lcd.setCursor(12,0);
lcd.print(stateNames[whatState]);
lcd.setCursor(0,1);
if (switchMode == switchModeTemp) {
lcd.print(“up dwn Qik mode off”);
}
if (switchMode == switchModeMode) {
lcd.print(“Set Mode”);
}
}
checkCaseFan();
switchValue = 0;
delay(250);
}