Pi Outlet Relay Control using Cayenne

About This Project

Hey Guys!

My name is João Duarte, I’m an IT Consultant at full time and this is my first project using cayenne :smiley:

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.

What’s Connected

Raspberry Pi Zero
Itead 2x Relay Module
2 European Outlet
Jumper Wires
1x Fuse
Power Cable

Triggers & Alerts

So far I’m not using triggers and alerts, but the project is very scalable so you can add it. For example to be notified about the status of a device.

Scheduling

I’ll use this feature for sure but I’m still waiting for more hardware. The plan is to schedulle a Bird UV Lamp to be on from 9:00 to 18:00. :wink:

Dashboard Screenshots

Photos of the Project


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

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

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!

See it working!

2 Likes

This is a really cool project! I never thought of creating a generic box where anything could be plugged into it and then remotely controlled with Cayenne…I NEED to do this. Simple concept that has great applicability, and already has over 1k views on instructables, impressive! Thanks for submitting this project and posting the video :slight_smile:

-B

Hi, very interesting, but a question: how the rpi zero communicates on the Internet to join Cayenne ?

1 Like

I will be interested to hear how João accomplished it, but there are a number of ways to get network connectivity on a Pi Zero, from dongles to direct connection via USB, even ideas like Ethernet over SPI. You might be interested in this StackExchange discussion where people discuss various ways to accomplish this: ethernet - What's the cheapest way to get network connectivity to the Pi Zero? - Raspberry Pi Stack Exchange

Hey guys!
I connected it using a wifi dongle.

  1. I connected, using a USB Hub, a mouse and a keyboard (a MicroUSB to USB cable was also used since the HUB and the Dongle are USB and Pizero only have micro USB available). Also used the HDMI port to connect the PI to a monitor.

  2. Then I edited the file /etc/wpa_supplicant/wpa_supplicant.conf. In this file I added the SSID and the password of my network. During this step I also enabled SSH and VNC. After that I just reboot with the Wifi Dongle connected instead of the mouse and keyboard and got the PI connected to the internet. After that is just installing Cayenne using the normal procedure.

1 Like