This is a simple project made with the Arduino Uno R3. The aim is to control a door lock without keys, and using a smartphone to accomplish this. The communication medium will be the internet (WiFi module-ESP8266).
I have already posted an tutorial about the same project with bluetooth module,you can refer it for any clarifications. (Click here.)
In this tutorial 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.
1. Arduino UNO R3
To control the servo and interface with the ESP8266 (GPIO pin-0 )
The concept is very simple we are going to control the ESP8266 (GPIO pin 0) from our smartphone 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.
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.
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 MetalThis 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.
This is used only in the making of the project to program the ESP8266 module as it can't be programmed directly from Arduino.
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
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.lua10.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 AddressWhen 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 IDEI have given the coding you can download the file from here.
Upload this code to the ARDUINO!
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.
Step 10: The .aia File for the AppYou can edit the app by using MIT app inventor website.(use import option)
Make sure the following connections are done.
SERVO CONNECTION1.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:
http://randomnerdtutorials.com/esp8266-controlled-with-android-app-mit-app-inventor/
Comments