AC design and safety questions

Hi All,

I have a questions around AC PCB design and safety, for my own home monitoring system which I would like to improve and simplify the power bits.  It monitors AC use, Solar generation, etc, so similar to the open energy monitor stuff.

So I wonder about directly powering from 230V AC (UK) and transforming and rectifying to ~12V AC then taking (1) a feed to get a AC representative voltage from it and indication of current flow and (2) then using a LDO voltage reg to drop it to 5v and 3.3v DC to power the project.

But I want to do it safely.  Are there any recommendations available?  Don't want get electrocuted or burn the house down.

My thoughts are currently:

(1) metal box - grounded.

(2) Encased transformer such as http://www.maplin.co.uk/p/2x12v-32va-encapsulated-pcb-transformer-a53qk for example.

(3) good isolation space of mains AC, low volts AC and DC on the PCB + fuse.

(4) mains cable support

Does having AC + DC on a PCB create noise issues I would have to take into account?  Thinking of interference issues with the ADC...

My other plan (B if you will) is to use a 230V AC -> ~20V AC wall transformer and then just do low voltage AC in the box....?

thanks for your thoughts,

James

(PS no this isn't in competition with OEM, private project for my own amusement)

Robert Wall's picture

Re: AC design and safety questions

If you have no experience of PCB layout and design for mains voltages, then you've got a lot of learning to do if you go with Plan A. Plan B gets around most if not all of the safety issues immediately.

On the minus side for Plan B, you're using the same transformer for voltage sampling and for power. If you use the typical bridge rectifier configuration, you need another transformer or an op.amp to isolate the transformer voltage that you're going to use for measurement from the one that goes to the bridge rectifier and regulators for the low voltage dc power supply rails. Even then, the current pulses as the smoothing capacitor charges will dent the waveform and introduce errors. If you want to avoid the extra transformer or op.amp, you can only use a half-wave rectifier, as the emonTx does.

Plan A is essentially the configuration that Robin Emley uses in his Mk2 Router (http://www.mk2pvrouter.co.uk/). Having two separate secondary windings (one for the voltage sample, one for power) largely overcomes the waveform distortion problems. Point 3 mentions isolation - apart from observing the necessary tracking distances, which is an absolute must, I'd make sure that there is earthed copper between the mains connections (both line & neutral) and the low voltages so that any leakage or flashover is to earth. Have a read of "GIVMon" to get some idea of the proper way to do it (that project was to obtain a 'better' voltage sample, but the safety precautions are relevant to you).

The main source of interference that we've encountered is from the digital circuits in the processor; so good grounding, shielding with earthed copper and filtering in the supply (there's plenty of advice on the Atmel website) are most important.

Those are the main points that come to mind.

Javalin's picture

Re: AC design and safety questions

Hi Robert - thanks for the input :-)

Happy enough with low voltage DC PCB design, but think option B sounds the best plan.  I had a look at the mk2 router, and can see the isolation gap you mention for leakage.

I did some circuit simulations last night and a transformer with a center tap and two diodes seems a good option.  I don't have a circuit schematic to hand, but will post later.

Is the 9V AC-AC in the shop (and that I have already) suitable for a supply?

James

calypso_rae's picture

Re: AC design and safety questions

Hi James, I'm always happy to supply parts for DIY constructors to experiment with, at their own risk. 

One of my original PCBs (the orange one) and a matching mains transformer (either 2 x 6V or 2 x 9V) including postage would be £10.  There's an email address on my Shop page for all such enquiries.

The original PCB layout has a tracking error in the vicinity of the display but it doesn't affect the operation of the processor, so will be fine for basic experimentation.  The error can be easily fixed if need be.  My latest (Rev 2.1a) PCB is listed as £7, but I'm always open to offers.

Robin Emley

Robert Wall's picture

Re: AC design and safety questions

If you use the shop ac adapter, you've got all the problems with separating the voltage monitor and the power supply that I mentioned above. Otherwise, there's enough power for a basic 'emonTx look-alike' but no more without distorting the voltage waveform that you're using for measurement.

(Hint: you need to add the transformer impedance / secondary winding resistance to your simulation, then check how the voltage is disturbed by the current pulse.)

Javalin's picture

Re: AC design and safety questions

Thanks for the posts both.

Would a multiple winding transforms solve the voltage/current issues with a single transformer?  One for power supply and one for measurement.  This is where my lack of knowledge starts to show....

i.e. http://uk.rs-online.com/web/p/pcb-transformers/1739737/

Robert -> I'll check the simulation, but I suspect the software isn't that clever.  Its LiveWire (http://www.new-wave-concepts.com/ed/livewire.html) mainly for home use.

James

Robert Wall's picture

Re: AC design and safety questions

As I wrote: "Having two separate secondary windings (one for the voltage sample, one for power) largely overcomes the waveform distortion problems." Largely, but not completely.

For simulations, I (and Glyn) use Linear Technology Corporation's LTspice IV (free, from their website).

calypso_rae's picture

Re: AC design and safety questions

I have occasionally used the LiveWire simulator from New Wave Circuits, but doubt whether it would be able to cope with this kind of application.  I also use their PCB Wizard 3 tool for PCB layouts.  Although the 'pro' version features double-sided auto-layout, I have always preferred to do my layouts manually.  Using this tool, creating Gerber files for PCB manufacture is straightforward enough.  These files can then be checked using the free GCpreview tool from graphicode.com.

Javalin's picture

Re: AC design and safety questions

Hi

So lots to ponder, and work out - thanks for the comments.

Robin - I prefer Eagle atm as I then use oshpark.com for cheap boards.  I've used expressPCB before which is very good and very quick, but also very expensive...

James

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.