ESP8266 Garage Door Opener
by JKolegraff in Circuits > Wireless
15612 Views, 55 Favorites, 0 Comments
ESP8266 Garage Door Opener
!!!!!!!!! Warning it will oscillate if you fallow the other tutorials!!!!!!!!!!!
I tried the transistor and also using the opto-isolator connected to ground but both pull the ESP too close to ground, it shorts out and will keep resetting itself. For the others I tried the PNP transitor, and it pulls to much current and also keeps resetting the ESP.
!!!!!!!!!!!!!!!!!!!!
A simple low cost wireless garage door opener, only a couple parts need to be purchased, and can be expanded to control up to two doors with only a couple lines of code change and another optocoupler added.
Need to Flash ESP8266
go to
and click on nodemcu-flasher and download
fallow the diagram to connect the esp8266 to your usb to serial adapter
This adapter I found(ebay) to be easy to install and was able to find drivers without any problems.
USB 2.0 to TTL UART Module 5pin Serial Converter CP2102 STC Replace FT232
run the program and flash, dont worry about changing anything just open and flash.
Now Program the Esp8266
You can use lua uploader, or Esplorer. Both work great and are ready to work with the esp
Dont forget the un-ground the gpio0 pin but keep everything else the same between the esp and the usb to serial
Upload the code below to the esp
========================================================================
--Garage Opener Code
wifi.setmode(wifi.STATION);
wifi.sta.config ( "2WIRE713" , "0369559266" ); wifi.sta.setip({ip="192.168.1.200",netmask="255.255.255.0",gateway="192.168.1.254"});
gpio.mode(3, gpio.OUTPUT);
gpio.write(3, gpio.HIGH);
-- A simple http server srv=net.createServer(net.TCP); srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
--print(payload);
gpio.write(3, gpio.LOW);
tmr.alarm(0, 1000, 0, function()
gpio.write(3, gpio.HIGH);
end )
conn:send("Opening Garage");
end)
conn:on("sent",function(conn) conn:close() end)
end)
=======================================================================
The line
wifi.sta.config ( "2WIRE713" , "0369559266" );
this is your current wifi name and password needed to make sure the garage door opener is secure
and the line
wifi.sta.setip({ip="192.168.1.200",netmask="255.255.255.0",gateway="192.168.1.254"});
this sets up the esp to be a static ip on my network so I dont have to guess what the ip will be
Connect and Run
Go ahead and connect you esp with the above diagram and turn on.
make sure your phone is set to connect to your home network automaticaly
go to your web browser on your phone and go to the ip address you assigned it. in the code example it is 192.168.1.200
save it to your bookmarks once you varified it works and save a shortcut to you phones desktop and every time you click the shortcut it will open the garage.
Enjoy!!!