Go Down

Topic: Filter circuit for Arduino controled water heater (Read 1 time) previous topic - next topic

Tom Paynter

Hi All

I have been working on a circuit for diverting excess power from solar charged batteries to a domestic emersion heater. The circuit measures the battery voltage, when it starts to approch 28V it increases a pwm output on the Arduino this then goes through an opto isolator into an IGBT switching 240V DC. This is all working fine, I have a web page with images and a description here:

The problem with this circuit is that it makes the heater element wine, quite loud and I am a little worried that it may fatigue the coil in the element. So I am thinking of adding a filter circuit with an inductor, capacitor, and a free wheel diode.

I have very little experience selecting inductors, would anyone be able to advise what would be sensible?

The element is 3kw 240v, I am planning on switching upto about 50% duty cycle.



Whine into water?
(sorry, couldn't resist)

Would it be rude to ask "why are you trying to control a heater like this - what's wrong with the usual, long-period PWM associated with a thermostat?"
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.


Firstly I presume you are using the default PWM frequency from the Arduino?

Secondly tell us about this 240Vdc supply - what is it?  What creates it?  How much current can it provide?   Can it drive all the heaters
simultaneously for any length of time?

Trying to smooth a high power PWM circuit is not a great idea, your (massive) inductor will then be singing (probably a lot
louder than the heater!).

You do however need to deal with the high frequencies (above audio range) for other important reasons.

Several options:

Increase the PWM frequency to 20kHz or so - will then be inaudible.  Note that such a high voltage PWM will be a _major_ source of EMI and
you will want some filtering (snubber) to take out the higher freuquencies (MHz range).  It is quite likely to be radiating large (illegal?) amounts
of RF unless the all the wiring is compact and inside a metal box.

Decrease the PWM frequency to a few cycles a minute (depending on what the 240Vdc supply can sustain) - much fewer switching events,
much less EMI generated.  Can use simple relays for that. Hence my inquiring about the 240Vdc supply rail.

Use lower voltage heater element and drive from the 24V rail - much less radiation, but heater elements may be hard to source.  Will need higher current wiring and switches though.
[ I won't respond to messages, use the forum please ]

Tom Paynter

I have solar panels charging deep cycle batteries, on bright days the pannes produce more power than the batteries can take so the voltage regulator on the panes just cuts them off.

This is obviously a waste of power, but also its better to keep the battries at a constant 28V. So the idea with this circuit is to divert the small amout of excess power from the solar panels to the hot water tank. This should result in better charging of the batteries, and free hot water.


Tom Paynter

The power comes from an inverter it is then rectified and filtered to prevent noise getting back to the ac line, the inverter is used to power the lights and small ellectrical appliances. In tests so far it does not seem to make the lights flicker so I guess the filter in the rectifier is working fine.

The circuit is in the garage close to the inverter, batteries generator etc the switched power then goes down 8 meters of wire to the hot water tank in the hose.

The inductor would be in the garage so it could sing to its harts content (I cant hear it there) the line going into the house would be far better if it is DC as I guess it would make quite an antena for the rf interferance.


If you retain the standard Arduino PWM frequenct (490Hz), then to make much difference you would need an inductor of at least 0.1H which can take 12A without saturating. That's an absolutely huge inductor. I did wonder whether a very large flat coil on the garage wall might work, but even if the coil had a diameter of 2m then you would need to use 160 turns and the total wire length would be well over 1km. You'd also need a smaller inductor with closed magnetic circuit in series with it to prevent it from radiating EMI.

So I think you need to raise the PWM frequency a lot - but then the IGBT switching losses will rise.

Alternatively, how about using 2 heating elements? You can use just one, or both in series, or both in parallel - giving you a chocie of 3 settings (and off).
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.


Has anybody pointed out that switching a heater on/off at 10kHz is silly...?

The whining sound you hear is the heater telling to write a proper program.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Tom Paynter

Thanks for the replies.

I am using a standard emersion heater in a domestic water tank, so I would like to avoid non standard elements. The idea of using multiple elements is interesting, however I think I would struggle to get the fine control that is needed for charging the battery. I am also not keen on bringing high current wires into the house.

The inverter is also used to power the lighs and computers/tv, switching for longer periods of time would probably cause flickering so I would like to avoid that.

Changing the PWM frequency is definitely an option, so I will take a look at doing that.

Does anyone have any sugessgions for a filter design with the PWM at a higher frequency?

As for the last point "Has anybody pointed out that switching a heater on/off at 10kHz is silly...?", in what way would you sggest modifying the program?

Thanks for your time.


Why not just use a pwm frequency of less than 1hz as has been suggested above. The thermal mass of the heating element is so large that high pwm frequencies are not reqired. You won't need any kind of filter then.

Tom Paynter

I will give that a try, the only thing I am worried about is making the lights flicker each time it is turned on and off.

The input circuit has a couple of large 260 micro Farad capacitors on it so not sure if they would smove lower frequencies out.

I have some more pictures si I will try and upload them on my lunch break.


Go Up