Brian Einsweiler

  • Increase font size
  • Default font size
  • Decrease font size

The Over-Engineered Garage Door Opener, Phase 1

E-mail Print PDF

I finally started working in earnest on a new electronics project today. It was inspired by a discussion with one of my neighbors several months ago about forgetting to close the garage door and cases where the door seemed to be closing, but it reopened after driving away. Most people I've talked with have similar stories. Not only is leaving the garage door open responsible for causing increased utility usage in neighborhoods like mine with attached garages, but it also leaves your house a wide open target for theft.

A few months ago I got a Raspberry Pi embedded computer system, and I figured this would be a fun project to learn about lots of new things that I only have minimal experience with:

  • Relays and sensors
  • Web applications and security
  • Android application development
  • Python script language

Today I got the basic part of the project up and running. I'm able to remotely run a simple script on the Raspberry Pi that can open or close my garage door.

I started with the basic Raspberry Pi board and also purchased the following pieces:

EDIMax EW-7811Un USB Wireless Network Adapter: This is a very small, low powered WiFi adpater that plugs into one of the Raspberry Pi's USB sockets so I don't have to run an Ethernet wire out to my garage. It turned out to be surprisingly cheap and easy to set up.

SainSmart 4-channel Relay Module: If you're not familiar with what relays are, They're basically switches that can be controlled by the outputs of the Raspberry Pi, but also serve to isolate the higher power/voltage requirements of the external devices from the lower powered and fairly delicate logic on the Raspberry Pi board. I will only need one channel for the garage door project, but I have a couple other ideas for things that can be controlled using the other channels.

Wiring the relay to the Raspberry Pi board was very straightforward. I removed the jumper from the relay board that connects Vcc and JDVcc together since the relay requires 5V on JDVcc, but the Raspberry Pi only has 3.3V tolerant IO pads. Technically, Vcc is specified at 5V for the relays also, but they seem to function just fine from the 3.3V IOs. It was just a matter of wiring JDVcc to the 5V pin, Vcc to the 3.3V pin, IN1 to a GPIO pin (I chose GPIO17, pin 11, for no particular reason), and Ground to Ground.

Right now I have alligator clip test leads for all these connections, but will make the wiring more durable and permanent later on in the project.



The next part was figuring out how to activate the garage door opener. It wasn't documented in my garage door opener's reference manual, but it turns out that most garage doors are operated simply by shorting to the two wires together when the button is pressed. That made wiring the relay to the garage door opener switch very easy. I just connected a wire to each of the terminals on the back of the wall-mounted garage door opener and connected them across the normally-open inputs of the relay.


It's not pretty yet, but I'll clean it up once I get all the functionality implemented.

Now that all the wiring was done, I needed to control the GPIO of the Raspberry Pi to turn the relay on and off to activate the garage door opener. It turns out that the Linux distributions that are available from Raspberry Pi have a nice GPIO library pre-installed and it's a piece of cake to write a simple Python script to activate the GPIO pins.

#!usr/bin/env python

import RPi.GPIO as GPIO, time

GPIO.setup(11, GPIO.OUT)

GPIO.output(11, GPIO.HIGH)
GPIO.output(11, GPIO.LOW)


Really, that's it! This configures the GPIO library to address the GPIOs by pin number on the board (I've connected the relay to pin 11), sets it up as an output, then turns it on for 1 second and turns it back off.  This results in the garage door opener behaving the same as if you had pushed the button for 1 second and then released it. The 1 second wait seems to work well with my opener, but might vary for others.

Right now I can SSH (secure remote terminal) to the Raspberry Pi from my phone or my computer and control the garage door from anywhere I have internet access.



This is just the starting point of the project. I still have a few goals to accomplish before I'm done:


  • Add a couple of sensors to the garage door so the Raspberry Pi can determine if it is open or closed
  • Make an easy Android App front-end that can operate the door and show its current state
  • Send an alert notification if the door has been open for longer than a pre-configured amount of time
  • Figure out how to make all this network communication secure
Any other ideas on fun features that could be added?
Last Updated on Friday, 20 June 2014 14:19  


#1 Em 2013-09-08 13:47
I love you, Brian. And I love that my lifelong friend is a complete nerd. This is so you. I give you 154.12@#$xlk scary angel points.
#2 Charles McLaughlin 2013-09-19 18:39
Very nice! Can the Pi actually tell if the door is open or closed? I don't see how that would be possible, but that's what I want something like this.
#3 Charles McLaughlin 2013-09-19 18:41
Quoting Charles McLaughlin:
Very nice! Can the Pi actually tell if the door is open or closed? I don't see how that would be possible, but that's what I want something like this.

I guess you'd use sensors for that?
#4 Brian Einsweiler 2013-09-19 21:49
Quoting Charles McLaughlin:
Quoting Charles McLaughlin:
Very nice! Can the Pi actually tell if the door is open or closed? I don't see how that would be possible, but that's what I want something like this.

I guess you'd use sensors for that?

Hi Charles, Thanks for stopping by! I ordered a couple of magnetic sensor switches like these: I've tied them into two other GPIO ports on the Pi board and can poll them to see if the switch is open or closed. I'll place one switch so it is closed when the door is raised, and one switch so it is closed when the door is lowered and then I can tell if it is open, closed, or in some intermediate state.
#5 mike 2014-01-22 23:19
This is a great looking project; I'm looking to do the same thing. One thing I would also like is the ability to toggle the light switch (the other button on the same remote). I'd also like a nicer interface on the phone so it's as easy as tapping an app and hitting the button. Another site that has a similar project with maybe a few more bells and whistles (including security) is here:
#6 Ravenfeller 2016-01-23 11:07
:lol: This is AMAZING! I am an Artist and inventor! And was on the search for a wireless control to work from my computer to the garage controller, which is simply using the garage opener motor to run another type of device. It will not be use on an garage door but more for operating a controlled track system. So your work and research is inspiring!
#7 Anemonalove 2017-07-11 13:36
Hi fellas! Who wants to see me live? I have profile at, we can chat, you can watch me live for free, my nickname is Anemonalove , here is my photo:

#8 76Candy 2017-08-08 18:19
Hi admin, i must say you have high quality posts here. Your page can go viral.

You need initial traffic only. How to get it? Search
for: Mertiso's tips go viral

Add comment

Security code