Help requested for varying AC duty cycle using a microcontroller

Thread Starter

thedoctor

Joined May 31, 2010
4
Hi,

I apologise if this topic has already been covered.

I'd like to create an AC duty-cycle controller using a microcontroller. Basically, I'd like to use a digital input on the uC to count both negative and positive AC peaks, and fire two bi-directional thyristors using a digital output on the uC.

My application is to control a simple heating element duty cycle so that I can have close PID control of water temperature.

I would be grateful for any advice on this application, namely: is this the best (or a good) way to do it, and if so how could I produce a 3.3v digital input signal from a standard 240VAC supply? Also, could I fire the thyristors directly from a (opto-isolated) digital output?

I was thinking of using a 3.3v Zenner diode for the input, but I'm really not sure that this is the best way.

Regards

Jim
 
Last edited:

beenthere

Joined Apr 20, 2004
15,819
One bi-directional thyristor will do. A TRIAC is pretty much the same as a pair of antiparalleled SCR's.

I would be grateful for any advice on this application, namely: is this the best (or a good) way to do it, and if so how could I produce a 3.3v digital input signal from a standard 240VAC supply
Never try to use circuitry that attaches to the line. Use a transformer to produce all the DC voltages (through rectification and regulators) you need.

With a zero crossing detector to synch the microprocessor, it would be simple enough to trigger the TRIAC at the correct part of the AC waveform. The TRIAC is indifferent to the AC waveform polarity. Opto devices should work fine.
 

Thread Starter

thedoctor

Joined May 31, 2010
4
Hi,

Thank you for your reply.

I've been looking at zero-crossing circuits, and the comparator type is exactly what I'm looking for. I do need to get the line voltage signal into this, which as aforementioned, is 240VAC. Do you have any advice for coupling the AC mains voltage to the input of the comparator? Would I be looking at a transformer and IC regulator?

Also, (as I've got a qualification in electronics but absolutely no practical experience???) I'd like to build the circuit up on breadboard to test; is there an easy way to mount a TRIAC in this way?

Regards

Jim
 

beenthere

Joined Apr 20, 2004
15,819
Always use a transformer for isolation from the line. The output is in phase with the line waveform, and so can be used to sense the zero crossing.

The TRIAC should be mounted in an enclosure so the live terminals are safely housed. If some significant power will be controlled, the device may have to be mounted with isolating washers on a heat sink for heat dissipation. A vented case or box may be necessary.

The control circuitry may be done on a breadboard for experimentation, so long as the trigger is isolated by an optical device or a transformer.

We would urge extreme caution with this, as line voltages are very dangerous. If you can take power off through a breaker that will trip with any leakage to ground (I have no idea what the British term for this sort of breaker might be), then that will give at least some protection. Take care that no terminals are exposed to help prevent shock hazards.
 

Thread Starter

thedoctor

Joined May 31, 2010
4
Thanks again.

My house is quite modern and is wired to RCCBs rather than a traditional fuse box, which detects earth leakage. Wikipedia tells me that these are called Ground Fault Interrupters in the US. In any event, I'll be very careful.

I'll start off by wiring the mains into a transformer; I found a cheap one that goes 240V to 2x3v which should hopefully do the job. Having said that, the comparators I've been looking at take a 100mv p-p signal so I may have to look a little further. Would it be prudent to put a voltage regulator IC in there to take care of mains voltage spikes?

I'm having trouble finding something that I could mount a 3-pin TRIAC on (or any 3-pin IC like the voltage regulator for that matter). Does something like this exist, or do I have to put it straight in the PCB? As the TRIAC will be driving some heavy current (around 12.5A for the 3kW element at full load) I'm having trouble seeing how the mains cable is attached. I would appreciate any help you could give.

Jim
 

beenthere

Joined Apr 20, 2004
15,819
I do come to my senses on occasion. A better device for your purpose might be a solid state relay (SSR) - http://en.wikipedia.org/wiki/Solid_state_relay

That is a general article, of course. Your application would require one rated above the line voltage and above the current for reliable operation. You can look in local catalogs to see what is easily obtained, and use the manufacturer's part number to get a data sheet, which will explain operation. They come with isolated inputs, often with a proportional voltage input. Many have the zero crossing circuitry built in.

An SSR should be a safer and more easily applied solution.
 

Thread Starter

thedoctor

Joined May 31, 2010
4
Hi,

Thanks again for you help. One more question (I promise :) )

I've had a look and there are some ones that seem to fit the bill, and they aren't too expensive either escpecially considering how they simplifiy things. My last question would be: would varying the duty cycle over (say) a second - that is, between one AC cycle per sec and 50 AC cycles per sec - be less efficient than varying over a larger timescale? For example making the output control value between 0 and 10 over 5 seconds, where each increment brings the SSR on for and extra 0.5 sec.

Cheers

Jim
 

beenthere

Joined Apr 20, 2004
15,819
The answer to that probably has to do with the mass of liquid being heated and the efficiency of the thermal insulation. I suspect a period of experimentation might be necessary to find the control methodology that will produce the least over/undershoot.

One mechanism for heat loss out of a water heater is through the piping. It is conventional (at least in the US) to have the inlet and outlet pipes enter from the top of the heater. Convection causes significant heat loss as hot water rises out of the tank.

A partial but significant cure is to place a downward U section in both pipes just before they enter/exit the tank, which breaks the thermosiphon. A bit of insulation at the top of the tank saves a bit of heat loss as well.
 
Top