Overview: Home Automation using ESP8266 Web Server

In this project, we learn how to make IoT Based Home Automation using ESP8266 Web Server. By Home Automation we mean controlling lighting and appliances without any manual switch but using a system that is connected to the Internet. When connected to the Internet, home devices are an important constituent of the Internet of Things (“IoT”).

In this project, we will be using a Local Web Server. A web server is a device that runs websites. It’s a program or a bunch of code that distributes web pages as they are requisitioned. The basic objective of the Web Server is to store, process, and deliver web pages to the users. This intercommunication is done using Hypertext Transfer Protocol (HTTP).

In this Home Automation System, we will control 4 home appliances connected to the Relay using a Local Web Server. The Wifi Module NodeMCU ESP8266 will Receive commands from the Web Page.


Bill of Materials

The following are the components required for making this project. All the components can be easily purchased from Our Store. The component purchase link is given below.

S.N.Components NameQuantityPurchase Links
1NodeMCU ESP82661Nerokas Store
2Relay 5V4Nerokas Store
37805 Voltage Regulator IC1Nerokas Store
4Female DC Power Jack DCJ02021Nerokas Store
5Diode 1N40074Nerokas Store
6Resistor 330-ohm5Nerokas Store
7NPN Transistor BC5474Nerokas Store
8Terminal Block4Nerokas Store
9LED 5mm Any Color1Nerokas Store
10Female Header2 SetNerokas Store



Circuit Diagram & Connection

The circuit diagram for Web Server Controlled Home Automation using ESP8266 is given below. Using this circuit diagram you can assemble the circuit on the Breadboard using 4 4-channel Relay and NodeMCU Board.

Home Automation using Blynk Circuit


Home Automation PCB & Gerber File

If you don’t want to assemble the circuit on a breadboard and you want a PCB for the project, then here is the PCB for you. The PCB Board for the Home Automation Project is designed using the EasyEDA online Circuit Schematics & PCB designing tool. The front side and back side of the PCB are given below.

Home Automation PCB Front View
Home Automation PCB Front View
Home Automation PCB Back View
Home Automation PCB Back View

The Gerber File for the PCB Board is given below. You can simply download the Gerber File for this project.

Download Gerber File: Home Automation PCB



Source Code/Program

Copy the code from below and upload it to the NodeMCU Board.

But before uploading change the WiFi SSID & Password.

Controlling Home Appliances through Web Page

Once the code is uploaded, the NodeMCU Board will try connecting to the Network using the given SSID & Password.

Once connected to the network, the Serial Monitor will display the Local IP Address.

Now you can copy the IP Address and paste it to the web Browser. The Web Browser will display a beautiful webpage.


Now you can send 1 or 0 to turn ON & OFF the home appliances. The ON command is assigned to a certain GPIO PIN as 1 & OFF command as 0.

Apart from all this, if your NodeMCU ESP8266 Board is connected to your PC, the Serial Monitor will display the following message.

Well, that’s all from IoT Based Home Automation using ESP8266 Web Server. If you have any doubts, please comment below.