# RPi to Control Power Outlet

**URL:** <https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243>\
**Category:** Raspberry Pi\
**Created:** [24 January 2021 23:45 UTC](https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243 "2021-01-24T23:45:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [24 January 2021 23:45 UTC](https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243/1 "2021-01-24T23:45:06Z")

</div>

Hi all,

What’s the best way to control a power outlet with a RPi? I’m really not sure how it’s meant to work, but conceptually, I’m sort of thinking that my RPi will be plugged into a power board, and I want to control the switching on and off of another outlet on that board. In short, I’m trying to control a light, and the light is plugged into a power outlet.

Thanks again,  
Kirk.

---

<div class="post-metadata">

**Author:** ![Mitchell](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/mitchell/32/3564_2.png) [@Mitchell](https://forum.core-electronics.com.au/u/Mitchell)\
**Post date:** [24 January 2021 23:57 UTC](https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243/2 "2021-01-24T23:57:12Z")

</div>

Hey Kirk,

While some of our parts are rated for that use, we recommend that those decisions are made qualified technicians that are licensed to work with mains power. That goes for the work itself, it is a legal requirement anyhow.

To wrap-up: Mains power isn’t just lethal. It’s lethal.

Stay safe & keep to low voltage projects. Or employ a contractor to help.

Personally i would just grab a smart home wall switch, that way your aren’t messing with 240v at all.

---

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [25 January 2021 01:19 UTC](https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243/3 "2021-01-25T01:19:50Z")

</div>

Got it. Thank you.

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [25 January 2021 02:00 UTC](https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243/4 "2021-01-25T02:00:06Z")

</div>

Hey Kirk,

A good way to go about it is to use a remote controlled GPO relay. Purchasing a commercial 433MHz, IR, or WiFi activated relay is a great way to do it.

That way, the mains voltage side of things is all taken care of by engineers who sign their lives away that it’s safe for consumer use, and you can just work with hacking together something to reproduce the control signals to your liking, which allows you to stay safe by only working with ELV components.

Here’s something from Jaycar you could use:  
[https://www.jaycar.com.au/remote-controlled-3-outlet-mains-controller/p/MS6147](https://www.jaycar.com.au/remote-controlled-3-outlet-mains-controller/p/MS6147)

---

<div class="post-metadata">

**Author:** ![Kirk](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Kirk](https://forum.core-electronics.com.au/u/Kirk)\
**Post date:** [25 January 2021 02:39 UTC](https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243/5 "2021-01-25T02:39:18Z")

</div>

That’s a wonderful solution @Oliver. Thanks so much.

---

<div class="post-metadata">

**Author:** ![Darren152175](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@Darren152175](https://forum.core-electronics.com.au/u/Darren152175)\
**Post date:** [25 January 2021 02:41 UTC](https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243/6 "2021-01-25T02:41:42Z")

</div>

Hi All, What would you recommend to use RFID or similar for remote control of 12 volt outdoor lights?

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [25 January 2021 02:51 UTC](https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243/7 "2021-01-25T02:51:02Z")

</div>

Hi Darren,

For 12v stuff you could use any microcontroller with wifi, IR, or another form of RF communication (eg. XBee), along with a relay module like this:

> **[5V Single Channel Relay Module 10A](https://core-electronics.com.au/5v-single-channel-relay-module-10a.html)**
>
> A versatile relay board with opto-isolated input. The relay channel can drive up to 10A @28VDC

And here’s a cheap Arduino compatible RFID module you could use:

> **[Arduino Compatible RFID Read and Write Module](https://core-electronics.com.au/arduino-compatible-rfid-read-and-write-module.html)**
>
> This RFID module allows you to both read and write MiFare-Type RFID cards. Create your own contactless security lock. Include one credit-card style tag and one key-fob style tag.

---

<div class="post-metadata">

**Author:** ![Darren152175](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@Darren152175](https://forum.core-electronics.com.au/u/Darren152175)\
**Post date:** [25 January 2021 03:13 UTC](https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243/8 "2021-01-25T03:13:10Z")

</div>

Hi Oliver, I’m new to this level of electronics, how does the relay receive its signal? is that through the RFID module? Would it work over a distance of 10 metres? cheers Darren

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [25 January 2021 03:17 UTC](https://forum.core-electronics.com.au/t/rpi-to-control-power-outlet/9243/9 "2021-01-25T03:17:57Z")

</div>

Hi Darren,

The relay just takes in a voltage to control it - how you supply that voltage is up to you. You’ll need to combine a few principles to get a system that works for your purpose. Here’s some handy tutorial links:

> **[Relay Operation and the Arduino Uno - Tutorial](https://core-electronics.com.au/tutorials/arduino/relay-operation-with-arduino.html)**
>
> If you could operate your switch without physically toggling it on and off, you would open yourself up to an entire section of electronics. Relays are one of the best ways of doing this. A relay is essentially just a switch, controlled by an...

And a few on different methods of communicating with a device remotely (you can then send a signal to a device to switch the relay):

> **[How to network XBee and the Arduino - Tutorial](https://core-electronics.com.au/tutorials/how-to-network-xbee-and-arduino.html)**
>
> Want to setup a wireless XBee network between some Arduinos and your PC? We're going to show you how. We will be using Series 1 XBee modules alongside some XBee Explorer USB modules from Sparkfun to set up our own Personal Area Network (PAN). All the...

> **[Infrared Sensing, Hardware Interrupts, and the Arduino - Tutorial](https://core-electronics.com.au/tutorials/infrared-sensors-arduino.html)**
>
> Infrared (IR) is a great way of using non-visible light to control electronics, and there are a bunch of modules that we can use with our Arduino. However, what do we mean when we are talking about infrared and electronics? Well, IR remotes that...

> **[How to Build Internet-Connected Electronics Projects - Tutorial](https://core-electronics.com.au/tutorials/iot-workshop-1.html)**
>
> What do we mean when we talk about the
