Summary Introduction

My goal is to split a 1-gang mains power extension lead into three, have my Raspberry Pi plugged into one of the outputs, and have the Pi able to switch the other two outputs using relays.


I want to use my Raspberry Pi to switch on and off two mains-powered appliances using solid-state relays. I've found this useful video which demonstrates the concept on a mains-powered lamp.

The video suggests cutting the lamp's power cord and wiring that up to the relay, but I don't want to cut the cords for my appliances. I am, though, happy to use an extension lead and cut that instead. However, I don't want to have to buy and cut an extension lead for each appliance; nor do I want to have to plug three things (the two appliances and the Pi) into my wall socket individually, for neatness' sake.

So I thought maybe I can make a 3-gang extension cord and have the Pi run off one output and attach the relays to the other two.

The Plan

My idea is to get myself a nice long 1-gang extension chord and two spare extension chord sockets, so I'd have something like this (please excuse my crude illustrations!):

1-gang extension cord and two cordless extension sockets

I would then cut the extension cord say 3m from the plug end and cut two more times to give myself two pieces of headless chord, like so:

chopped up extension cord and spare sockets

Now I can wire those loose bits of cord into the spare sockets. Furthermore, I could cut those cords again to insert the relays, giving me this:

chopped up extension cord plus solid-state relays

The final piece of the plan would be to join all those loose ends in a junction box.

The Question

Sorry it's taken so long to get here, but here is the question (well, two actually):

Is this plan feasible? And if so, what's the best (i.e., safest) way of connecting those loose ends? I thought of using a junction box and I've Googled endlessly but can't seem to find anything that takes one input and allows multiple outputs. The closest thing I can see is this but I think the cord might be too thick for it.

Also, I'm a little concerned that shoving three wires under one screw in the terminal block of a junction box might be insecure and lead to them coming loose.

Any advice and suggestions are most welcome!


3 Answers 3


There are multi-way connectors for connecting several wires together. If the wires aren't too thick, you should be able to get two into each end of a suitable terminal block strip (perhaps a 15A one). Alternatively, Wago do a range of connectors for joining anything up to 5 wires at a time.

Make sure the whole lot is in a suitable insulated box. I don't know if the solid state relays you're using provide adequate isolation between the mains and the drive circuit. If not, act as if anything on the Raspberry Pi could be live when powered up.

  • \$\begingroup\$ Excellent, thanks. A quick Google for "Wago" and I found what I needed. \$\endgroup\$
    – daiscog
    Commented Dec 10, 2015 at 0:35

Option the first would be skip this if you are truly unfamiliar with mains power - it's not something you should attempt without having a very good idea what you are doing and how to do it right, especially if you are in a 220-240V mains region.

Use a box; One large enough to mount a normal wall-outlet type duplex receptacle in, and all your connections, SSRs and the RasPi and its power supply inside.

Use either a terminal strip (crimp-on spade connectors optional) or wire nuts to make the connections inside the box. If the box is plastic, done. If the box is metal, be sure to connect it to the grounding wire.

  • \$\begingroup\$ Basically m.instructables.com/id/Arduilay \$\endgroup\$
    – Passerby
    Commented Dec 9, 2015 at 23:00
  • \$\begingroup\$ Thanks for the tips. I already have a plastic box for housing all the connections, but didn't consider housing the Pi, too. I'll look for a suitably-sized box. \$\endgroup\$
    – daiscog
    Commented Dec 10, 2015 at 14:39

I suggest you find a decent quality plugboard / socket strip and mount everything inside that. You'd need to find one that's openable. Many are using a threaded 'nail' fastener now and they are not repairable. Some of the MK brand might be worth a look.

These devices usually use metal strips to form a continuous connector and socket terminals. If you can cut the live strip between socket 1 and 2, 2 and 3, etc., and wire each back to the first via your SSRs you should have a neat solution. First socket is always powered, the remainder are switched.

  • Please keep adequate clearance between the power conductors and your signalling circuits.
  • Ensure that the SSRs are fully opto-isolated and adequately rated.
  • Figure out how much heat the SSRs are going to dissipate and calculate heatsink size bearing in mind that they won't have any ventilation.
  • If you don't internally fuse the individual SSR sockets then the 13A plug fuse should be replaced with one that will protect the weakest SSR. e.g., If one of the circuits can only handle 3 A safely then a 3 A fuse should be fitted in the 13 A plug.

The feasibility of this all depends on finding a socket strip with enough space to take your electronics safely.

  • \$\begingroup\$ Thanks for the tips. These are the SSRs I have in mind. I've no idea whether they're opto-isolated, but they are rated at 50A (the extension cord is standard UK, so its plug is fused at 13A and the appliances both have 3A fuses in their plugs). \$\endgroup\$
    – daiscog
    Commented Dec 10, 2015 at 14:36
  • \$\begingroup\$ Those look as though they are opto-isolated although it doesn't say it on that page. Double check with the manufacturer's data sheet for 1000V isolation at least. They look too big for my plugboard idea. The 3A fuse in the plugboard is to protect in case any plugs the kettle in! \$\endgroup\$
    – Transistor
    Commented Dec 10, 2015 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.