# Controling the temperature of an oven

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.

You forgot the description of the oven in the project. How is it powered, how do you intend to control the power, if that is how you intend to control the temperature?

Paul

It's for a project and i dont know the type of the oven for the moment. I must play with the zero-cross detector in order to give the exactly amount of power for each sine period to the oven so it can increase every minute with 3 degrees.

arduino_user123: It's for a project and i dont know the type of the oven for the moment. I must play with the zero-cross detector in order to give the exactly amount of power for each sine period to the oven so it can increase every minute with 3 degrees.

Are you telling us you don't know if the oven is gas or electric? IF electric, how are you intending to control the power to the oven? How will the zero-cross detector have anything to do with powering the oven?

Perhaps drawing a block diagram of your set up would help us both understand what you have there.

Paul

Its an electric one. I’m attaching the block diagram.

Schematics.PDF (37.2 KB)

Nicely done schematic.

Forget the 3 degrees per minute problem for now. You don't even know if your oven can do that. That is part of fine tuning that is done after all the other processes are working.

Your initial problem will be getting the oven to heat evenly over time. Determine how the temperature increases with just one element, then two, then all three.

In all your temperature measurements, the actual temperature will NOT initially change when you apply power to the heating elements. And the temperature will continue to increase after the power is stopped. This is not something you can determine before actually getting it working. You will have to try while measuring, change something and try again.

Good luck! I did sort of the same thing converting a very old drying oven to Arduino control.

Paul

It’s VERY rare to use phase control with a heater… Heat can’t change instantly so heating (and cooling) systems usually simply cycle on & off.*

for every 1 minute with 3 degrees…

…i’m struggling with the 3 degree part.

It’s not much different from a normal heater… Normally you know the target temperature and the actual temperature so you know if you should be applying more heat or not…

In this case you need to know the target temperature at the current time (and the current actual temperature).

OK, that’s 0.05 degrees per second.

So between t0 and t1 you should be at 20.05 degrees. If you’re below-target, turn the heat on, and turn it off when you hit the target, then back-on again if the temperature falls (unlikely in 1 second).

Between t1 and t2 you should be at 20.1 degrees. Turn it on if you are below target and on if you are below… etc…

(It might be more practical to work in 5 or 10 second intervals.)

• In the real world there is usually a target range (technically hysteresis) so your air conditioning doesn’t cycle on & off several times per second.

Thank you guys very much for the help. This is the code that i'm trying do modify to my project

https://github.com/engineertype/MAX31855/commit/ac83dd8d761a79203e08e7365d8b8933cc1d17df

arduino_user123: Thank you guys very much for the help. This is the code that i'm trying do modify to my project

https://github.com/engineertype/MAX31855/commit/ac83dd8d761a79203e08e7365d8b8933cc1d17df

And are you getting reasonable values from that code?

Paul

I haven't yet tried to compile it. I think it needs more to be modified for my case. But it's still a reference or a basis :).

Please don’t follow so many other posters in writing a complete program and then decide to test it? Hopeless waste. Test each addition, no matter how small.

Paul

Interesting problem what class is this for what year are you in

veey well though out plan.

Put expected “load” in the over, stick temperature probe near load, turn on one heater circuit and time how long it takes to change one degree and how long to get to 200. Unplug the power to heater as it hits 200 and log how far past 200 it goes as well as how long the temperature takes to max out.

With those data points you can start to make some rough estimates.

I love the idea of a constantly updating PID setting loop inside a loop inside a loop..

Slumpert: veey well though out plan.

Put expected “load” in the over, stick temperature probe near load, turn on one heater circuit and time how long it takes to change one degree and how long to get to 200. Unplug the power to heater as it hits 200 and log how far past 200 it goes as well as how long the temperature takes to max out.

With those data points you can start to make some rough estimates.

I love the idea of a constantly updating PID setting loop inside a loop inside a loop..

Overshoot will definitely happen. I wonder if the professor created this assignment to have the student put together all the other information in the course so far ?

The heat will be delivered in joules. That should be measured as the reference for all testing and future use.

The oven should have a known heat loss, conduction, convection and radiant , each will increase with the differential temperature to the surrounding environment. the mass of the part will be the wild card. one should run the test as stated with an empty oven, then watch for the decay time as well. then perform a second test by cutting power before the ceiling temperature (by the overshoot temperature amount) so as to determine at what temperature the power should stopped to allow the natural overshoot to bring the temperature up to the magic number.

The rolling set-point seems to be developed from the theoretical curve for the stated project.

The empty over test would develop the curve on the empty oven. The first real reference.

Put in the part, run the test using the empty oven conditions and see the departure of the curve, develop a second curve for that part. bracket the parameters.

I think one thing overlooked is that air temperature in the oven must be higher than the part temperature. You might get to 1,000 degrees with the part being at 150 degrees. So the point is where you measure. A 1 pound cube of aluminum in a 300 degree environment will heat according to the properties of the part. Getting the skin of a part to temperature is not the same as getting the part core to temperature and wildly different than getting the oven to temperature.

This is why I as asking about what course this is for and what year. What is the real goal of the assignment ?

arduino_user123: 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.

arduino_user123: It's for a project and i dont know the type of the oven for the moment. I must play with the zero-cross detector in order to give the exactly amount of power for each sine period to the oven so it can increase every minute with 3 degrees.

I think you are leaving out part of the assignment. Measure the zero cross, no other need other than to connect the load without shock to the system. It has nothing to do with power and certainly no correlation to anything about heating. heat is measured by joules. If you add 100 joules to an oven and it increases from 20 degrees to 21 degrees, you have a point of reference.

but, what if you need 500 joules to increase 1 degree ? or 5,000 joules ?

By the way, the MAX31855 is a cold junction thermocouple to digital converter. the thermocouple is the sensor.

I've done something similar recently, and needed proper PID control for adequate handling of overshoot and response time. A circulating fan will make things more controllable and responsive.

If you merely intend to turn the heater on and off no zero crossing detection is required - a Triac or relay will sort that out by itself

Allan