Hard-wiring to the mains: safe is easy, but how to make it code-compliant? - Page 1
Forum section: electronics / general

author: gxti
author_rank: Frequent Contributor
timestamp: March 15, 2012, 11:00:23 pm
content: How does one go about designing a project that needs to be hard-wired to the mains, while also having a SELV communications circuit leaving the box, and go about it in a way that could pass a (U.S. for example) electrical inspection? I've skimmed the NEC and talked to some people and I keep getting mixed signals (no pun intended) about how I can legally bring out a safe (optoisolated) circuit from a junction box and have it treated as SELV.Here's a concrete example: a friend is custom building a house. He wants to put equipment on every receptacle that would both measure the current being used and allow the receptacle to be switched remotely, both over RS-485. This seems pretty straightforward to do, but several people told him that it would never pass inspection because of some rule about any wire entering a junction box being considered "hot". This doesn't leave much room for any kind of interface between hot and safe circuits, so what's the right way to do it? There's also the trouble of making something that is legal and safe but still having to get approval from a human being who is doing the inspection, which may prove to be the real difficulty.

author: AntiProtonBoy
author_rank: Frequent Contributor
timestamp: March 15, 2012, 11:40:23 pm
content: QuoteGet a certified electrician to do the job?

author: vk6zgo
author_rank: Super Contributor
timestamp: March 16, 2012, 01:15:36 am
content: Quote from: gxti on March 15, 2012, 11:00:23 pmI think you may have a battle on your hands,especially in a domestic context.You could probably do something like that in an Industrial situation,where the receptacles would probably be required to be in standard(ugly) enclosures,with everything done to your local wiring rules by a Licenced Electrician.They might freak at the "allow the receptacle to be switched remotely, over RS-485." bit,as it implies the ability to turn mains outlets on remotely by someone who cannot see what is happening to them.(In the domestic situation,kid with a hairpin in the socket,sort of thing).Licencing Authorities usually are cool about remote switching of power to the internals of devices which are normally closed up.(Broadcast Transmitters come to mind),but the fact you are switching power outlets will probably raise a red flag!

author: gxti
author_rank: Frequent Contributor
timestamp: March 16, 2012, 04:43:59 am
content: Interesting, I hadn't thought of that. What if the switching aspect were removed? As another example, I'm currently making a power quality monitor that pulls current and voltage readings from a breaker panel and charts usage. There's no control or switching, it just reports what's happening. But the current transformers, while double-insulated, have to be inside the breaker panel. So I either have to bring the CT leads outside of the panel, or I have to put the monitoring circuit inside an adjacent box and bring out the serial or ethernet line. I think I would prefer to bring out the CT directly using e.g. terminal block headers mounted to a junction box cover, but this is likely to cause "freakouts" too. But by keeping the components that are inside the cabinet as simple and few as possible it is easier to prove that it is safe.As for the first reply of "get an electrician to do it", that doesn't help if the product doesn't exist yet. Pretend I'm a company making a widget that people would pay an electrician to install in/near their breaker panel. How would I design the widget so that an electrician could safely install it and not violate the NEC?

author: Rerouter
author_rank: Super Contributor
timestamp: March 16, 2012, 06:32:29 am
content: well to point you in the right direction, i am not sure for the US, but in australia there are wiring rules books that you can access online with supplemental ones for each state,while they dont exactly meet every code under the sun, what is in them should satify any sparky to contention, though they can be a minefield to find what your looking for under similar terms,then if its really worth your time, you could claw around to see if there is anything else under building or electrical codes for your state or council to see that they can't invalidate your insurance for it, even if its an isolated and idiotproof instalation,

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: March 16, 2012, 09:05:31 am
content: When doing stuff that's unusual it can confuse screwdriver-monkeys that only understand normal installations.My approach would be to install everything as standard, then swap in the unusual kit once the inspection people have gone away.

author: GeoffS
author_rank: Unknown
timestamp: March 16, 2012, 09:40:31 am
content: Quote from: mikeselectricstuff on March 16, 2012, 09:05:31 am... and hope you never need to make an insurance claim after a fireI've had a look through various site and standards I have (none relevant to the US) and I can't find any design/compliance rules for a mixture of low/mains voltages in one enclosure. More research needed.

author: grumpydoc
author_rank: Super Contributor
timestamp: March 16, 2012, 10:18:05 am
content: Why not use the mains wiring as the communication link itself - then design one box to do the RS-485 (or whatever becomes convienient) which can just plug in somewhere, or be permanently installed- there was a thread on various methods to do low speed comms over mains wiring a while back.

author: PetrosA
author_rank: Frequent Contributor
timestamp: March 16, 2012, 04:45:05 pm
content: I believe the only thing you need is a UL listing for your product which may also require a set of installation instructions. With that, the NEC doesn't apply (UL listing trumps the code).I would make sure that only the CTs go into the panel/j-box and that some type of conduit is required to direct their leads to your unit, which would be remotely mounted. You don't want to design this so that the PCB is mounted inside the panel or j-box.

author: wkb
author_rank: Super Contributor
timestamp: March 16, 2012, 06:32:09 pm
content: Can't you go RF for the control part of the circuit? Plenty of power available from the mains so that at least isn't a problem.

author: gxti
author_rank: Frequent Contributor
timestamp: March 18, 2012, 09:15:09 pm
content: RF would work but I would need to bring it out to a plastic box or the signal wouldn't go very far. It also has the added advantage of not needing any wiring runs to near the breaker panel, but I'm mostly interested in brand new installations, and wired is much less troublesome in the long run.Ultimately I agree with PetrosA. The smartest way to avoid trouble seems to be putting just the CTs inside the "electrical domain", bringing them out to a junction box, and plugging the low voltage circuitry into the front of that thus making the fun circuits "not their problem".There seem to be UL-approved junction box dividers for mixing mains- and SELV-rated circuits in one box. So if I wanted to install a device without having any wiring outside of the wall I could drill a hole in one and mount the connector to that, making a nice handoff point. Not sure if that would fly, but it's back to the question of why it would be legal outside the box but not legal inside the box even if the box has nothing else inside it.

author: Unknown
author_rank: Unknown
timestamp: March 18, 2012, 10:46:17 pm
content: Quote from: GeoffS on March 16, 2012, 09:40:31 amIt's there within AS:3000As an incomplete summary.- All insulation rated to the highest permissible voltage within the enclosure. That's right 600V insulation for anything not entirely segregated from the mains and accessible elsewhere.- Segregation, mechanical integrity and security as for the highest voltage.I've seen more than a few incidents where failure of a mains component has resulted in mains potential on ELV cables. Many SCADA, PLC, BMS and other Automation installations fail to comply in this regard, using light duty cable for for status and control. The regulations in this area make sense but are often overlooked, Failures are expensive and potentially lethal.

author: IanB
author_rank: Super Contributor
timestamp: March 18, 2012, 11:09:03 pm
content: Quote from: gxti on March 18, 2012, 09:15:09 pmI think the junction box is the "safety enclosure". The box is earthed, and everything leaving the box should either be earthed, or rated for mains voltage at all points downstream.What I would do to ensure safety is put all the current transformers and transmitting equipment entirely inside the junction box and insulated from probing fingers. Therefore when the junction box is closed all that stuff is inside the hazardous zone and not accessible from the outside. Then I would place optical isolators at the edge of the box where the signals are transferred from the "danger zone" to the "safe zone". Make sure those optical isolators are rated for the necessary high voltage conditions, (e.g. CAT II?) so that any surges can't jump across the isolators. After that you can put all the monitoring and intelligence in a different low voltage enclosure where it is completely separated from the mains.How you get this to pass inspection or satisfy code compliance I'm not sure. You may need to have a special certification performed and compliance certificate issued?

author: gxti
author_rank: Frequent Contributor
timestamp: March 19, 2012, 04:18:33 am
content: Quote from: Uncle Vernon on March 18, 2012, 10:46:17 pmThe leads that came with the CTs say they're rated for 600V, so that's good. I don't know if it qualifies as "double-insulated", or if it needs to, but I could always add a sleeve over it just for another layer of protection.QuoteThis is the part I'm still fuzzy on: when, precisely, can I say "OK, now it's just ordinary SELV"? Let's say for the sake of argument that I'm going to have the electronics in a junction box or other reinforced box adjacent to the panel, with conduit bringing both CT signals and mains voltage for sampling purposes into that box. So the box is "hot". That all comes into a device (single PCB with its own box) that samples the data and outputs a UART signal. So far, still "hot". Then I run that through an isolator on the PCB with an appropriate rating. How do I get that "safe" signal out of the box? Double insulation and sufficiently segregated wiring? Can that wire leave through a (separate) conduit and the downstream equipment still be considered SELV?Here's a shonky diagram illustrating the minimalist way (just bring out the current transformers) and the fully integrated way (circuit connected directly):http://partiallystapled.com/~gxti/circuits/2012/03/19-panel.pngBoth ways look feasible to me, but I like the integrated one better because there's no user-accessible wiring except the SELV data out. But the minimalist way has fewer parts for the inspector to have an aneurysm over. In both cases, once the data wire has left the last box, is it really, truly SELV, or is there some gotcha?

author: T4P
author_rank: Super Contributor
timestamp: March 19, 2012, 07:00:27 am
content: Double insulated means that ... you'd have to saw through the damn thing to open it up then would it be called double insulation , you don't need an earth that's why they make it near impossible to break open . Except for using your saw or your dremel of course .Class IIA Class II or double insulated electrical appliance is one which has been designed in such a way that it does not require a safety connection to electrical earth (US: ground).The basic requirement is that no single failure can result in dangerous voltage becoming exposed so that it might cause an electric shock and that this is achieved without relying on an earthed metal casing. This is usually achieved at least in part by having two layers of insulating material surrounding live parts or by using reinforced insulation.In Europe, a double insulated appliance must be labelled Class II, double insulated, or bear the double insulation symbol (a square inside another square)..Class IIIA Class III appliance is designed to be supplied from a separated/safety extra-low voltage (SELV) power source. The voltage from a SELV supply is low enough that under normal conditions a person can safely come into contact with it without risk of electrical shock. The extra safety features built into Class I and Class II appliances are therefore not required. For medical devices compliance with Class III is not considered sufficient protection.