I want to be able to control a heating element's (which runs on 230V mains) power level, and I'm thinking of running it using a solid state relay and PWM. However, I'm unsure of the implications of doing this.

  1. Current draw - The heating element is 2000W, so ~9 amps. Will the switching this amount of current at high frequencies cause adverse effects to the rest of the power circuit in my home (light flickering, etc.)

  2. Noise induced in the rest of the house circuit - I have read on EE.SE that SMPS cause high frequency noise in the mains circuit, and this can be avoided using a choke. Is this a valid solution to PWM'ing a heating element?

If PWM isn't a valid solution to controlling the power of a heating element, please suggest alternatives.

  • 1
    \$\begingroup\$ Do you want to control the power dissipated by the heating element by, say, turning it on for one mains cycle, then turning it off for one cycle, then repeating that for as long as you want it to dissipate 1000 watts, or is there some variable, like temperature, that you want to use to control the dissipation? \$\endgroup\$
    – EM Fields
    Commented Aug 29, 2014 at 15:50
  • \$\begingroup\$ @EMFields I'm wondering whether PWM is a viable option to control the power / gain of a heating element. The heating element will be part of a water tank, and I want to design a controller for it (but that's another question) \$\endgroup\$
    – tgun926
    Commented Aug 29, 2014 at 22:05
  • 2
    \$\begingroup\$ Having once implemented a dimmer using a triac + a microcontroller, and being surprised at how simple it was, I think it's an option worth researching. It controlled 40 incandescent bulbs totalling about 2400W. But this does make the temperature feedback loop a bit more tricky, as it now needs to set the desired heat output instead of the simple on/off with hysteresis. \$\endgroup\$ Commented Aug 30, 2014 at 14:19
  • \$\begingroup\$ tgun: Conventional PWM, which in this case would be equivalent to cycle-to-cycle phase control, is a bad idea because of the EMI it would cause and because that type of precision is wasted in an application like a water heater. Better you should use an integral cycle zero-cross scheme as already presented, and then tune the system according to its time constant and terminal temperature requirements. \$\endgroup\$
    – EM Fields
    Commented Aug 30, 2014 at 17:49

5 Answers 5


Turning it on and off using a zero-crossing SSR and a timebase of 10 or 30 seconds will not cause significant EMI (because it's switching at the zero crossings).

It may cause objectionable light flickering if the lights are on the same circuit, in the same way that laser printers and copiers sometimes cause flickering. It should not cause any noticeable effect on things that are not on the same circuit.

Dimmers and high frequency PWM can cause noise/EMI issues, but that's not a problem with zero crossing switched low frequency PWM.


Heating elements are designed to handle the mechanical stresses from thermal cycling. Turning them on and off many times doesn't usually cause problems.

One thing to consider is the time constant from applying power to a heating element to the temperature changing in whatever is being heated. Most likely this is much longer than a power line cycle. This means the PWM can be quite slow but still be much faster than the system can respond. Often you can arrange to have whole power line half-cycles either fully on or fully off.

Look thru solid state relay offerings, and you will see there are two basic types. One switches immediately according to the input signal, and the other switches at the next power line zero crossing. You want the latter. Switching at a zero crossing greatly reduces radiated and conducted noise.

I did a project once where a PIC 18 had to control 24 heaters driven from the power line and controlled by solid state relays. For each relay, you only need to calculate whether it needs to be on this power line half-cycle. That takes very little computation, and multiple heaters can easily be managed by a small microcontroller like a PIC 18.

Instead of a traditional PWM with a fixed period and variable duty cycle, I used a Bresenham algorithm to decide the on/off state each half-cycle. The rest of the system provided a 0-255 value for each heater to indicate how hard it should be driven, with 0 being full off and 255 being full on. For each heater, keep a 8 bit accumulator. Each cycle (of the algorithm, which is each 1/2 power line cycle), add in the 0-255 desired drive level. If no carry, then keep the heater off for that cycle. On carry, turn the heater on and subtract 255 from the byte, which is the same as adding 1. That's it. Yes it really is that easy.

The worst case frequency content is still 255 cycles, as it would be with PWM, but intermediate values have less low frequency content due to the inherent dithering nature of Bresenham's algorithm. In any case, assuming 50 Hz power line frequency, the pattern will repeat every 2.6 seconds regardless of which method you use.

  • 3
    \$\begingroup\$ Good answer, but switching half-cycles can introduce a significant DC current in the power line at certain power settings (e.g., 50%). I think it's more "friendly" to the power company to switch whole cycles. \$\endgroup\$
    – Dave Tweed
    Commented Aug 29, 2014 at 13:30
  • 1
    \$\begingroup\$ @Dave: Yes, just the right (or wrong) pattern can cause significant net DC. If you are driving a single heater, then this is something you should probably take into account. I was driving 24 heaters, with the 0-255 values being set by 24 separate PID controllers. I figured the DC would average out to 0 well enough. I don't know what regulations there are around drawing net DC, but this is probably addressed via the minimum power factor requirement. \$\endgroup\$ Commented Aug 29, 2014 at 13:36
  • 1
    \$\begingroup\$ One way to avoid both DC issues and harmonics with this kind of modulation algorithm (which is essentially a delta-sigma DAC) is to add some (pseudo)random noise with a zero mean to the input to scramble the pattern. (The tricky part is ensuring that the signal+noise stay within the range 0-255; one way to do this is to scale the random numbers to a range proportional to min(x, 255-x), where x is the current input level.) \$\endgroup\$ Commented Aug 30, 2014 at 0:50
  • \$\begingroup\$ I went looking for Bresenham a few years ago and contacted him by email. A young woman at university had asked for help with a simple maths problem and could not understand the algorithm. I thought he' be interested to know that far away and long after his 'discovery' they were still teaching the principle to undergrads and still attaching his name to it. ...|Looks in email log - ah I see I told Olin that already about 4 years ago :-). I see that my contact with him predates my GMail joining about 7 years ago. \$\endgroup\$
    – Russell McMahon
    Commented Aug 30, 2014 at 7:47
  • \$\begingroup\$ @Russell: I met Jack Bresenham and chatted with him a few times at SIGGRAPH conferences. Back around 1990 I wrote a paper in a IEEE publication about how to extend his algorithm for sub-pixel addressed lines, and he wrote a nice forword in that issue. He's a really nice guy, but has retired quite a while ago now. \$\endgroup\$ Commented Aug 30, 2014 at 11:53

Normal PWM is not suitable for switching heating elements. Simply because heating elements are very slow to respond to changes in current. It takes time for them to heat up, and cool down. Much much longer than things like motors or LEDs.

So you have to use a technique known as "Slow PWM", which is kind of like PWM in that you have an on/off duty cycle, and the ratio of one to the other defines the average current, but the period (or timebase) of the PWM is considerably longer.

Instead of switching at 500Hz, 1KHz, 20KHz, or whatever, you need to switch at fractions of Hz - for example 0.25Hz, or a timebase of 4 seconds. Longer timebases can also be used, such as the 30 seconds mentioned in Spehro's answer.

Also to be taken into account is the fact that even when a heating element is "off", it is still very hot and heating the area around it. Consequently the temperature of the thing you are trying to heat up continues to rise after turning the heating element off.

I myself have a home-made reflow oven with a pair of heating elements. These I am switching at no more than 1 second intervals, but I'm not using PWM for them. Instead I am using a predictive algorithm which tries to estimate what the temperature will continue to rise to after the current has been removed and remove the current at a suitable point before the target temperature has been reached. It utilizes the slope of the recorded temperatures over time, along with a manually determined heat extension constant.

  • 1
    \$\begingroup\$ "Normal PWM is not suitable for switching heating elements. Simply because heating elements are very slow to respond to changes in current." - That makes no sense. Just because heating elements are slow to react doesn't mean regular PWM can't be used with them, it just means regular PWM isn't necessary. \$\endgroup\$
    – marcelm
    Commented Mar 1, 2017 at 15:00

I are using a cheap pwm controller on my water heating element (3kw) tuned down to 600 watts.This is a way I can maximise my solar use from a grid tied system over a period of time.There is a change over relay that will boost power if necessary earliy in morning and late at night if needed.I have being running this for over 12 months without any problems.

  • \$\begingroup\$ Exactly what I want to do. Do you know at what rate the PWM is run or even better, do you have a link to the controller? ;) \$\endgroup\$ Commented May 1, 2019 at 3:25

I would like to point out that many temperature controllers REX 100, SESTOS D1S-VR etc use a standard SSR and standard PWM to control elements. It works fine for me using both of these controllers.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.