Pages: [1] 2   Go Down
Author Topic: Reflow Oven Controller  (Read 3511 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26951
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Gang,
Any reason to expect this design, which intends to replace Sparkfun's PIC with a '328P instead, will not work?
Not shown is AC power box, relay will interrupt the "hot line".
Had some extra pins, used them to control all 8 data bits in a common 16x2 LCD display vs just controlling 4.
Power from 5V wallwart.
ICSP for bootloading and or program loading.
CP2102 for outputting data to PC during debugging. Maybe for data logging.

Thanks


* thermal_control.jpg (83.11 KB, 960x720 - viewed 222 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Full Member
***
Karma: 5
Posts: 234
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think it looks good but you may want to have some additional LED's on the front panel, like one that goes on when the relay for the heater is turned on.  I built a large oven for baking guns and I wired in a 110V pilot light to show when it was heating maybe another one showing the temp is when a threshold of the programmed temp, ect.

wade
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26951
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I'v made a note to add 2 more LEDs.
One will go on when transistor is driven to turn on the relay.
One will go on when ...
And the Status LED will go on when ...
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

California
Offline Offline
God Member
*****
Karma: 14
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I would recommend an interlock circuit of some variety.  Something available to monitor the stupid things people do, that could cause harm.  I assume the digitals are assigned to UP/DOWN/SELECT and RESET.  I see A4 available, but I sense that you have a future capability on that one.  Is there a way to multiplex momentary buttons onto one digital?

Other than that, it looks great!
Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26951
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Right now, A4 was just assigned to drive another LED for status. I'll connect an LED to A3 that will go on when the relay is driven.
Tho it dawns on me - I'll have an LCD display - maybe have the Status LED blink as an attention getter to indicate one should go read the screen.

Then I can  have A4 back again.
What would the interlock do, and/or connect to, to do somethig that the software wouldn't do already as part of controlling the relay, and turning off the relay if the temperature got too hot?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26951
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here we go, all nice & eagle'ized.
Just need to find a nice AC relay, pick a transistor for it, and find the symbols for AC power cord & socket.

Coding - got no time for that! This was mostly all done in another design already, really just added the AD595 and the LCD.


* thermal_controller.png (10.37 KB, 1071x540 - viewed 151 times.)
« Last Edit: September 19, 2012, 02:08:46 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2512
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What would the interlock do, and/or connect to, to do somethig that the software wouldn't do already as part of controlling the relay, and turning off the relay if the temperature got too hot?
I would assume the interlock would be to determine if oven door is open/closed so you don't turn on the heater if door is open.

You could reclaim 4 pins back (if needed) by using 4 bit data bus to LCD instead of 8 bit.
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26951
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Door open test - that could be pain to rig up a switch for that. Maybe just have the user acknowledge the door is closed via the LDC/buttons before starting a cycle up.
Maybe have "open door now" message for cooling at the end, and "safe to remove" once internal temp has cooled enough.

We manually soldered a board up last week. First we checked out the oven: Thermocouple in old (ancient) 4 element toaster over, fork holding it in place, feeding a multimeter.
Turned it on full, watched how long to get to ~180C for pre-soak, turning down the heat until we heard bi-metallic switch close, then cranking it back full on to get to ~230 for solder reflow phase, turned it down when it got near 240, watched for a minute, then dialed it off again. When the temp got down to 180 again we opened the door to let it cool faster.
Seeing that we had a process that seemed to work, we loaded up a board and tried it. Seemed  to go okay - I have a working board, and we're going to try some more as soon as regulators are delivered (right package, wrong pinout).  Not sure I'll have the controller built up (wirewrap for a test) or coded first, so the next set of boards will likely be manually processed as well.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Door open test - that could be pain to rig up a switch for that.

For just detection (as opposed to having a physical locking system), where's the potential pain in using a reed switch?  Depending upon the exact model of counter-top oven you plan on using, there might even be one already in place to control an interior light or some such.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26951
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The toaster I'm using now has no lights. The thing is ancient.
You think like maybe put  magnet on the door handle, with reed swithc nearby, 2 wires back to the controller? That could be doable.

I was going thru the AD595 datasheet,  Table I on page 3 for the AD595 Output mV, thinking about how to get a temperature reading, interpolatng the data opr something.
Put the data for the range of interest, 0C to 300C, in excel.
Made a column to reflect internal ADC reading for the mV readings - and notived that the ADC reading were just about 2X the actual mV.
Plotted that out, tweaked it a little at the end, and got these results.
So could my conversion that I want to display & use for control decisions with be as simple as this?
Code:
AD595output = analogRead (temperaturePin);
if (AD595output<160)
{temperature = AD595output>>1; // divide by 2
else
{temperature = (AD595output>>1)-5}; // divide by 2, subtract 5
with the areas of greatest interest being:
preheat/soak at 150C to 180C,
reflow from 210C to 225C,
not to exceed of 255C.
temps from Kester Easy Profile 256 datasheet

* ADC-temp-conversion.pdf (109.39 KB - downloaded 34 times.)
* EP256_Global_(21Sep09)[1].pdf (51.35 KB - downloaded 23 times.)
* AD594_595.pdf (136.68 KB - downloaded 19 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You think like maybe put  magnet on the door handle, with reed swithc nearby, 2 wires back to the controller? That could be doable.

Yeah, you've got the idea.  Although it really doesn't matter if the reed switch or the magnet is the part that moves with the door, as long as the magnet is close enough to engage the switch when the oven door is shut.  I'd just go with whatever configuration that is easiest to implement.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26951
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How's this look for control code so far?
Code:
/* Code for thermal controller
 Turn on relay to turn on heat element, off for off.
 > LED on relay shows relay commanded state and that transistor is working
 
 AD595 with Type K thermocouple
 LCD screen for visual feedback. (not added yet)
 LED on D13 for status, attention getter? "Go read the screen"
 3 buttons for user input - only Start implemented so far
 CP2102 module to Rx/Tx for code download, or feedback to PC for future datalogging
 */
// define IO used
byte button0 = 2; // low = on  Start/Select
byte button1 = 3; // low = on  Temp Up
byte button2 = 4; // low = on  Temp Down
byte LCDpins[8] = {
  5, 6, 7, 8, 9, 10, 11, 12}; // array of data pins, 5 = LSB, 12 = MSB
byte statusLED = 13; // high = on
byte LCD_E = 14;
byte LCD_RW = 15;
byte LCD_RS = 16;
byte relay = 17;  // high = on
byte free18 = 18;
byte temperaturePin = A5; // AD595 output
// define variables
int AD595output; // mV, from 0.003 to 3.022
// resulting ADC reading are from 1 to 618
// correlation: ADCreading/2 = tempC below readings <160
// correlation: (ADCreading/2)-5 =tempC for reading >=160
// define the the stages to go thru:
int temperature;
byte thermalStage = 0;  // state machine variables
byte ovenoff = 0;
byte preheatRamp = 1;
byte preheat = 2;
byte preflowRamp=3;
byte reflow=4;
byte cooldown = 5;
byte running = 0;
// time variables
unsigned long preheatRampStartTime;  // display times, not added yet
unsigned long lastTempTime;
unsigned long preheatStartTime;
unsigned long preheatDuration = 60000;  // make longer, up to 120 seconds
unsigned long reflowStartTime;
unsigned long reflowDuration = 30000;

void setup(){
  pinMode (button0, INPUT);  // input with internal pullup enabled
  digitalWrite (button0, HIGH);
  pinMode (button1,  INPUT); // input with internal pullup enabled
  digitalWrite (button1, HIGH);
  pinMode (button2, INPUT); // input with internal pullup enabled
  digitalWrite (button2, HIGH);

  for (byte x = 0; x<8; x=x+1){
    pinMode (LCDpins[x], OUTPUT); // LCD data pins as outputs
  } 
  pinMode (statusLED, OUTPUT);
  pinMode (LCD_E, OUTPUT); // set hi or low to start?
  pinMode (LCD_RW, OUTPUT); // set hi or low to start?
  pinMode (LCD_RS, OUTPUT); // set hi or low to start?
  pinMode (relay, OUTPUT); // leave low to start
  pinMode (free18, INPUT); // input with pullup for now - turn into door open test?
  digitalWrite (free18, HIGH);

  Serial.begin(9600); // serial output for debugging

  AD595output = analogRead (temperaturePin);
  if (AD595output<160){
    temperature = AD595output>>1; // divide by 2
  }
  else {
    temperature = (AD595output>>1)-5; // divide by 2, subtract 5
  }
  Serial.print ("Start Temperature = ");
  Serial.println (temperature);
} // end setup

void loop(){
  /* start with running predetermined profile
   Go from Room Temp to Preheat, 150-180C
   Hold Preheat for 30-60 seconds
   Go to Liquid/Flow temperature, 210-225C.. DO NOT EXCEED 255
   Hold Liquid/Flow temperature 30 seconds
   Ramp down
   */
  // not running, not started, show ambient temp
  if (running == 0 && digitalRead (button0 == 1)){
    AD595output = analogRead (temperaturePin);
    if (AD595output<160){
      temperature = AD595output>>1;
    } // divide by 2
    else {
      temperature = (AD595output>>1)-5;
    } // divide by 2, subtract 5
    if ( (millis() - lastTempTime) >=500){
      lastTempTime = millis();
      Serial.print ("static temperature = ");
      Serial.print (temperature);
    }
  }
  // startup if Not running & Start button is pushed
  if (running == 0 &&  digitalRead(button0) == 0){
    preheatRampStartTime = preheatRampStartTime + 500;
    thermalStage = preheatRamp;
    running = 1;
    digitalWrite (statusLED, HIGH);
    Serial.println ("preheat Ramp starting ");
  }
  if (running == 1){
    // record the temperature
    AD595output = analogRead (temperaturePin);
    if (AD595output<160){
      temperature = AD595output>>1;
    } // divide by 2
    else {
      temperature = (AD595output>>1)-5;
    } // divide by 2, subtract 5
    if ( (millis() - lastTempTime) >=500){
      lastTempTime = lastTempTime+500;
      Serial.print ("loop temperature = ");
      Serial.print (temperature);
    }
  }
  // ********************************
  switch(thermalStage){
    /*
thermalStage's:
     ovenoff = 0;
     preheatRamp = 1;
     preheat = 2;
     preflowRamp=3;
     reflow=4;
     cooldown = 5;
     */
  case 0: //ovenoff:
    digitalWrite (relay,  0);
    break;
    // ********************************
  case 1: // preheatRamp:
    if (temperature <=145){
      // keep ramping up
      digitalWrite (relay,  1);
    }
    if (temperature >145 && temperature <170){
      preheatStartTime = millis();
      preheatRampStartTime = preheatStartTime;
      Serial.println("preheat starting ");
      thermalStage = preheat;
      digitalWrite (relay,  0); // let next stage turn on if needed
      break;
      // ********************************
    case 2: // preheat:
      if (millis() - preheatStartTime <=preheatDuration){
        if (temperature <170){
          digitalWrite (relay,  1);
        }
        else {
          digitalWrite (relay,  0);
        }
      }
      else {
        thermalStage = preflowRamp;
        digitalWrite (relay,  1); // ramping up!
        Serial.println("preflow rampup starting ");
      }
      break;
      // ********************************
    case 3: // preflowRamp:
      if (temperature <=200){
        // keep ramping up
        digitalWrite (relay,  1);  // ramping up!
      }
      if (temperature >200 && temperature <220){
        reflowStartTime = millis();
        thermalStage = reflow;
        digitalWrite (relay,  0); // let next stage turn on if needed
        Serial.println("Reflow starting ");
      }
      break;
      // ********************************
    case 4: // reflow:
      if (millis() - reflowStartTime <=reflowDuration){
        if (temperature <220){
          digitalWrite (relay,  1);
        }
        else {
          digitalWrite (relay,  0);
        }
      }
      else {
        thermalStage = cooldown;
        digitalWrite (relay,  0); // cooling down!
        Serial.println("cooldown starting ");
      }
      break;
      // ********************************
    case 5: // cooldown:
      digitalWrite (relay,  0);
      if (temperature <180){
        Serial.println ("Safe to open door - Caution! HOT!");
        thermalStage = ovenoff;
        running = 0;
        digitalWrite (statusLED, LOW);
      }
      break;
    } // end switch thermalstage
  } // end if running
} // end void loop
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6146
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

PID Code I am using based on the work from Rocket Scream, plus some other info on the controller I'm working with.

http://www.cmiyc.com/tutorials/reflow-oven/
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26951
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks. I like the check for a missing thermocouple.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it's a while since you posted
how did the oven project go?

I noticed that the code seemed ramp up at whatever speed the oven would go
rather than attempting any sort of temperature profile
does that work ok?

I'm looking at building something similar
hence my interest

I also noticed that the AD595 suggests a couple of capacitors on the compensation pin
does yours work ok without?

cheers
Mike
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Pages: [1] 2   Go Up
Jump to: