General Information Applications Server Routing

ESP8266 Garage door opener

Post Reply
iaot / applications     Views: 968Prev .. Next
ESP8266 Garage door openerPosted: Monday, April 18, 2022 [16:00:04] - 1
rootPosted by:rootMember Since:
June 16 2010
Posts: 357
Automating an old Sears Garage door opener (just as any others) with garage buttons is quite easy.
Switches accessed VIA regular webpage on a local network which makes further automation very easy.

ESP8266 Garage door opener

Wemos ESP8266 D1 mini used in this project and two-channel relays HL-52S V1.0 in a custom housing

ESP8266 Garage door opener
it is all controlled from home automation switches screen

ESP8266 Garage door opener
next - programmingThere's no place like ~
RE: ESP8266 Garage door opener - programmingPosted: Monday, April 18, 2022 [18:48:15] - 2
rootPosted by:rootMember Since:
June 16 2010
Posts: 357
This is a forked code to control two relays:
View Code/*********
This is a fork from work of:
Rui Santos
Complete project details at randomnerdtutorials.com
Controlling two garage doors VIA IAoT
*********/

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

MDNSResponder mdns;

// Replace with your network credentials
const char* ssid = "YOUR_SSID";
const char* password = "SSID_PASSWORD";

ESP8266WebServer server(80);

String webPage = "";

static const int LeftGPIO = D1;
static const int RightGPIO = D2;

void setup(void){
webPage += "<h1>Garage Doors</h1><p><a href=\"left\"><button>Left Gate</button></a> <a href=\"right\"><button>Right Gate</button></a></p>";
// preparing GPIOs
pinMode(LeftGPIO, OUTPUT);
digitalWrite(LeftGPIO, HIGH);

pinMode(RightGPIO, OUTPUT);
digitalWrite(RightGPIO, HIGH);

Serial.begin(115200);
delay(5000);
WiFi.begin(ssid, password);
Serial.println("");

// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());

if (mdns.begin("esp8266", WiFi.localIP())) {
Serial.println("MDNS responder started");
}
// Plain server response without any action
server.on("/", [](){
server.send(200, "text/html", webPage);
});
// Server response is to emulate a button press by shortening connection for half a second
server.on("/left", [](){
server.send(200, "text/html", webPage);
digitalWrite(LeftGPIO, LOW);
delay(500);
digitalWrite(LeftGPIO, HIGH);
delay(1000);
});
// Server response is to emulate a button press by shortening connection for half a second
server.on("/right", [](){
server.send(200, "text/html", webPage);
digitalWrite(RightGPIO, LOW);
delay(500);
digitalWrite(RightGPIO, HIGH);
delay(1000);
});
server.begin();
Serial.println("HTTPserverstarted");
}

void loop(void){
server.handleClient();
}

all this needs is setting-up SSID and SSID Password for your LAN's WiFi.There's no place like ~
RE: ESP8266 Garage door opener - more picturesPosted: Monday, April 18, 2022 [19:20:03] - 3
rootPosted by:rootMember Since:
June 16 2010
Posts: 357
Here is some installation pictures.
Housing for relay module and Wemos ESP8266 D1

ESP8266 Garage door opener - more pictures

ESP8266 Garage door opener - more pictures

Box installed:

ESP8266 Garage door opener - more pictures

Wires from relays connected in parallel to the buttons in garage

ESP8266 Garage door opener - more pictures

Everything works from LAN, Internet and FreePBX by calling home!There's no place like ~
RE: ESP8266 Garage door opener - STL filePosted: Monday, April 18, 2022 [19:32:48] - 4
rootPosted by:rootMember Since:
June 16 2010
Posts: 357
STL file for housing:
www.codemacs.com/download..
can be printed fast at 0.32mm layerThere's no place like ~
Open Gates verified by CameraPosted: Tuesday, December 5, 2023 [22:05:12] - 5
rootPosted by:rootMember Since:
June 16 2010
Posts: 357
ESP32 Cam used to verify open/closed gates:
www.codemacs.com/iaot/app..There's no place like ~
iaot / applicationsPrev .. Next
 
Post Reply
Home - Iaot: General Information Applications Server Routing
Our Telegram Group