Simple Garage Door Hack




About: To learn is to live!

After being accidentally locked out of my house on more than one occasion, I decided that there had to be better way to entering my home that did not involve breaking and entering (and without hiding a key outside somewhere).

On taking a look at my garage door set-up I noticed that the motor to open the garage door could be activated by simply short-circuiting two contacts. On seeing this I realised that a very simply solution would be to connect an esp8266 to a relay that I could then trigger (to open or close the door) by connecting to the esp8266 controller using my mobile phone.

Step 1: Materials, Tools & Software



  • Soldering Iron
  • Solder
  • Heat-shrink tubing
  • Wire-strippers
  • Connecting wire
  • 3D Printer
  • Star screwdriver
  • Pliers


Step 2: Coding

The following library was added to the Arduino IDE: Also if you have not already added the esp8266 library then this needs to be done as follows:

  • Go to File > Preferences. In the "Additional Boards Manager URLs" field, type (or copy-paste) and click ok.
  • Then go to Tools > Board > Board Manager. Type "esp8266"
    in the search field. The entry "esp8266 by ESP8266 Community" should appear. Click that entry and look for the install button on the lower right.

Not much more needs to be added here other than the code I used (GarageDoorHack-Final attached) was taken from and modified slightly to accommodate what I needed to do i.e. to briefly trigger a relay when a button was click.

With reference to the code, make sure that you update the following lines to reflect your wireless SSID and PASSWORD:

  • static const char ssid[] = "SSID";
  • static const char password[] = "PASSWORD";

using the serial monitor (once you have uploaded the code) you will be able to see what IP is allocated to the NodeMCU.

One last point that is worth noting is that my NodeMCU board appeared to have the pins assigned differently to what is mentioned online i.e. my GPIO05 was pin 5 where as the the online reference that I was using said that it was 1 (or maybe my GPIO pins where assembled in a different order). Whatever the case, I had to use some trial and error before a could determine which pin was actually GPIO5.

Step 3: Putting It All Together

Steps followed:

  • I clipped off all the NodeMCU pins that I was not using (yes I could have unsoldered them but I found this easier).
  • Soldered connecting wires onto the relevant pins (as be diagrams and photos above), using heat-shrink tubing to insulate the connections.
  • 3D Printed the case (STL files attached; the FCSTD file is the FreeCAD file).
  • Screwed the NodeMCU board down. The screws that I had were too long and so a used pliers to snip them shorter.
  • Pushed the top of the relay into the square holder in the lid which held it firmly in place. The orientation was such that the relay contacts faced the wire exit hole in the lid.
  • Attached the lid and screwed it closed.
  • Connected the relay wires to the garage door motor terminals.
  • Plugged the project into the USB power source.
  • Waited for the NodeMCU to authenticate with the wireless.
  • Browsed to the IP address from my phone.
  • Tested by pressing the button.

The threaded screws that I had worked well but self-tapping ones would have been easier to work with.

Step 4: Final Comments

The following falls outside the scope of this Instructable but are worth discussing:

IP Address

By default your router will issue random IP Addresses meaning that your device might not always have the same IP which would then make it very difficult to find and access from your phone. It is therefore important that you assign it a fixed IP. There are two main ways to do this, each with their own pros and cons. My preference is to allow the router's DHCP server to do this. The general steps to follow when using this method are:

  1. Log onto your router as an admin.
  2. Look at the DHCP logs and record the MAC address associated with the IP address that was issued to your NodeMCU.
  3. Find the menu option that allows you to set IP reservations. Here you will be able to specify a MAC address and the IP that you wish this MAC address to always to get.

I usually do the above as early as possible in my projects.

Creating a shortcut on your phone

  • Make sure that you are connected to the same wireless network as your device.
  • With the IP address now fixed you should be able to browse to it on your phone.
  • Save the IP as a bookmark.
  • Save the bookmark to your phone's home page.


Anyone connected to your wireless network will be able to browse to this IP and trigger the relay. To do this they will then have to know your Wireless SSID and password. For the average user this is probably enough security. If you wanted a higher level of security you could implement some sort of MAC filtering on your router or a standalone server or you could try a two-factor authentication approach. This said, if someone knows how to hack your network then they probably know how to hack all of the above solutions too. Further if they are really that keen to get in they will probably simply break in.

In short if you live in a low risk environment then you probably have nothing to fear. On the other hand if you live in a high risk environment then you probably have more important things to worry about and a garage door hack.

Having said all of this, the following project is more of a proof-of-concept project and not meant as a full-scale production implementation. Anyone implementing this project does so at their own risk.

Closing comments

Sometimes the connection to the NodeMCU appears to get lost. When this happens you just need to refresh the webpage and it should reconnect successfully.

And lastly, instead of connecting the controller directly onto the door motor, I could have wired it in parallel with the manual switch in the garage. While this would have enabled me to hide the circuitry in the wall, I would have then had to make another plan with respect to powering the device. The power issue would have been relatively easy to solve but for the time being I did not feel that the effort would be worthwhile.

All in all this is a simple and cheap project that I enjoyed completing.



    • Trash to Treasure

      Trash to Treasure
    • Arduino Contest 2019

      Arduino Contest 2019
    • Tape Contest

      Tape Contest

    24 Discussions


    24 days ago

    Last I was aware openers came with remotes ( optional keychain remote) , a keypad and automatic phone connection. Hmmm

    2 replies

    Reply 16 days ago

    Ours only has two remote that I don't want to have to carry around. It's an old system hence no phone connection or keypad. My solution gives anyone in my family/friends group the possibility of entering without needing remotes or numeric codes. This said yip there are flashier solutions out there but maybe not at my price point :)


    Reply 23 days ago

    Yes you are 100% correct. I have two of them but I don't carry them; just makes my keys too bulky. I do always have my phone though :)


    Question 24 days ago on Introduction

    Great project. Thanks for sharing!

    One question, when triggering the relay to open/close the door, do you simply toggle the relay, or does it require both an open and close to trigger the door?

    2 answers

    Reply 16 days ago

    Simply toggle the relay :)


    Answer 24 days ago

    Glad that you enjoyed the project.

    I am not sure if all garage door motors work the same but mine works as follows: A single press and the motor engages. If the Door is closed it starts opening, if it is opening it stops, if it is half open then it starts going again in the opposite direction to what it was going. If open fully then the motor will start the close action. In short all that is needed is a single quick short. This is why I only activate the relay for half a second and the button is labelled "Open/Close".


    22 days ago

    Modern garage door openers do not operate with a single contact, they are much more intelligent and anyway, they include a wireless connection using a smart phone application. This works only for old systems. They also are sold with a keypad.

    1 reply

    Reply 16 days ago

    No, my new garage door has 2 contacts on the main board with are for "test" and simply shorting them operates the door. So this instructable is quite valid. Well done Abasel!


    Tip 22 days ago on Step 4

    Great project. I had built something similar with a MQTT subscription, which then allows you to run mosquitto and Homebridge on a Paspberry Pi for iOS & Siri door open & close.
    One other suggestion: I successfully added a reed switch to the door and wired that into the ESP to show if the door is open or closed: handy if you forget to close it when you go to sleep and couldn't remember if you left the door open.
    On you're losing connection - make sure to check your wifi connection status every 30 seconds in loop() and and force a reconnection.

    2 replies

    Reply 18 days ago

    Nice project, but it relies on WIFI being always active in the home. A more elegant project would make use of Photon or other phone conection method, and connect directly to the GSM network at both ends.


    Reply 22 days ago

    Cool; also thanks for the connection suggestion.


    Reply 22 days ago

    Yeah that would be even better; thanks for sharing :)


    22 days ago

    The clever suggestions as to why you should not even have done this project aside, I thought it was a very nicely done step by step project for showing how to use the NodeMCU. Great Work!


    23 days ago on Step 4

    assuming you have your phone!

    Another interesting method - would be to put a microphone type sensor onto one of the door panels, and then program a custom knock code - number of knocks, spacing between knocks. This way random noises wouldn't trigger your garage - and wouldn't have your current sensor depend on the internet / home network - and still be fairly cheap

    2 replies

    Reply 23 days ago

    I like the idea :) Although you would then need to run a cable to the door. You would also need to knock quietly so that the neighbors don't hear (well that is if you live in a high density area). But as a concept; I think I will think more about this one :) Thanks


    Reply 22 days ago

    Less secure though, since most codes are just 4digits. And dust forms on the keys. Or UV sensitive ink.

    Plus if someone breaks this they can go after them using the CFPA I think? It's like a billion dollar fine or something (less legal trouble to just take a zip saw to your door)


    Reply 24 days ago

    Possibly a nicer solution but not easier and also not as cheap. This project cost me under $5 (USD) and required no modification to my front door or its surrounds.