Arduino esp8266 wifi Home/Office Automation System

(Last Updated On: July 6, 2019)



In this tutorial, you will learn how to make your own ESP8266 wifi module based Home/ Office automation Project along with a feedback system using an application on your android cell phone. This project is based on the famous ESP8266 wifi module. With the help of this project the electrical loads AC/Dc can be controlled using your android cell phone.  All the commands are processed by the Arduino Uno.

As you know any program which is written for the Arduino Uno can also Run on the Mega. So the program written for this project will also work on the Arduino Mega.  To use this project you will need to connect your ESP8266 Wifi module and cell phone with the same WIFI network. This is actually an offline automation system. This project can be used at homes, offices, colleges, universities and so on.


This Tutorial covers.

esp8266 wifi module software/firmware update

use of at commands

complete project circuit diagram


programming and finally


For the firmware update, you can watch a video given at the end of this Article.

The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno:
esp8266 wifi module:
Mega 2560:
lm7805 Voltage Regulator:
330-ohm resistors pack:
female DC power jack socket:
470 uf capacitors:
5×7 cm vero board:
female headers:
connection wires:
Super Starter kit for Beginners:
Jumper Wires:
Bread Board:
12v Adaptor:
PCB plate:
Variable Supply:
Digital Multimeter:
Vero Board / strip board:
Soldering iron kit: “best” You guys should definitely purchase this:
Solder wire:
Wire Stripper:
wire cutter:
PCB small portable drill machine:
MFRC522 RFID module and tags: best deal:
GSM sim900A:

Circuit Diagram:


The ESP8266 WIFI module Tx pin is connected with the Arduino’s pin number 2. The ch_pd pin of the ESP8266 WIFI module is connected with the Arduino’s pin number 3.3 volt. The RST pin of the wifi module is left unconnected. The VCC pin of the ESP8266 WIFI module is connected with the 3.3-volt pin of the Arduino Uno. The Ground pin of the ESP8266 WIFI module is connected with the Arduino’s Ground. The Rx pin of the wifi module is connected with pin number 3 of the Arduino Uno, while the GPIO 1 and GPIO 0 are not connected.

4 relays are connected with the Arduino pins 9 to 13. If you want you can increase or decrease the number of relays. The relays used in this project are of the type SPDT “ these are 12V and 10A relays. As you can see in the circuit diagram a 10k resistor and 2n2222 NPN transistor is connected with each relay. The 10k resistor and 2n2222 makes the driver and is used to operate this relay. Due to the voltage difference, a 12v relay cannot be directly operated by the controller so that’s why we need a driver circuit to control a relay. The Selection of the Transistor entirely depends on the relay coil resistance.

To find the relay coil resistance you will need a multimeter. Set the multimeter on the resistance and connect both the test leads of the digital multimeter with the two legs of the relay which has the coil. After you find the Coil resistance, then the next step is to use ohm’s law

V = I R

Now after putting values in this formula, you can find the Current. now depending on the value of the current calculated, we select a transistor whose collector current is greater than the relay coil current. this is the current needed to energize the relay coil. Select a transistor whose collector is approximately 3 times greater than the calculated value. This way the transistor will never heat up.

I selected 2n2222 NPN transistor and if you check the datasheet of this transistor you will find that its collector current is much greater than the relay coil current, which is best. Moreover the 2n2222 transistors are really cheap and are easily available in every electronics shop.

If you want to control your home or office appliances from remote locations, then I highly recommend you should use Nodemcu ESP8266 wifi module and Blynk Application. I have so many tutorials on Blynk Application and Nodemcu esp8266 wifi module. The use of Nodemcu esp8266 wifi module is really easy as compared to the ESP8266 wifi module.

If you have any questions regarding this project, you can let me know in a comment.


Cell phone application apk file: Wifi


Watch Video Tutorial:

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...


  1. Hi, so thrilled by your tutorial as it helped my understanding things better. Which platform did you use to develop the android app please?

    1. This application is designed in Android studio. I am starting a complete series on how to make android cell phone applications for Arduino Bluetooth. Click the subscribe button and you will be notified. If you want the source code then you can get this for 25 dollars.

  2. Which application you have used to control this circuit by a mobile …..I mean what is the name of the app that you have used

Leave a Reply