Introduction: Garage Door Opener With Feedback Using Esp8266 As Web Server.

About: Hi, i'm electronic technician but it's my hobby too. I like to do and try many projects just for fun :)


I'll show you how to make a simple way to do a garage door opener.

-ESP8266 is coded as web server, door can be open everywhere in the world

-With feedback, you will know is the door is open or close in real time

-Simple, only one shortcut to make in your phone.

-Password protected

-Cheap, under 10$

-No Dominicz to setup.

-Without activating the door when power is lost and come back

I searched on internet and found some code but not exactly what i was looking for, So i modified some other code and idea + my personal experience + thanks to my son, he really help me on this one. The real time part is from him.

So let's begin!

Step 1: Buy the Hardware

You will need an esp8266 board and a relay board.

On ebay do a search: NodeMCU ESP8266 and relay module board

Relay module can be simple or double but we are using only one relay.

It's all you need!

Step 2: Install Arduino Software and Program the Esp8266

Here is a very good way to install arduino ide. You can do step 1 to 12

Unzip the file and program your esp8266 with the code Garage_door_yt.ino

You will have some variable to change in the ino file.

-SSID and router password to connect in your web server.

-Also, you can change the port as you wish. exemple: WiFiServer server(54195)

-The password: Find and replace Passw0rd to your password as you wish in the .ino file.

-Added a closing time. Each day at exact time the door will close if it is open. (GarageDoor2.rar)

Start the serial monitor in arduino. Tool, Serial Monitor. You will see more detail and also the web server local ip address. You need the local ip address to enter this in a web browser.

For exemple, if your web server ip adress is enter this:



http://ip-address:port/Password (router ip adresse)

In the code you can change everything as you wish.

I suggest to reserve this ip address in your router. This way, your phone shortcut will always be working. If not, router bail is often 30 days and ip address will change.


This shortcut is working on your intranet only. If you want to open your garage door remotely on internet, worldwide, this is how to do it:

1- You must know your public ip address. Enter what's my ip in google and you will know this.

2-You must do a port forwarding in your router. In our case the port is 54195. So in my router i forward port 54195 to my server ip address You can google for port forwarding for more details.

3-For exemple. If my public ip address is I must enter to see the web page.


Access the web server without know your public address:

Most of service provider are given you an ip address just for a while. And this address change over time.

You can subscribe to no-ip for free and have a public address always working everywhere.

Just to go to and sign up


Important: If you are at home with wifi enabled, your internet shortcut will not works. So, on my phone i have 2 shortcuts. An intranet and an internet shortcut. I have both. If I am on my lan, I use the intranet and if I'm outside on lte(4g) I'm using the internet shortcut.

Step 3: Install the Boards

Here i'm using a double side tape to fix my boards.

Step 4: Wiring Diagram, Very Simple.

For Power supply, you can use an android telephone charger. It's cheap and perfert.

You must connect the relay board to 5V. Avoid to use 3.3v. Sometime, it can works but the coils sre made for 5v.

The upper red line show where to solder the wire, at the regulator input.

D1 is the output. This pin must goes into the relay board input. This pin is always HIGH (3.3v). When activate, this one go LOW (0v) for 0,5 second to activate the coil.

D2 is the input to sense the door. If LOW (0v) the door is closed. If not, it's open.

Be aware, this input (D2) is an input of 3,3v. The internal pull up is activate.

On my side, my garage motor input give me 5v. His internal pull-up are probably also activate. I connected together anyway and i dont have any problem. Just make sure, not enter higher than 5v on this pin. Use your multi-meter to check the input of your garage door. If this one is too higher than 5v, you will have 2 choices:

1-make a circuit divider with 2 resistors

2-install a separate magnet switch


ALSO ATTENTION to the polarity when connecting the relay board to the garage opener. ALWAYS put the esp8266 gnd to the garage motor operner gnd or common.


Step 5: Some More Pictures

This is my garage opener. Old but yet working :)

As you can see, i connected the relay board to the garage door push button and D2 input to Close limit.

Check on your garage opener, you will find something similar.

Step 6: Test Before Connect Everything