Is this a bad idea for mains power? - Page 1
Forum section: electronics / beginners

author: CircuitSlacker
author_rank: Newbie
timestamp: October 28, 2017, 03:33:35 am
content: I am working on a circuit which currently has a relay to switch on/off a light powered by mains power (120v). I want to "override" the first relay (call it "Relay A") by adding two additional relays (call them "Relay B1" and "Relay B2") which are controlled by a different controller than Relay A. Relay B1 would be normally closed and pass-through whatever state Relay A is in, Relay B2 would be normally open and would only close when Relay B1 is open. Remember that Relay B1 and B2 are controlled by the same controller and Relay A can not be controlled by that controller.Attached is a circuit diagram explaining this.In execution, there is more than one light, each light would have it's own set of relays as described here. The multiple lights are controlled together to make lighting effects. I've only given one light as an example for simplicity.Although the controller will be programmed so that both Relay B1 and Relay B2 will not both be closed resulting in two circuit paths for the HOT mains, there is always a chance that something will go wrong and this could happen. Because both circuit paths for the HOT mains are the same HOT source, there would be no voltage differential and as far as I know, shouldn't cause any problems.My question is this: is it a bad idea to have the potential (if there is a controller failure) for the two HOT circuit paths to exist? I don't have the experience to know if this is a bad practice or not.The relays I would like to use are SPDT, I'm sure there is a relay available which would give me a third not-connected throw (I have no idea what this would be called) which would allow me to create a circuit that would prevent the dual HOT circuit paths from being possible. I'm looking at the SPDT relays because they are available in multiples on a development board. This is just a project for a friend and I don't want to make it too involved.I've also thought about just programming the functions of controller for Relay A into the controller I am programming and just do away with Relay A and it's controller but my friend spent some money on that controller and to replicate its functionality would require additional input devices to select various programs and the additional programming itself.

author: Leuven
author_rank: Regular Contributor
timestamp: October 28, 2017, 08:25:39 am
content: The bulb doesn't care if power comes via Relay A + Relay B1, or through Relay B2, or indeed through A + B1 + B2 in case of a malfunction. That's how a mains ring works.

author: IanB
author_rank: Super Contributor
timestamp: October 28, 2017, 08:33:49 am
content: There's no harm in this, but it is an unusual and expensive way of doing things (so many relays, so many wires).A more typical way of doing it would be to have a single relay to control the light, and to have all the digital logic controlling light patterns on the low voltage side. This would also allow you to test the system programming offline without connecting to live voltages (just put a pilot indicator like an LED in place of the relay coil).

author: Ian.M
author_rank: Super Contributor
timestamp: October 28, 2017, 08:49:48 am
content: While your proposed two relay circuit is safe if you use appropriately rated chassis or rail mounted relays and wire the assembly in compliance with local electrical regulations, many of the more affordable commercially available relay boards are unfit for use in AC mains circuits even though the relays have a AC mains voltage and current rating, as due to poor board layout there is typically insufficient creepage distance between the mains circuit and the low voltage control circuit and they also often lack safe mounting points. Post a photo of both sides of any proposed relay board and we'll advise you from that.If possible, intercept the coil circuit of the existing relay and feed it as an input to your controller via an optocoupler and appropriate series resistor. If possible, use the existing relay to control the load, driving its coil from your controller, otherwise disconnect it and use a new relay to switch the load. If you cant tap in to the existing relay coil circuit, disconnect it from the mains and use its contacts as a switch input to your controller. For reliability, especially since the relay has previously been used for a mains load, the switch input circuit should use a minimum of 12V and 10mA so there is enough current and voltage to break through any oxidisation of the contact surfaces due to their previous use. Obviously you will need a new relay for the load.

author: CircuitSlacker
author_rank: Newbie
timestamp: October 29, 2017, 02:37:51 pm
content: Leuven, IanB & Ian.M: Thanks for answering. I feel better about the possible failure state being safe.Ian.M:I hadn't considered looking at the bottom side of the relay board to see the size of the traces for the relay connectors. The website where I was going to purchase the relay board does not have photos of the bottom side of the board, which made me start thinking about what I might actually be getting. I know there are many clones of this board with the same exact layout and screen printing but either different or no brand names printed on them. I've found a version of this board on Banggood and I've attached the top and bottom photos of that board. I will buy from whomever supplies legit and quality projects.Also, I hadn't thought of using Relay A as input for Controller B. That a really good idea that I clearly missed. I appreciate you suggesting that option. I'm going to give this serious consideration, it certainly seems like the best idea at this point.

author: Ian.M
author_rank: Super Contributor
timestamp: October 29, 2017, 05:09:21 pm
content: That board looks pretty good as long as its input side is either properly grounded, or *everything* connected to the input side is in an insulated enclosure with no user-accessible connectors or metal parts. The key features that makes it fit for purpose are those slots round the relay common pins that provide enough creepage distance and clearance for use at 125V AC,and the fact its got proper mounting points. I'm not sure I'd trust it at the relay's full rating of 250V AC, as they've screwed up the track placing and reduced the clearance distance between the common pin and the coil connections - its *PROBABLY* OK, but you'd need to do a Hi-Pot test to be reasonably certain. Also, use Nylon mounting screws for the holes next to the relays, and plastic spacers. I'm *NOT* happy with the clearances if you used metal ones.As usual they've screwed up the optoisolation on the input side. Without it, it solely relies on the coil to contact isolation of the relays. How did they screw up? Well, the rule of thumb there is 'Preserve all the isolation distance the width of the optocoupler gives you', which means you *DO* *NOT* run tracks under it, and maintain aclearance barrier equal to its body widthbetween all tracks that are part of its input side circuit and all tracks that are part of its output side circuit. e.g. That ground plane under the optos shouldn't be there or at least should have a 0.3" gap in it running right across the board under the optos, completely free of copper. However it looks like there may potentially be effective low voltage isolation - enough to stand off 50V DC max between the circuit powering the relay coils and the controller driving the inputs. Some testing and circuit tracing would be required to determine if there is any isolation.If this is going to be a fixed installation, be aware that using that relay board for controlling mains loads is almost certainly not to code and will probably fail inspection.Also I wouldn't trust the relays current rating. As usual with cheap Chinese electronics, halving the nominal current rating is a good starting point.If you want to do it right for a fixed installation, use chassis mount (or DIN rail mount) UL rated screw terminal relays, and a separate driver board. All wiring needs to be secured so the coil and mains circuits cannot come into contact with each other even if the wires come loose from the relay terminals, and there should be a grounded metal or insulating partition between the low voltage boards (i.e relay drive board and controller) and the mains wiring. The coil control circuits should be run through the partition using double insulated wire, with grommets in the holes to prevent abrasion. If a low voltage PSU is required, use a UL approved bell transformer or PSU, intended for fixed installations, not a phone charger or other wallwart.

author: Zero999
author_rank: Super Contributor
timestamp: October 29, 2017, 06:09:27 pm
content: Is a schematic available for that board? If it's like the one I remember seeing, the opto-couplers are pointless and provide no isolation.

author: stj
author_rank: Super Contributor
timestamp: October 29, 2017, 06:39:30 pm
content: well they limit the current to a few ma on the control pins.

author: CircuitSlacker
author_rank: Newbie
timestamp: October 29, 2017, 11:24:09 pm
content: Ian.M:You give me a lot of things to consider. I appreciate the time you've spent on this and the tips on how to evaluate good design vs. bad design. I'll give you some details of my plan in response to the issues you bring up.1. I will be using an insulated enclosure with no user access. I don't know if we will have any user settings yet but if we do, I will use an ESP8266 so I will have Wi-Fi to interface with the controller.2. The fact that the relay board has mounting points was a factor in choosing this board instead of some others. I'll be sure not to use metal standoffs or screws.3. Mains for me will be 120V. Power will be well under 100W per relay (don't know exactly how much yet) so it will need only a small fraction of the 'rated' maximums of the relays in question.4. This will be a portable installation but will likely have continuous use so I should treat it as a fixed installation.Hero999:Thanks for the input. I haven't found a schematic for the relay board. The board in question is a 'Geekcreit' brand which seems to be a house brand for Banggood. If do find a schematic, I will post it.stj:Thanks for clarification.