Introduction: ESP8266 WIFI Garage Door Remote

About: For work I am a scientific instrumentation consultant and my hobbies are woodworking, electronics, gardening, etc ... anything that serves as a creative outlet.

We use our garage more like a main entrance to the house, because using the actual front entrance tracks a lot of dirt into the house due to the poor layout. During the rainy season here on the west coast of Canada it's even worse. Our garage door opener only came with two remotes and while we can buy more remotes, I thought it would be better to have a WIFI based remote that can be used from a smartphone. I didn't want a WIFI enabled opener that requires a connection to the manufacture server or anything that could allow the door to be opened remotely (far away from the house). The solution I came up with uses a custom Android app that connects to our WIFI and communicates with an ESP8266 based board that can only connect to our WIFI as well. Once you are within WIFI range of the house, you can use your phone to open the door.

Step 1: Design and Materials

Our garage door opener is a Chamberlain, but I suspect most openers operate in a similar manner. The wall panel control for it simple shorts the two wires that connect to it which signals the opener to activate. These wall panels often have a light switch and lock feature as well, those buttons do not simply short the connection, but send a series of pulses (PWM signals) back the the opener to instruct it what to do (turn on the lights or lock out the remotes). Shorting the wires (what the main switch does) can be accomplished with a relay.

I used the following parts:

  • Wemos D1 R2 ESP8266 board (any ESP8266 dev board would work)
  • JCZ-11 Relay (5V coil)
  • NPN transistor (2N4401)
  • one 10kOhm Resistor
  • one 2.2kOhm Resistor
  • one 1N4148 diode
  • miscellaneous wire
  • prototyping PCB (or make your own)
  • enclosure for board
  • power supply for board

The schematic diagram is from LTSpice (source file attached) and I have also included a Fritzing breadboard drawing for a different visualization. The Fritzing model of the Wemos board I found seems to have some issues. Ignore the dashed lines, only look at the blue wire connections. Of course many other ESP8266 development boards could also be used instead and the included code would require very little modification to work on other boards.

For the enclosure I used a small plastic box (do not use metal, it will shield the WIFI signal). For the power supply I used an old cell phone charger and replaced the end with a suitable connector for the Wemos board.

Since the relay I had available contained a 5V coil and the Wemos board can only output 3.3V on a digital pin, I used a transistor to switch the coil on the relay. I added a pull-down resistor (10kOhm) to ensure the pin is low when the board is powered up and the garage door not accidentally opened. The flyback diode (D1) protects against the voltage spike from the energy stored in the coil when the relay is turn off.

Step 2: Assembling It All

I had a left over PCB from another project that fit the headers for the Wemos board, so I cut it to size and modified it for use. A few holes needed to be drilled and some unwanted traces cut to make it suitable. I soldered all the parts in place and tested the code functionality by turning an LED on and off. As mentioned before, an important feature was that the opener (or LED in the test case) would not activate when the Wemos board powers up.

The Wemos board was programmed using the Arduino IDE and the IP address of the board was fixed (pre-allotted) to 192.168.1.120 on the home network. That way when it powers up it will always has the same (internal) IP address and the app can be hard coded with it.

The Android app was created using MIT App Inventor 2. I've only tested it on the phones we have (Oneplus, Xiaomi and Moto G4 Play). It is easily installed by placing it in a shared Google Drive folder and loading it from the phone itself. MIT App Inventor is free to use and the included project file can be easily modified to use a different IP address.

The assembled unit did not entirely fit in side the case I had on hand, so I cut a hole to allow the relay to stick out a bit. I also cut an access hole for the connector to the garage door open wiring.

Step 3: Connecting to the Garage Door Opener

There are two options to connect the wiring to the opener. Option 1 is to connect to the two screw terminals in the wall panel and the other is to connect directly to the opener (push in terminals). I chose the latter, since it was more convenient for me as the wires would run a shorter distance to where I could place my Wemos unit in the garage. There is a wire strip gauge on the opener itself and the small orange tabs below can be used to release the existing wires so the additional set can be twisted with the existing ones and reinserted.

The Wemos board in its enclosure was placed up out of the way so it would not be easily knocked about, since the garage is also my woodworking workshop. It works quite well and I wish I had made this sooner.