Sometimes you have your hands full of bags, umbrellas, etc.Â In these cases it would be useful to open the door without keys,Â simply finishing ahead.
My idea is to use a smartphone to trigger the opening of the door, using a microcontroller inside myÂ house and an application on the cloud to manage the communications of the system.
For my jobs experience, I know very well that with a RaspberryPI + wifi (45$) or anÂ Arduino YÃ¹n (60$) the project is feasible, but:
- my challenge is implement the whole system with a cost lower than 10$
- It is a waste to use an entire operating system to push a button
So, I choose theÂ well knownÂ ESP8266 module.
- 1 ESP8266 dev board like NodeMCU (~8$)
- 1 RelayÂ (~1$)
- NodeJS application on Azure websitesÂ (0$)
I bought all the hardware on my favourite chinese mall Bangood.
How it works
- On the cloud there is a NodeJS app (websocket server + http server)
- The ESP8266 board is connected to NodeJS app via websocket, using my home wifi network
- When certain conditions are met, the smartphone makes a HTTP requestÂ toÂ NodeJS app
- When NodeJS app receive specific http request, send a command to the websocket
- TheÂ ESP8266 board receive the command instantly (< 0.2s) and activate the relay digital pin
- The Relay receive current and trigger the switch on the intercom
- The door is unlocked
Soon publish the code on Github for both ESP8266 and NodeJS apps
At the beginning I wantedÂ bypass entirely the intercom, but afterÂ few attempt I realize that the intercom protocol is not well documented. Audio, video and signal all on 2 wire at 26-28V. Definitely easierÂ to simulate the press on the intercom button using a relay.
After write the Esp8266 code with Arduino, I wrote the server parte with NodeJS and a webpage.
From an architectural perspective the initial system is composed by a single server and two client (Esp8266 and Smartphone) that communicating with a persistent connection (websocket).
Due to the websocket connection limit of free azure websites (max 5 connection) an other economic considerations, I upgrade the system to limit the websocket connection only to the indispensable Esp8266 side, letting the smartphone using classicÂ HTTPÂ requests to send commands to the server.
I buildÂ a webpage with a on/off butto to test the system, and it works! After 2 weeks of continuous running without any problem, I am fully satisfied: I can open my door with a touch on my smartphone.
ButÂ it would be great if I could open the door without touching the smartphone. So I started to investigate the conditions and technologies to upgrade the system the next level.
As often happens, any simplification for the user adds layers of complexity to the system, and theÂ variables become many:
- location (gps and wifi based)
- walk paths
- hours of the day
- days of the week
- wifi ssid available
- network to which my mobile phone is connected
The approach based on a web page was no longer sufficient: i switch to native app.
7 Replies to “ESP8266: Smartphone door opener for less then 10$”
hi. any closer to getting this on github? i’ve just sat down to do exactly the same thing but interfacing with my burglar alarm remote. cheers
I do have a question; do you use a bootstrap for node.js?
Can jo publish the code for esp and note.js for the learning factor
Hi, I am wondering how you can access to your ESP8266 IP when you are away from your router. e.g. your office using different router and your ESP is at home.
Most of garage doors already have relay, so you probably need only a ESP8266 and connect it to the door rely, Right ?
Right! If your garage door have a 5V relay, you need only an ESP8266. You can check the voltage of your relay with a voltmeter
Hello, I really like this proyect, could you publish the code?
i also have a two wire setup and im trying to figure out what you connected to as the COM connection, that is a common link to close the circuit. the module im using requires an “in” (COM) connection that would be used to “close” the open circuit.