I have a room where I have some electronic equipment running 24/7. We have the electrical wiring done recently following norms and everything. There's a Raspberry Pi in the room that's constantly generating reports and controlling sensors of all kinds. We interact with the Raspberry remotely through Internet.

Is there a way to disconnect the whole room's electrical power supply from a Raspberry Pi, by sending a signal to some actuator that can cut the power?

The room has 220 V and over 8 kW connected.

closed as off-topic by Milliways, techraf, joan, Gene, Darth Vader Jan 13 '18 at 22:40

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – Milliways, techraf, joan, Darth Vader
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Do you want to use the Raspberry Pi to switch off the 220V power supply to the room? – joan Jan 7 '18 at 23:04
  • @joan Use to send the signal to some actuator that can do this. Looking for what that actuator is, perhaps there's something already made to be controlled with the raspberry. Thanks. – Richi González Jan 8 '18 at 0:38
  • There are two safety concerns here, one is the contactor circuit, which can probably be done safely with some research, there are also off-the-shelf solutions you can use (with some protocol or another). The other, more prescient concern, is reliability and failure tolerance on the control side. I would not use an RPI in a high-demand production environment without contingency or redundancy. Especially, I would never rely on your set up to disconnect power for servicing. – crasic Jan 8 '18 at 23:20
  • 1
    In other words your raspberry pi will fail, hardware breaks, software crashes, and it may do so without warning or expectation. You must plan for this contingency appropriately when dealing with 24/7 power equipment. If it is unnaceptable that the room remain powered when commanded off, or vice versa, I would run and find an off-the-shelf PLC based solution and pay the $1000 for piece of mind – crasic Jan 8 '18 at 23:23
  • @RichiGonzález All safety concerns and warnings aside, I think what you're looking for is a relay. Do some research on that, and make your your relay can handle more than 8KW, if such a thing exists. – Gene Jan 13 '18 at 7:29

The answer is, Yes. But not in the fashion that the others are proposing

While an SSR or Contactor is perfectly reasonable Device for this application, using a Raspberry PI as-is especially one that is hosting other services is not the appropriate controller for this application. This applies to the software and hardware portions.

Keep in mind, that when choosing a contactor or SSR, it is suggested to give yourself a lot of overhead, a 40A circuit should probably use a 200A Rated Contactor or SSR.

1. It is essential that there is a dedicated controller which is responsible for maintaining the state of your power control relay 24/7/365.2422

The raspberry pi can be used as your home automation server, but you need an intermediate, more permanently installed layer. In the most basic sense this class of devices is known as a Programmable Logic Controller (PLC), which, if you allow my analogy, is a simple ruggedized "Arduino", at least for this application

enter image description here

There are a variety of PLC's on the market and most are fairly expensive, however there are a few inexpensive ones constructed from arduinos and Raspberry PIs. They come with a variety of input/output interfaces, from simple digital I/O to TCP/IP

The PLC is responsible for maintaining the safe state of the switched circuit in isolation from the higher level control server, this provides a level of reliability, and also, the ability to add a manual override, or cutout switch easily.

In commercial buildings and public places you may have noticed this equipment before, often used to control various light fixtures, fans, etc.

2. Choose a Switching Device

SSR or Contactor, I would recommend one that can mount on a Rail.

enter image description here

3. Find a permanent installation for the equipment

The Raspberry PI, and potentially, even the contactor can be mounted in the same location

The PLC is mounted in a cabinet, which can double as a junction box (for electrical wiring) or otherwise mounted near the feed in for the room.

enter image description here

Typically you mount equipment on standardized "DIN rails", and there area number of cases for the raspberry which have this mounting standard.

enter image description here

For wiring connections, terminal blocks are used to make a reliable electrical contacts in permanent installations

enter image description here

4. Ask a Professional Electrician to do this work for you

Designing Home Wiring with Boxes for a PLC is something an Electrician would understand and be able to do the work for you, perhaps even assist you in planning/designing.

  • 1
    Comments are not for extended discussion; this conversation has been moved to chat. – Jacobm001 Jan 10 '18 at 17:07


A relay or contactor (powerful relay) can control currencies in the 40Amp or more range (8kW = 8000/220v = 34 Amp).

And your circuit could be a relay controlling a contactor since the Raspberry Pi can't handle the power required by a contactor.

Wikipedia has a indepth article about relays, https://en.wikipedia.org/wiki/Relay

  • 2
    The biggest safety concern is the reliability of the PI to function without error or failure. Especially in the safety critical case when someone is working on equipment while the PI is holding power off. The relay is not the hard part, there are many remotely controllable relays and circuit breakers for building wiring. Lots of options there. But there is a reason that buildings use PLC's, the extra cost goes into hardware reliability and deterministic/reliable control software. – crasic Jan 8 '18 at 23:26
  • How do we propose that Raspberry Pi can energize a relay or a "contactor"? – Chetan Bhargava Jan 10 '18 at 4:23

To enhance the solution given by MatsK, you would have to use an SSR like one pictured below:


My recommendation would be to add another layer of opto-isolation when driving the above relay. Here is how opto-isolators work. If possible, double the capacity of the relay (90A) to add scalability and over-current scenarios.

There a lots of advantages of using SSR over mechanical relays. Here is an application note from IXYS that delineates the advantages of SSR over mechanical relays.

I would not recommend you do it yourself unless you are licensed. Better get a licensed contractor as the voltages are lethal and one mistake would cause electrocution!

  • Could you explain in your answer why an SSR is an improvement over an Electromechanical Relay/Contactor? – crasic Jan 8 '18 at 23:44
  • @crasic SSR will have lower contact resistance, avoids contact corrosion, will avoid arching caused by switching heavy loads. No Raspberry Pi can directly actuate a EM Relay or a contactor but it can drive an SSR in a Jiffy (look at input voltage range in the SSR picture). Hope this helps. – Chetan Bhargava Jan 8 '18 at 23:53

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