In this tutorial, we are going to make a home automation product that can interact with the online Server, So that we can control our home appliances from anywhere along the globe.
Before starting the project lets have a look at some basic factors:-
- IOT: IOT stands for the internet of things.The vast network of devices connected to the Internet, including smartphones and tablets and almost anything with a sensor on it – cars, machines in production plants, jet engines, oil drills, wearable devices, and more. These “things” collect and exchange data.
- Server: A server is a computer designed to process requests and deliver data to another computer over the internet or a local network
In our Normal Home, We have direct access thing our devices using Normal Electric Switches. But such type of Process Requires our Physical presence in the Home to Operate the Device. But When we are not physically present in the home at that time the problem arises. But No need to worry about that problem, due to the advancement of the technology we can control monitor our home appliances from any place. For that, we need a third party. So that we can communicate with our home appliance through that third party. Here we are going to use the server as the third party for us. So for the communication, we have to communicate with the server and then the server will communicate with our home appliances to execute our instructions.
First of all, we have to make a website or app that can communicate with our online server. For you, we have developed a Basic PHP & MYSQL Website that communicates with your online server.
So to make that website online follow these process:-
- Download the Scripting File.
- Now Go to your PhpMyAdmin in your Cpanel. and create a database for your project.
- Now Upload the Script File to your public_html.
- Extract the zip file and open "connection.php" in the Editor.
- Now You have to change three things in that connection file, i.e USERNAME, USER PASSWORD, Data Base Name in that Connection file.
- Now DOWNLOAD the SQL File.
- Import this SQL file to your Phpmyadmin Data Base.
- Now browse your desired file location in the Web browser, then you will find a Login Panel For that use "email@example.com" as ID and "12345" as a password.
- Then you can access the control panel for the Device. Till now we have completed the Software part of this Project. Now let's Jump to the Hardware Part.
- Node MCU.
- 4 channel Relay Board.
- Jumper Wire
- 5v Power Supply.
- Now First Of all Download the Arduino Code.
- Now Open the Arduino code in your Arduino IDE. Change your Wifi SSID, and Password in the Arduino Code. and your Domain name with www.xyz.com as present in the Arduino Code.
- Now Go to Arduino IDE-> FILE -> Prefernces
- Copy ---> " http://arduino.esp8266.com/stable/package_esp8266com_index.json "
- Past the above URL in Additional Board Manager Url.
- Then Go to Tools-> Boards -> Boards Manager in Arduino IDE and Search for esp8266, and install it in your Arduino IDE.
- After installing the Esp8266 module in your Arduino IDE Now again go to Tools -> Boards -> Then select Adafruit HUZZA ESP826 as your Board.
- Now Upload the Code to your NodeMCU Module.
- Now Connect the D0, D1, D2, D3 of the Node MCU to Data input 1, 2, 3, 4 of the 4 channel relay board.
- Now connect VIN of Node MCU and Relay Board Along with their GND and Connect them to the 5v VCC and GND respectively.
- Now Turn on your Wifi. And LOGIN trough the website we have made previously and the turn on/off the slider switch of each device listed there to turn on or off the relay button. And Enjoy Your IOT Project.
Please Like, Share & Comment