Arduino esp8266 wifi Home/Office Automation System

(Last Updated On: April 21, 2020)

ESP8266

Description:

ESP8266 Arduino- 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.

For the Worldwide control system, I recommend you should use the Nodemcu ESP8266 Wifi Module, because the use of Nodemcu ESP8266 Module is very simple, you don’t have to update the firmware, the coding is very simple.

Nodemcu ESP8266 based Home/Office Automation System.

You can also use the ESP32 Module, its use is just like the Nodemcu ESP8266 Wifi Module. You can add multiple analog sensor and you can also add digital sensors. I have a also developed the home automation system using the ESP32 Module, i recommend you should read this article “ESP32 Home Automation Project, ESPRESSIF Home Automation”

This Tutorial covers.

esp8266 wifi module software/firmware update

use of at commands

complete project circuit diagram

interfacing ESP8266 with Arduino

Arduino ESP8266 programming and finally

Testing the Home/Office Automation project.

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

 

Without any further delay, let’s get started!!!


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

Arduino Uno: https://amzn.to/37oaksm
esp8266 wifi module: https://amzn.to/2u8rsk7
Mega 2560: https://amzn.to/2ze1kdu
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470uf capacitors: https://amzn.to/2xDCOzf
5×7 cm Vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF
MFRC522 RFID module and tags: best deal: https://amzn.to/2PD9Ref
GSM sim900A: https://amzn.to/2Nv70TI

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!


ESP8266 with Arduino Circuit Diagram:

ESP8266

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.


Download:

Cell phone application apk file: Wifi

ESP8266 Arduino Programming:


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

9 Comments

  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

  3. Hello sir i am a student of Electrical technology i making this project but when i connected the CH_PD pin of ( esp 8266 module )
    on Arduino Nano 3.3V pin then my esp 8266 is not work and power led is always off.

  4. Hi, just looking through the code of this project, can you tell me how the “send command” function is working. for example “sendCommand(“AT+RST\r\n”,2000,DEBUG); // reset module”
    is this a specific function of software serial?
    if it is, where did you learn this information and could you direct me to this library commands.
    thanks in advance

  5. UPDATE, sorry, i didn’t see the “send command” function at the very end of the code, looks like clever stuff, gonna have a go this weekend. Been looking for a very long time to see how you actually use the esp as a wireless serial connection, mostly on the internet people are hosting a web page on the actual esp and just switching led on or off, your approach is just the ticket

    1. Salve mi chiamo Cosimo sto cercando di riprodurre il tuo progetto ma non riesco a farlo funzionare. Ma nel esp8266 01 devo caricarli il file flash dawloader se è si dove posso scaricarlo?

Leave a Reply