Mains control relay

Joined
11 Jan 2011
Messages
400
Reaction score
22
Location
Oxford
Country
United Kingdom
Hi everyone,

What's the best way to set up a relay to control a socket outlet? I'd want it latching. Was thinking of a DIN rail enclosure, maybe like this:
https://www.internet-electrical.co.uk/switchgear/din-rail-modular-enclosures

A relay module, something like this:
https://www.switchtec.com/ProductGrp/din-rail-mount-electrical-latching-relay

And then connected to metal-clad socket:
https://www.toolstation.com/axiom-metal-clad-switched-socket/p54852

But before I go ahead, does anyone do a socket and din rail in the same enclosure? Or is there a better way?

thanks!
 
Last edited:
Those things could be made to work.

How is the relay to be activated?

I haven't really decided yet. Could be Arduino, Pi, could just be momentary switches. The only requirement is that the control signal can be sent over cat5, so not mains voltage.
 
Have a look at impulse relays. And have a think about cable segregation- not sure about the wisdom of having bare ends of LAN cable floating around in the back of a 13A socket
 
Have a look at impulse relays. And have a think about cable segregation- not sure about the wisdom of having bare ends of LAN cable floating around in the back of a 13A socket

Yes, it's what I've been thinking about for a while: The best way to bring low-voltage signals into a Wiska or other box with 20mm knock-outs. You can get an M20 rj45 panel mount, but I don't have to have LAN cable all the way into the box. For a latching relay I only need three (maybe two?)-way going out, there are any number of M20 panel mount connectors you can buy from RS that will do that.

The bigger problem is mounting the relay. Either go DIN, which will take up loads of space, or have a custom PCB with the relay soldered on, which would then require mounting somewhere, and a lot of these electrical boxes don't have anywhere to mount a PCB. They're not really designed for this. One notable exception is the Wiska combi 108

https://www.wiska.co.uk/en/30/pde/10061999/combi-108-bk.html

Which can take a mounting kit:
https://www.wiska.co.uk/en/30/pde/10060362/din-rail-kit---combi-108--308.html

I could use similar screws to mount my own PCB instead of the DIN rail.

Or I could get one of the many DIN rail PCB carriers
https://www.amazon.co.uk/Electronics-Salon-Mounting-Carrier-Housing-Prototype/dp/B00U5JVRUI

But this way I think I'm looking at:
- Bit of ply to screw everything onto
- Mains plug
- M20 nylon gland
- Wiska (or other) box with relay (another M20 nylon gland for the LV cable out)
- Short bit of trunking into....
- Metal clad socket.

Hence the question about whether there's a box that I could put the lot into to avoid the ply and two enclosures.

But it seems few people bother with this kind of setup. I guess Amazon is awash with mains control devices like this:

https://www.amazon.co.uk/Control-Sockets-Accessories-Function-Required/dp/B09NRB1BYH
(nice tear-down of simiar device here:

But I'm going to be potentially killing my entire network overnight with this setup so I don't want anything wifi-controlled, and have my doubts about whether the 433MHz mains control devices will reach.
 
To be honest, given the info I’d buy a set of cheapo energenie remote sockets and a bigger box
 
To be honest, given the info I’d buy a set of cheapo energenie remote sockets and a bigger box

I have 3 similar devices already in a drawer in the garage! Although I think all the remote batteries have run down now. I was wanting something wired (and latching) for this. Since this is a DIY/hobby forum (or at least I consider it to be) I was hoping for help in putting something together rather than a "don't do it" kind of response. For me that's the whole idea of DIY projects, you get to make something that isn't otherwise available and (hopefully) have fun doing it, maybe even other people benefit when you figure out a cost-effective solution and post it somewhere.
 
They don’t need batteries (apart from the remote) as they draw power from the socket.
I appreciate the desire to make something but you asked for a solution
I have used the remotes to control lights in a lecture room for years to avoid switches open to all.
 
I found a relay rated 300 watt DSC_6062.jpg which I am using for lights, wonder if you can get a larger version? What I wanted was the standard light switch to work and also the phone so both work like a two way switch.

Instructions Landing-light-relay-instructions2.jpg Landing-light-relay-instructions1.jpg as said seem you want a larger version of the same.
 
They don’t need batteries (apart from the remote) as they draw power from the socket.
I call that needing batteries. Also they tend to be those irritating 12v things presumably because it makes the transmitter circuit a fraction cheaper.

I appreciate the desire to make something but you asked for a solution
I asked for a latching solution and I'm pretty sure the devices you were suggesting are not. They may be but it wasn't clear. The ones I have are not.

I have used the remotes to control lights in a lecture room for years to avoid switches open to all.
And I agree for lighting control they are ideal. I used them a few times for Christmas lights. There's no problem if you have visual feedback that they've activated. For anything else they're rubbish and I've never achieved anything like quoted ranges. They barely work across one room so they're not going to work through several walls. There's no reason for me to muck about with them because I have cat5 wiring between the points I need to control.
 
So I found a few things out since my first post, after many hours of research.

1 - Wrong forum. Meaning no disrespect to anyone here, but I think I'd have more luck on eevblog as there are people with similar kinds of questions there. Anyhow, since I started here, I'll post here what I found out anyway.

2 - Mains inlet. I've used compression glands for getting mains into boxes in the past, and they give good pull strain relief but I've never been too happy about the twist relief. So I decided it would be more suitable to have a mains IEC inlet. There are also two kinds: Ones which go in from the outside, and PCB mount ones which go out from the inside. The PCB mount would be good if I want to put the relay on a PCB because for a small PCB the IEC connector would hold the pcb in place (no mounting stand-offs required). Here's an example of a PCB mount IEC inlet:
https://cpc.farnell.com/bulgin/px0580-pc/inlet-iec-pcb/dp/CN18628
There's one big problem though. It's not going to cover any uneven dremelling I do to a case so could look ugly unless I go for a custom panel:
https://www.frontpanelexpress.com/
So whilst it might be a really nice solution to have a couple of IEC (inlet and outlet) attached to the same PCB, maybe even the control connector on the same front panel it requres some precision that I'm going to have to get someone else to do (I don't have a CNC machine, on my TODO list, but not for today). Another problem with these connectors is you have to choose your panel thickness carefully. They really only support one thickness unless you want to see a step.
So for DIY filed/dremel job on the opening it's going to be more suitable to use the external ones with solder connections:
https://www.amazon.co.uk/Loops-Socket-Inlet-Chassis-Connector/dp/B01LZJO0L0
Fortunately the cut-out height for these is usually 20mm, so it's 'compatible' (in a way) with many of the adaptable boxes (and Wiskas) with M20 knock-outs.
Unfortunately most of these boxes go overboard on M20 knock-outs so there's often only a single side where you have enough plastic either side of the M20 so you can widen the knock-out to accept the IEC socket
https://www.toolstation.com/moulded-pvc-box-ip65/p91800

3 - Mains outlet. I did briefly consider having another IEC for mains out. It would make the arrangement nicely compact and I could easily do that in a single box. Unfortunately I'm just moving the problem around because I'd still need an IEC to UK socket adapter. I didn't figure out a way to put a mains plug on top of a wiska-like enclosure, and I'm not certain that's a good idea if I could. I also considered that I could have some kind of box backing onto a normal mains outlet socket, in other words two elecrical boxes back-to-back with some ply sandwiched between them, the 'rear' if you like containing the relay, the 'front' with the socket, but I'd like to keep the option of mounting the whole arrangement on a wall, so I think side-by-side is better. I think I have to go with metal-clad 13A socket on ply. It's been done before, it's bomb-proof, and I get some M20 knockouts to take cabling into the relay box.

4 - Relay. I did parametric seach for relays on Digikey, Mouser, Farnell, RS-components and even Rapidonline. Latching DIN mounting relays are quite expensive and also bulky. They also (of course) require the DIN rail. Further, they have limited coil driving voltage options (usually 12 or 24v). I'd like to know what they're normally used for but it seems it's frequently for switching from two (or more) places. They are generally going to have dual coils for ease of switching (pushing up the price). Flange mounted relays would be nice for putting in a box, but their latching options are extremely limited. They are also not so cheap, but cheaper than DIN-mounted. I could find no mains switching latching panel mounted relays and it seems they're more suited to automotive (lower voltages). This leaves PCB-mounted. There are many of these with impressive characteristics and equally impressively long lead-times
https://www.digikey.co.uk/en/products/detail/cit-relay-and-switch/L114FL1AS5VDC-40R/14002134
There are a couple of things to look out for: First to ensure the pins sit on 2.54mm grid so you can use prototyping board (see below), and also you have to watch out because the parametric search gives maximum current which in some cases can drastically drop at the higher (i.e. mains) voltages. It's annoying to have to go through all the data sheets checking this.
The Hongfa ones have pins on 2.54mm grid although they only support 5A contacts.

5 - Fuse. I think I have to have one because I can't be sure what IEC mains lead will be used with the arrangement. Unless I make it work for 13A. Still not decided about this. This is slightly annoying because I think that means if I want an IEC with integral fuse I'll need a taller adaptable box to put my relay in, to fit the larger inlet. So I think the fuse may have to be an inline one inside the box.

6 - PCB. It took some time looking on electronics stack exchange, and a bunch of other forums to get some idea about design rules for mains PCBs. One suggestion was to look at some existing designs, a PC power supply seems a good bet. For worst-case substrate 5mm has been suggested as rule-of-thumb gap between tracks, to get exact figures seems to involve purchasing some rather expensive literature and it depends on the use, heat, environment and a whole bunch of factors. One of the things that wasn't clear is if this can be stripboarded. Max current is supposedly 3A through stripboard but you can easily increase this by laying down additional solder, or simply adding a wire on top of the track, in parallel to it. This seems like a good argument for simply limiting the max current with a fuse. I don't think I'm going to need more than 2A for this first project, but I'd like to build more than one for other things. Another thing that wasn't clear is what kind of gap I need between tracks that connect the contact pins. Can that be less than 5mm?

7 - Control enclosure. You can do practically anything electronics-wise with diecast aluminium, easy to file accurately without it taking all day, easy to dremel and you can make a neat job. Then I started reading the perils of earthing such boxes, oxidation, all the millions of ways your earthing arrangement may fail and got put off. Steel is better and many steel boxes have earth connection points, but it's harder to work with, for these reasons I decided I probably want the control enclosure to be plastic. Wood was another option, but probably more work, and again some concern about the electrical properties changing due to damp conditions made me feel ABS would be the way.

8 - PCB mounting. I spent ages looking through possibilities of enclosures with PCB guide slots and integral stand-offs until I realised one simple fact: If I mount the enclosures on ply (which I planned to do) I can just drill holes for the stand-offs and they can be hidden in shallow holes in the ply. Duh! Yes, in theory I have possibly mains-connected stand-offs (under a fault condition) in contact (or close to) wood, which could get wet and therefore conduct and blah, blah, blah for the extreme paranoid this could be a problem. I could use plastic stand-offs but I hate them. Opinions welcome on this one.

9 - Control connector. Still completely undecided about this, beyond the fact that it's probably going to be an M20 panel connector. If I go for single-coil latching I only have two wires to deal with. That probably narrows it down to a few thousand connector types at Mouser/Digikey. I'll probably just choose the cheapest.
 
Back
Top