Raspberry Pi Garage Door opener

I built a fairly simply garage door opener using a Raspberry Pi and a relay. You should be able to just use raspbian out of the box but if you need to install them run sudo apt-get install php libapache2-mod-php -y

I used the following video as the basis for the design initial design.

The major assumption is that your garage door has a hardwired open/close switch which you can hot wire to make this work. Without that, you are wasting your time so check first!

Below if the default diagram for a Raspberry Pi 3

The wiring is pretty simple, I’m using pins 2 and 6 as 5V power and then Pin 17 as the latch / action relay for relay 1.

The basic webpage is just a set of buttons to do the following.

Open/Close the door
Open the door for my cat Mooska
Open then close the door for my cat

In the example we’ll just focus on the Door open.

The first garage.php page is just the buttons to call a php page to trigger the python.

This page is called relay.php

Then you have the actual python script which I was going to setup to also turn on the outside garage light (pin 23) but I ended up just leaving it at pin 17. This is called relay.py.

The above is just the file examples for the open/close process but all the files are in the zip files attached.