Controlling the voltage into heating element

Hello I am currently working on a project using an Uno, RTD temperature sensor, relay, and 1500W heating element. The basics of it is the Arduino will read in a temperature from the RTD, and based on that reading will or will not send out 5V to the relay which will allow the heating element to start up. The heating element will be powered by a 120V GFCI outlet. This is all working just fine, however I am trying to hold the temperature for a long period of time with +- .5 degree F. What would be the best way to control the power to the heating element based on the temperature read of the RTD. What sort of electronics do I need and how to implement the Arduino PID library. Any point in the right direction would be greatly appreciated. Thanks.

When you say 1500W heating element, is it a water heater or a space heater? Are you using a solid state relay or a mechanical relay? WHAT are you trying to control? Air temperature or water temperature? What kind of temperature set point are you looking at maintaining?

There are a lot of great instructables/tutorials on doing pretty much exactly what you want to do. Here is a link.

The heating element in a bend to shape immersion heating element from mcmastercarr. I am using a mechanical relay, 20A 220V that switches over using the default output from the Arduino. I am looking to heat water (around 3 gal) to a certain temperature, can be anywhere from 130 F to boiling, and holding for an hour at a time. Buying a PID control kit is something that I am trying to avoid. I am trying to find a different way to control the input into the heating element. Maybe something like the way fans have different setting and lights have dimmers. I know these two elements use PWM. I am simply looking for ideas, electronics available, or anything that can point me in the right direction.

First thing to comment on is that +/- 0.5F (= 0.28C I think) is a very fine tolerance bearing in mind the Absolute temperature will be about 330K - hence you are expecting an accuracy of better than 1 part in a thousand. (Based on your low temperature of 130F (54C).

Second thing is that you haven't told us how well (or badly) your present system is working.

Third thing -- I didn't know what a PID was until I read Wikipedia. But the first few lines of the description surely suggest ways in which to use your software to improve performance based on present data, past performance and expected future errors.

Fourthly I suspect an RTD is rather slow to react. If so a faster acting sensor may give you better information. There are small (and simple and cheap) ICs that report the temperature as a voltage proportional to the temp but a thermocouple might be best as it responds in seconds.

And fifthly, your title is misleading - generally one controls the current into a heater (which is what your relay does) and not the voltage.

...R

First thing to comment on is that +/- 0.5F (= 0.28C I think) is a very fine tolerance bearing in mind the Absolute temperature will be about 330K - hence you are expecting an accuracy of better than 1 part in a thousand. (Based on your low temperature of 130F (54C).

Second thing is that you haven't told us how well (or badly) your present system is working.

Third thing -- I didn't know what a PID was until I read Wikipedia. But the first few lines of the description surely suggest ways in which to use your software to improve performance based on present data, past performance and expected future errors.

Fourthly I suspect an RTD is rather slow to react. If so a faster acting sensor may give you better information. There are small (and simple and cheap) ICs that report the temperature as a voltage proportional to the temp but a thermocouple might be best as it responds in seconds.

And fifthly, your title is misleading - generally one controls the current into a heater (which is what your relay does) and not the voltage.

...R

And fifthly, your title is misleading - generally one controls the current into a heater (which is what your relay does) and not the voltage.

I'd argue that a relay does control voltage, in the sense that "on" = "voltage present" and "off" = "voltage absent"

PID is most useful when you have proportional control of the output. In this case, you don't - the relay can be on or off. However, here's an example in the playground that lets you use the PID in this situation:
Arduino Playground - HomePage. Looks like exactly what you need.

Well I was looking for any option to help control the power getting to the heating element. The PID usage was just a thought in case it would be necessary. However, after doing some more research I was thinking of using a zero crossing TRIAC to control the the power into the heating element. I was going to use the micro controllers PWM as the trigger cycles for the TRIAC. Anybody ever do anything like this? Any input would be great.

No.

What you say is only correct if you don't care what voltage you get. Imagine switching power from a PP3 9Volt battery into the 1500w heater - you won't see 9volts because the battery can't provide enough current.

The relay controls the flow of electrons. The voltage depends on whether there are enough electrons and. if there are, what voltage is provided by their source - e.g. a car battery or the huge generators on the national grid.

...R

JimboZA:

And fifthly, your title is misleading - generally one controls the current into a heater (which is what your relay does) and not the voltage.

I'd argue that a relay does control voltage, in the sense that "on" = "voltage present" and "off" = "voltage absent"

I'm working with similar project but controlling 2 x 6 kW 3-phase heaters.
I have 6 pcs 20A/230V solid-state relays, which allows zero-point switching, with your 1,5 kW power same can be done with triac.
Definetly this will be better than relay because you avoid sparking.

Power output control can be implemented using PWM, for example 10 sec pulse:
0 sec ON corresponds 0 % power
1 sec ON 9 sec OFF
2 sec ON 8 sec OFF
3 sec ON 7 sec OFF
...
9 sec ON 1 sec OFF
0 sec OFF corresponds 100% power

Main routine should make PWM, that is read "power setting" and write/update output channel respectively in order to get required power.
"Power setting" will be recalculated by PID controller, cycle time for example 10 sec and it should either increment "power setting" by one step or keep it as it is, if temperature is close enough to set value.

Of course more accurate power setting can be used, but try with 10 steps first.

Timing is not at all critical, but solid-state relays with zero-crossing control is must, for heater (resistive load, no U-I phase shift) it can easily be implemented with triac (current will be cut when voltage is zero).
You could make protection (isolation) between electronics and power circuit using optocoupler or relay, however mechanical life of relay might become problem if switched 2 times every 10 sec.

For both the OP and the project in the reply above the PID library should be used. You really can't beat it; you'll write far less code using it compared to trying to write your own implementation.

Chagrin:
For both the OP and the project in the reply above the PID library should be used. You really can't beat it; you'll write far less code using it compared to trying to write your own implementation.

.... or if you like your logic fuzzy, look here

Let's keep KISS principle

KISS is an acronym for "Keep it simple, stupid" as a design principle noted by the U.S. Navy in 1960

wiki

All you need is two items;-

Digital PID Temperature Controller SNR & Alarm SNR for Line of Light Industry, Chemistry, Machine, Metallurgy, Pertrification Industry, or Temperature Control and Plastic Extruder Heating Process

Cost: $27.99
free shipping, I love newegg. some items I ordered ground shipping but show up next morning.

Newegg

Solid State Relay
for 110VAC 1500/110=13.64 A 20A/250V SSR should be fine.
for 220VAC 1500/220=6.82 A 10A/380V SSR should be fine.

  1. ...
  2. One key operation, Auto-tuning PID/Fuzzy PID control.
  3. Input: RTD universal input
  4. Accuracy: 0.3%
  5. Control output: SSR
  6. Alarm output: RELAY.
  7. kinds of alarm mode: high / low / high deviation / low deviation/ interval / out of interval/breakage alarm
  8. Dimensions: DIN 1/16 484880mm
  9. Case class: IP65
  10. Power supply: regular: 80-265V AC/DC 50/60HZ

Auto-tuning PID is great, Fuzzy PID is plus.
Accuracy: 0.3% means +/- 0.3 degree per 100 degree, meet your require?
IP65 means High pressure water jets from all directions, please do not drop it into swimming pool.
DC might be true here, since it might use switch power supply. How ever which country still use dc as power supply?

You'd need three items; the PID controller; the relay, and a temperature sensor. The temperature sensor would preferably be a K type thermocouple (-200C to 1250C) and you should be able to find nice ones with stainless steel probes for a few dollars.

But yes, unless you need to programmatically change the temperature setpoint on the fly then a controller like this one would be the most straightforward solution.

Let's keep KISS principle further.

Solid State Relay selection;-

I will only stock 40A/380V SSR with few different size heatsink.
40A case use big one, 10A case use none or smallest one. No brain is needed.