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:-

  1. 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.

  2. Server: A server is a computer designed to process requests and deliver data to another computer over the internet or a local network


IOT Basic Data Flow Diagram

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:-

  1. Download the Scripting File.

  2. Now Go to your PhpMyAdmin in your Cpanel. and create a database for your project.

  3. Now Upload the Script File to your public_html.

  4. Extract the zip file and open "connection.php" in the Editor.

  5. Now You have to change three things in that connection file, i.e USERNAME, USER PASSWORD, Data Base Name in that Connection file.

  6. Now DOWNLOAD the SQL File.

  7. Import this SQL file to your Phpmyadmin Data Base.

  8. Now browse your desired file location in the Web browser, then you will find a Login Panel For that use "" as ID and "12345" as a password.

  9. 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.

Part's Required:-

  1. Node MCU.

  2. 4 channel Relay Board.

  3. Jumper Wire

  4. 5v Power Supply.


  1. Now First Of all Download the Arduino Code.

  2. Now Open the Arduino code in your Arduino IDE. Change your Wifi SSID, and Password in the Arduino Code. and your Domain name with as present in the Arduino Code.

  3. Now Go to Arduino IDE-> FILE -> Prefernces

  4.  Copy ---> " "

  5. Past the above URL in Additional Board Manager Url.

  6. Then Go to Tools-> Boards -> Boards Manager in Arduino IDE and Search for esp8266, and install it in your Arduino IDE.

  7. After installing the Esp8266 module in your Arduino IDE Now again go to Tools -> Boards -> Then select Adafruit HUZZA ESP826 as your Board.

  8. Now Upload the Code to your NodeMCU Module.

  9. Now Connect the D0, D1, D2, D3 of the Node MCU to Data input 1, 2, 3, 4 of the 4 channel relay board.

  10. Now connect VIN of Node MCU and Relay Board Along with their GND and Connect them to the 5v VCC and GND respectively.

  11. 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

Thank you.