Picture of Raspberry Pi GPIO home automation
I had heard about GPIO pins on the raspberry pi and decided to do something with it. And with the holidays coming, wouldn't it be great to be able to turn on and off your light display from the web!  This is a pretty simple project that creates a web app for controlling lights.  It uses the Raspberry Pi for the internet connection and a wireless remote control to turn on and off the lights. The tricky thing is to connect the Raspberry Pi GPIOs to emulate pressing the buttons on the remote control.

Step 1: Parts

Parts needed:
• Raspberry Pi
• Remote controlled outlets
• Ribbon cable
• Solder

(Not shown)
• PCB board
• Resisters

• Soldering gun
• Dremel/Hacksaw
• Screwdriver
• Wire cutters
• Wire striper
• Multimeter
1-40 of 90Next »
k.r123 days ago

i am running raspbian. can you simply give us

setup-web2py-ubuntu.sh because i am having problem setup apache 2.2 to 2.4 . please uploade somewhere or email me kotarajeshece@gmail.com

qkarthik3 months ago

internal error was made !!!

I have a remote controler where the button "pulls down" the micrcontroller line to the ground when it is pressed (opposite to your case of pulls up).

How can I do the wiring ?

Snellingkorey7 months ago

great idea, can you wire up the kettle and washing machine as well?

don't be silly Snellingkorey, that would take at least 2 Raspberrys and a Strawberry!

ManuelA310 months ago

In my case ,Installing web2py on a raspberry running raspbian, I had to modify a line on setup-web2py-ubuntu.sh


sudo a2ensite default


sudo a2ensite default.conf

Also, the auth types on the default.conf were on apache 2.4 format, whereas the setup script installed me apache 2.2 so I had to make changes according to http://httpd.apache.org/docs/2.4/upgrading.html#ru...

i am running raspbian. can you simply give us

setup-web2py-ubuntu.sh because i am having problem setup apache 2.2 to 2.4 . please uploade somewhere or email me mejlgago@gmail.com

xpark7 months ago

Can u tell me exactly how i can access this server from an outside network?


If I wanted to upscale this to more than just three switches, how would I do that?

davidbarcomb9 months ago

Great instructable, detailed and well explained. Keep up the good work

lzkill10 months ago

Hi pals!

The resistor used on this project are dependent on the RF controller? Why were these picked?

KentR210 months ago

How could i set this up to run locally, that is running the program directly on the pi without internet acess?

aswinmp10 months ago

My project is home automation and CCTV. After doing the cctv function using pi, we did the automation part. Upto step 7, everything went perfectly. After that, I cannot access pi using ssh or remote desktop. And I cannot access the web page.

What to do? Please help me!

I had trouble installing web2py but I think I got it solved by using this script instead:


and then running this at startup:

sudo uwsgi --master --die-on-term --emperor /etc/uwsgi --logto /var/log/uwsgi/uwsgi.log &

OliverL12 months ago


I have ssl problem :Hibakód: ERR_SSL_PROTOCOL_ERROR.

I use Chrome and Explorer, the problem is in both.

I have no idea :-(

Nice Job!!

Very detailed guide.

GeorgeB11 year ago

where do you download the home lights package

Hi matey, i'm from Australia and i need this model for a demo. can you please let me know if it is possible for you to post me a working model (whole kit) and guide me to make it work.Please, respond to this message on my email "rohitgoudponnam@gmail.com" is my gmail id.

Thanks and Regards


We already developed piece of hardware for home control. There are relays, digital inputs, 1wire, EEPROM, 0-10V.....

check indiegogo project:


Samginoya1 year ago


wen i write this in pi terminal :

sudo python /home/www-data/web2py/applications/Home_Lights/modules/GPIOServer.py

it show me:

python: can't open file '/home/www-data/web2py/applications/Home_Lights/modules/GPIOServer.py':

[Errno 2] No such file or directory

BennyTC1 year ago

that is a typo, delay there is 2 seconds :P

BennyTC1 year ago

Awesome project!
I intend to use it to control a door buzzer, so I added 5 second delay.

I had to change swap the output from "1" to "0", because I am using a brandless 8-relay board which operates as Active LOW (relays are turned on when output is "0").

In the hope it is of help to anyone, this is what I did:

changed the GPIOClient.py file's line 13 to this:

ON = chr(0)

and added the following lines to the GPIOServer.py file

line 3:

import time

line 12:

SleepTimeL =2

line 23: (this is after GPIO.output(pin,val))


cartiman1 year ago

I use the raspberry pi from china (red color), what can?


sadhvi1 year ago


we are interested in doing the home lighting automation which takes care of the central lighting system. so, could you please suggest how to proceed with the project.

email-id: nangunoorilaxmijoythi1@gmail.com


losgat1 year ago

Hi have it all setup and working as expected but is there any way to change the output for relays and not single button press applications ( using a relay that need to be powered constantly?

Traceback (most recent call last):

File "/home/www-data/web2py/applications/Home_Lights/modules/GPIOServer.py", line 29, in <module>


File "/usr/lib/python2.7/socket.py", line 224, in meth

return getattr(self._sock,name)(*args)

socket.error: [Errno 99] Cannot assign requested address


//What should I do with this error??Please Help..:)

gaelreinaudi made it!1 year ago

cool introduction!

peecee781 year ago

Hey - does anyone managed to adopt this web interface to work with 8 channel relay?

I wired it but on relay all i get is just a blink of LED i try to edit the settings - same result...

Please help

i think in your case the input voltage is not enough for the relay board so double check your input volt.

Sweeet!! Everything works except i have to be at home connected to my wi-fi for it to work. is that supposed to be that way?

amrnablus1 year ago

I have a question.

If i want to automate lights or AC, should this device be controllable via a remote controller in the first place or it's possible to do it with any hardware.

icemeth1 year ago

i have a problem in setting up the web2py setup. when i type sudo ./setup-web2py-ubuntu.sh it has and error and it says cannot find file destination though i have downloaded the setup file. and i cant update my raspi it also has an error. is it because i have a dynamic internet connection??pls reply i need your help..thanks

hughjeremy1 year ago
When I connect up the wires, it acts as if the button is being held down, and so it can't define which button is being pressed when multiple buttons are connected.

Long story short no matter if I turn them on or off, it doesn't make a difference!

Help would be so appreciated!
Awesome tutorial and project! Can't wait to fully try it out. I'm having one issue though. I don't have all of the proper hardware yet (I have everything but the remote outlets and a cut ribbon cable). But my problem is once I try to start the GPIOServer.py, it indefinitely says "waiting for connection...". Is this because I have nothing connected to the GPIO pins? I was hoping to run out later and get everything else I need, but I figured I would set everything software-related up first. I'm hoping this is the issue, and not the fact that my pi hates me, haha.

Anyways, thanks in advance for the response and, again, awesome instructable.

- Chronos
andyn5001 year ago
sorry man email is a.nolan@pss.ie

andyn5001 year ago
Hi I am very interested in your project its brilliant. I am new to computers and have very little understanding of electronics. Is there any chance of further instructions for this eg PCB board and what resistors you used if possible. further instructions diagrams etc.
Would be very helpful
Smarty45311 year ago
hello, awesome instruction guide everything is working except for the pictures for the buttons. when i go to the webpage they never shown up. im talking about the power bottons plz help thx
Screen Shot 2013-11-16 at 4.45.38 PM.png
sir,i need your help, can give me all detail about this project? code or anything about this..tq sir
jets_fi2 years ago
Has anyone tried doing this with remotes that are powered by 3v battery? You could power the remote with Pi then, right?

And not to forget thanking willq44 again!
sir,,i am studying b.tech(computers)....i want to do my final project on RASPBERRY PI..can you give the data and code about "Raspberry Pi GPIO home automation" ...if you give it to me then it would be helpful to my project....
my email id is : avinashcme@gmail.com
1-40 of 90Next »