Hello everyone. Today I want to show you how you can build your own Garage Door Opener which will allow you to open your Garage Door by simply pressing a button on a website. Pretty cool, huh? What we will basically do is setup a computer controlled push switch/button. A pretty good explanation can be found here.
Okay let´s do this. These are the things you will need:
- A Raspberry Pi Model B (Plus power adapter, SD card and a LAN cable)
- Raspbian wheezy as Operating System. You can download it from here.
- A Raspberry Pi Relay (like this one here) or a transistor (It should work exactly the same but I did not try it out) – I recommend to use a relay since they are not very expensive and you can use them to work with higher currents and voltages. If you use a relay for this project you can reuse the same hardware to create an intelligent AC light switch without making any changes to the hardware. All you would need to do would be to change some fragments of the custom.html code from this post.
The hardware setup is pretty simple. Take you Raspberry Pi and connect it to you Raspberry Pi relay like this:
- Connect one 5V Power Pin to the relay´s VCC Pin
- Connect one Ground Pin to the relay´s GND Pin
- Connect the GPIO 17 Pin (You can use any GPIO Pin you want but for this project I used GPIO Pin 17) to the relay´s IN1 Pin
Now connect you relay to your Garage Door Control as if you would add a new push switch/button. Wire the relay like this:
- Connect one wire from your Garage Door Control to the relay´s COM contact
- Connect the other wire from your Garage Door Control to the relay´s NO contact
There are some great tutorials out there which explain how to set up electric Garage Door Openers (like this one here) so if you have trouble have a look at them. All Garage Door Openers work pretty much the same.
That´s it. You have finished the Hardware setup.
Now the Software Setup. This will be easy too.
The first thing you need to do is to update your Raspberry Pi:
sudo apt-get update sudo apt-get upgrade
Now you need to download WebIOPi:
Unpack the archive file:
tar xvzf WebIOPi-0.6.0.tar.gz
Change into the newly created directory:
And run the WebIOPi setup: (This will take some time)
After the setup has finished you can run WebIOPi by running the following command:
sudo python -m webiopi
Now you should be able to access the WebIOPi web interface by entering the following URL into your Browser: (Default User: webiopi and Default Password: raspberry)
Now end the execution of WebIOPi by hitting Ctrl+C.
Since we want WebIOPi to be always available we need to run the below command to make sure that it will be started at boot:
sudo update-rc.d webiopi defaults
Now reboot your Raspberry Pi:
If you can access WebIOPi´s web interface after the reboot everything is working correctly.
The next thing I did was to create a directory where I store my custom made code for my project:
sudo mkdir /usr/share/webiopi/htdocs/custom
And here is my code:
To access the custom.html page simply enter the following URL into your Browser:
Well, that´s it. Now everything is ready to use. Pretty simple isn´t it?
Please make sure to secure the network you are using to access this control website and make sure to change the user and password of webiopi to make sure that only you can open your Garage Door and to prevent theft. Please take care not to damage your belongings when trying to set this up. I will not take responsibility for any damages or problems when you use these instructions to set this up for yourself. Do this on your own risk. And please try not to get hurt.
Of course you can have my source code as always. You can find it here.
I hope my post was useful for you and I hope to see you again next time 🙂