Controling the temperature of an oven

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!

Moderator: phalanx

Post Reply
arduino_user123
Posts: 1
Joined: Mon Sep 24, 2018 8:43 am

Controling the temperature of an oven

Post by arduino_user123 » Mon Sep 24, 2018 9:25 am

Hello guys,



I need to write a code for Arduino that controls the temperature of an oven by a certain way.The idea is that the temperature must increase for every 1 minute with 3 degrees and all of that by using a thermocouple, zero-cross detector and the MAX31855 sensor. The temperature increase begins from 20 degrees and when it reaches 200 degrees it must stop.
I will be very thankful if you can help me. I have wrote some code already by searching in the internet but
i'm struggling with the 3 degree part. Thanks one more time in advance.

teprojects1
Posts: 53
Joined: Sat Jan 21, 2017 1:28 am
Location: Lahore
Contact:

Re: Controling the temperature of an oven

Post by teprojects1 » Fri Sep 28, 2018 10:45 pm

Hi,

It's not that difficult, you just need to place a check in multiples of 3 , and after 3 hours you can increment a variable 1 time. If you could share your code then I can better help you out.

Thanks.

lyndon
Support Volunteer
Posts: 1629
Joined: Thu Jul 17, 2008 6:37 pm
Location: Minnesota, USA

Re: Controling the temperature of an oven

Post by lyndon » Sat Sep 29, 2018 9:04 am

Assuming you already have code for basic temperature control, what you need to do is maintain a timer, and every 60 seconds, increase the setpoint by 3 degrees.
e.g.,

Code: Select all

int time = 0;
int setpoint = 20;

// Update loop every 0.1 seconds
const int TIME_INCREMENT = 100;
const int TIME_LIMIT = 20 * 60 * 10;
const int TEMP_LIMIT = 200;

while (time < TIME_LIMIT && setpoint <= TEMP_LIMIT)
{
  time += TIME_INCREMENT;
  if (timer % (60 * 1000) == 0)
  {
    setpoint += 3;
    // Assume your temperature control routine returns current temperature
    temp = controlTemperature(setpoint);
  }
}
...

At this point you can resume calling your temperature control routine periodically.
This should work. Untested, of course. If you want known good, working code, I write Arduino code as a service, in addition to on-demand assistance here: http://www.cedarlakeinstruments.com/blog/

Post Reply