Introduction: Wifi Smart Door(simplest Method)
This is a simple project made with the arduino uno R3,the aim is to control a door lock without keys,and using a smart phone to accomplish this,the communication medium will be the internet(wifi module-ESP8266).
I have already posted an instructable about the same project with bluetooth module,you can refer it for any clarifications.(click here).
In this instructable you will be knowing about the simple IOT project of controlling the lock of your door with wifi module.
This is one of the simplest method to use ESP-8266.
Step 1: Collecting the Items Required
1.Arduino UNO R3
to control the servo and interface with the ESP 8266(GPIO pin-0 )
the concept is very simple we are going to control the ESP8266 (GPIO pin 0) from our smart phone with an app.
if GPIO -pin 0
LOW----------------------------------- lock state-closed.
HIGH-----------------------------------lock state-open.
the GPIO pin 0 state will be recognised by arduino using the digitalRead command and does the required operations on the Servo.
Step 2: ESP-8266 Wifi Module
This will help our project to get connected to the cloud.this is very cheap and easy to use.
In this project we will be using only the GPIO pin-0 of the ESP8266.
Step 3: High Torque Servo
to turn the lock lever when signal is sent from the arduino
it is powered by the arduino 5v pin itself and it works well with it.(only when the arduino is powered with usb cable)
Step 4: Sheet Metal
this is used to make the case for the servo motor which allows it to properly hold the motor on the door and the rotating part properly fixed to the lever of the lock.
the case is up to your creativity you can use any other material/thing to make the case. TO HOLD THE MOTOR ON THE DOOR
Step 5: 3.3V FTDI Programmer
This is used only in the making of the project,to program the ESP8266 module as it can't be programmed directly from arduino.
Step 6: Setup for ESP8266
You only need to establish a serial communication between your FTDI programmer and your ESP8266.
Connections:
RX -> TX
TX -> RX
CH_PD -> 3.3V
VCC -> 3.3V
GND -> GND
Step 7: Uploading Code to ESP(simplified Software)
using the ESPlorer IDE which is a program created by 4refr0nt to send commands to your ESP8266.
Follow these instructions to download and install ESPlorer IDE:
1.Click here to download ESPlorer
2.Unzip that folder
3.Go to the main folderRun “ESPlorer.jar” file
4.Open the ESPlorer IDE
5.Connect your FTDI programmer to your computer
6.Select your FTDI programmer port
7.Press Open/Close
8.Select NodeMCU+MicroPtyhon tab
9.Create a new file called init.lua
10.Press Save to ESP
11.Everything that you need to worry about or change is highlighted in red box.
12.Upload the following code into your ESP8266 using the preceding software. Your file should be named “init.lua“.
add your network name (SSID) and password to the script
ADD YOUR WIFI NETWORK NAME(SSID) AND PASSWORD TO THE SCRIPT
Your ESP IP Address
When your ESP8266 restarts, it prints in your serial monitor the ESP IP address. Save that IP address, because you’ll need it later.
Step 8: Coding the Arduino With IDE
I have given the coding you can download the file from here.
upload this code to the ARDUINO!
Step 9: Inventing Your Own App
you can create one by your own by referring to the images provided above.
you can also download the app from here and install to your android phone.
It’s very easy to configure. Click the button “Set IP Address” on the bottom of the screen and type your IP address.
Attachments
Step 10: The .aia File for the App
you can edit the app by using MIT app inventor website.(use import option)
Attachments
Step 11: Assembly!
make sure the following connections are done.
SERVO CONNECTION
1.orange-----arduino pin 2
2.red-------5v pin in arduino
3.brown------ground pin in arduino
finally connect your ESP 8266 (GPIO pin 0) to digital pin 5 of the arduino.
ALL SET! IT's time to test your project and debug if any errors.
hope you like it !!!
REFERENCE:
I have referred the following website in the making and publishing of my project,
1. http://randomnerdtutorials.com/esp8266-controlled-with-android-app-mit-app-inventor/

Participated in the
Wireless Contest

Participated in the
Make It Move Contest 2017
10 Comments
1 year ago
almost same with your project, i've built Wifi door lock with ESP8266, you guys wanna see my job, can see it here my channel https://www.youtube.com/watch?v=R5EEWkRAt_4
2 years ago
Can this lock be controlled from a large distance i.e., outside the house.
Question 4 years ago on Step 7
hello there , im following your guide but the init.lua code doesnt seem to work at all? i keep getting errors whenever i send it to my esp .
Question 5 years ago on Step 7
.Upload the following code into your ESP8266 using the preceding software. Your file should be named “init.lua“.
where is the code
5 years ago
Nice work!
I made a somewhat similar proximity triggered servo device that only requires the controlling phone to have its built-in hotspot enabled:
https://www.instructables.com/id/Versatile-NearBot/
It could automatically unlock and re-lock a door latch as *only you* pass by, shut off a sprinkler valve so you can pass through the water unscathed like a sort of suburban Moses, lower speaker volume while you are in the garage band room, trigger a iPod playing a dramatic entry tune or tell a joke while you are in the room, or pause a movie when you get up to use the restroom.
5 years ago
I'm curious as to why these projects require connection to an external network. Is it not possible to use the ESP8266 as an access point? Wouldn't this allow for wifi connection to it in places where another network is not available?
5 years ago
Where is the .aia? I didn´t find it
Reply 5 years ago
I have updated the instructable by providing the .aia file in step 10 try it now!.
i guess the comments section doesn`t support any files but only images
Reply 5 years ago
i uploaded the file but something has went wrong,let me check!
5 years ago
Sorry, I meant "share"