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
#9 RobertFef 2018-05-06 03:52
cialis 5 mg para diabeticos purchasing cialis on the internet cialis wir preise cialis 20 mg
#10 cialis canada 2018-05-07 09:40
You've made your stand pretty well!.
precios cialis peru viagra vs cialis vs levitra
viagra generic online pharmacy Viagra lowest price
#11 cialis pills 2018-05-07 10:07
Lovely content, Cheers.
enter site 20 mg cialis cost cialis canada
where do you buy viagra Viagra generico
#12 buy cialis online 2018-05-07 10:20
Wow loads of superb data.
200 cialis coupon viagra cialis levitra
pharmacy order online Tadalafil 20 mg
#13 cialis for daily use 2018-05-07 10:33
Wow many of helpful data.
cialis arginine interactio cialis without a doctor's prescription
where to buy viagra in stores Viagra pills
#14 cialis coupon 2018-05-07 10:47
Nicely put, Thanks a lot!
cialis canada on line cialis pills
where to buy real viagra online Viagra generico
#15 sialis 2018-05-07 11:00
Lovely facts. Thanks!
cialis ahumada generic for cialis
generic viagra buy online Viagra great britain
#16 low cost cialis 20mg 2018-05-07 11:13
Thanks! Quite a lot of facts.

generic cialis at walmart buy generic cialis
how to buy viagra cheap Tadalafil tablets
#17 discount cialis 2018-05-07 11:27
Terrific information. Thank you!
we use it cialis online store discount cialis
buy original viagra Viagra or viagra
#18 cialis from canada 2018-05-07 11:53
Kudos, A good amount of posts.

tadalafil 20 mg tadalafil 20mg
sildenafil uk online Viagra 20 mg
#19 buy cialis 2018-05-07 12:20
Effectively voiced genuinely! .
buying cialis on internet cialis uk
buying generic viagra Viagra lowest price
#20 cialis alternative 2018-05-07 12:47
Kudos, Loads of stuff!

safe dosage for cialis cialis 5mg prix
generic viagra online pharmacy Viagra pills

Add comment

Security code