Introduction: Pi Outlet Relay Control Using Cayenne

Picture of Pi Outlet Relay Control Using Cayenne

Hey Guys!

My name is João Duarte, I'm an IT Consultant at full time and this is my first instructable :D

Here i'm describing how to build a box where you can plug devices, and with the aid of a Raspberry PI and Cayenne, you can control anything you like from anywhere.

Please let me know if the instructable (or my english) aren't clear enough so I can edit it.

Step 1: Materials That I Used.

  • Raspberry Pi Zero
  • Itead 2x Relay Module
  • 2 European Outlet
  • 6x Wood Frames for Enclosure ( Can’t describe sizes since I found these materials lost in my garage)
  • Jumper Wires
  • 1x Fuse
  • Power Cable
  • Bolts and Nuts

Step 2: Build the Enclosure.

Picture of Build the Enclosure.

This enclosure was built only using reclyced materials I found around.

  1. Assemble all the frames except the top one with screws.
  2. Drill two holes where you will fix the outlets
  3. Fix the Outlets
  4. Pimp it as you like xD ( I added some supports on the bottom and a puller on the top)

Step 3: Wire IT !

Picture of Wire IT !

Follow the diagram attached in order to wire everything as it should.

I recommend some extra caution here since the relay will be used to turn on and off devices that uses 230V AC.

Don't forget to check everything before you plug it to the wall, and if you have any questions or doubts please message me before you try it!

Step 4: Build Your Cayenne Dashboard.

Picture of Build Your Cayenne Dashboard.

Here is where this project gets different from the ones you already saw using Outlets/Relays/Microcontrollers.

I used the Cayenne Dashboard application so I can control the status of my Relays anywhere I am.

A very simple example that I made, was using an Arduino and a DHT11.

I had the Arduino sending a temperature value to my Cayenne Dashboard, and everytime it reached a certain threshold value, it triggered an event to turn my Heater that was connected to my box to "On".

Pretty simple and amazing since you don't need to code anything!

Please go to so you can get it running on your PI.

Step 5: See It Working!!!

Picture of See It Working!!!


Thomas sxt (author)2016-10-19

Thanks for your instrucable! Do you directly connect the relay to the 230V ?

duartejm made it! (author)Thomas sxt2016-10-19

Hi Thomas!
You are welcome. I connected the positive wire to the fuse, and then the fuse to a terminal block like the one attached. From there I connected to the relays.

Thomas sxt (author)duartejm2016-10-19

And the terminal block its connected to the 230V right? Sorry for obvious questions but high current is a bit scary !

duartejm (author)Thomas sxt2016-11-02

Here is the purpose of the terminal block guys! Forgot to add it in the schematic.

duartejm (author)Thomas sxt2016-10-19

Sorry but I'm at work now Thomas.

I'll reply to you later with a picture showing how it is connected.

AhmedE41 (author)2016-10-19

Nice work my friend i build same box 2 months i will upload image when i back to home

seamster (author)2016-10-18

Nicely done, João!

This is a great looking controller and your instructions were very good :)

About This Instructable




Bio: My name is Joao Duarte, and I am an IT Consultant, Electronics enthusiast,Maker and Gamer. I’m from the south of Portugal, and besides ... More »
More by duartejm:ESP8266 With DHT11 to AlexaPI to Dashboards!IoT PiRadio/Alarm using Cayenne. Pi Outlet Relay Control using Cayenne
Add instructable to: