User Tools

Site Tools


projects:power1

Wireless Power Outlets

Have you ever wanted to wirelessly control power outlets from your phone? You could buy a Belkin WeMo Switch for over $40 for 1 outlet or build your own with 5 outlets for under $35 if you already own a Raspberry Pi. Hopefully this post will guide you in the right direction.

Voice Control Outlets (Follow up Guides)

Hardware Needed:

Steps:

  • Connect wires to Rf transmitter and receiver chips(wiring diagram). See this article for more info on gpio pins. If you would like to use different pins check out Ninjablocks 433Utils                                                                      image3 
  • Install Rasbian on Raspberry Pi (If using Raspbian Jessie use /var/www/html/rfoutlet for all paths below)
  • Install Apache and PHP on the Raspberry Pi
  • Clone web files
    • Make sure you have git installed. If not, type: sudo apt-get install git
    • Type: sudo git clone https://github.com/timleland/rfoutlet.git /var/www/rfoutlet
  • Use RFSniffer to find RF codes for your devices
  • Change permission of codesend program so sudo isn't required:
    • Type: sudo chown root.root /var/www/rfoutlet/codesend
    • Type: sudo chmod 4755 /var/www/rfoutlet/codesend
  • You should now be able to turn the outlets on/off from the command line.
    • Type: ./codesend 349491 -l 198 -p 0
    • -l is for pulse length and -p is for different pins
  • Browse to Raspberry Pi ip address 'http://<your-pi-ip>/rfoutlet/image4 
  • Now you should be able to power on/off your outlets from a web browser. If you would like more range you can add an antenna to the transmitter chip. I cut a 12 inch wire from a cat 5 cable and it worked great.
  • If you would like to schedule the outlets on or off you could use crontab. Here is an example to run everyday at 8pm.
    1. 00 20 * * * /var/www/rfoutlet/codesend “code number”

Let me know if you have any questions in the comments below.

projects/power1.txt · Last modified: 2017/06/27 15:41 by 127.0.0.1