Skip to main content

ESP8266 wifi Based Home Automation

                                  

Introduction

Hey there in this session we will discuss about home automation i.e. IOT so we are using ESP8266-12F or Nodemcu and in software portion we will use blynk IOT to control all things over internet from one point to any point in the world.

Components

ESP8266-12F/12E or Nodemcu board 
USB to TTL converter(if you don't use nodemcu or any development board)
Breadboard
100R*5 resistors
LEDs








Circuit



So this is minimum circuit requires to work properly and while esp8266 is connect with wifi it consumes minimum of 150mA so make sure you have used 3.3v regulator to work properly, as I have used AMS1117 3.3v regulator which is enough to power the esp8266.
To program esp8266 you need any USB to TTL converter like CH340 or FDTI and wire connections are as follows 
                      
             ESP8266                                    USB to TTL converter
            VCC(3.3v)   -------------------------- 3.3v(use separate power supply to power ESP module)
            GND            --------------------------  GND
             TX              --------------------------   RX
             RX              --------------------------   TX

Also Circuit is given below make sure connect all wires properly.





Setup new ESP8266 or Nodemcu                                                       

Follows these steps to setup your first ESP module                                                                                  

1. First you need to add ESP boards to Arduino IDE for this you have to copy the link given below ESP8266 Library - https://arduino.esp8266.com/stable/package_esp8266com_index.json                                  


                             


Paste the copied link with commo" , "   and click OK                                                                                                    
                  

2. Now go to tools and select board manager now search for ESP8266 and install the latest version.                                                                       




3. Now go to boards and select your ESP8266 Generic Module and you are done with ESP board     configuration.                                                                                                                                 


4. Now we have to add blynk library to Arduino IDE for this download the library.                                                                                                                                      

 Blynk library(Click the link and download, extract the zip file paste to arduino library)                                                                                                                                         




Blynk IOT Setup                                                                                

1. To setup your blynk iot first you need to create account and login with gmail and password.             


2. After login go to templates and create new, configure with board type and name                              



3. After creating go to datastream click on new datastreams then go to digital to configure output pin name and on which pin will be the output                                                                                      


   



   4. After creating all datastreams go to Web Dashboard now add push button to control the output, I             have configured total of  8 outputs pins also choose the datastream in button settings.                    


5. After this click on save and go to my devices and click on new devices, choose the tamplate and        create the device. After this you need to copy the auth token and tamplate ID and paste it to arduino code given below, make sure entre your WiFi hotspot(wifi router) name and entre the password of your wifi, after this when you power the ESP8266 it automatically connect with wifi because your ESP8266 acts as wifi device.       

How To Upload Code in ESP8266

To program your ESP module you need press boot button then plug to computer and then release boot button to set ESP in boot mode simply click upload button in arduino ide, after uploading code to ESP press reset button to go in running mode that the simple and cheap method otherwise you have to buy premade development boards like Nodemcu.  



Code

#define BLYNK_PRINT Serial

#define BLYNK_TEMPLATE_ID "TMPL3lkduRc-B"

#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

char auth[] = "R5xXov-4RDlBcDcr9PdRS2A7Y0fhwKU-"; 

char ssid[] = "your wifi name";

char pass[] = "wifi password";

void setup()

{

 Serial.begin(9600);

 Blynk.begin(auth, ssid, pass);

}

void loop()

{

  Blynk.run();

}










After code uploaded press reset button on esp8266, when your ESP8266 will connect to your hotspot then its onboard Blue LED will glow(GPIO 2). After that you are done with whole things now just go to your blynk iot and control upto 8 devices.

Circuit Diagram



                           

                                                                                           

      

                                                                  




















 




















Comments

Post a Comment

Popular posts from this blog

SG/KA3525 PWM Controller

Introduction Hey everyone in this session we learn how to use KA/SG3525 IC to make PWM controller circuit having feedback, low voltage and over heating protection. Components So lets take look at components we need to make this circuit - 1.SG/KA3525 IC 2.LM358 IC 3.LM555 IC 4.10K NTC 5.Variable resistor - 10K*4, 500K*1 6.16-pin, 8-pin IC Base 7.Capacitors - 1nF*2, 100nF*4, 2.2uF*1) 8.Resistors - 100R*1, 220R*2, 1K*10, 5.6K*1, 10K*6, 15K*2, 100K*1 9.BC547*1 10.LED*2 11.Push Button*1 12.Zero PCB Working                                                                                                                            In this circuit we used SG3525 to make PWM controller and use...

XL6009 Buck Boost Converter

                                           Introduction Hey there in this session we will discuss how the buck boost converter works, here I am using XL6009 module and upgrade to buck boost converter. Components Modified Inductor  XL6009 Boost Converter Module Upgrading XL6009 Module First we need toroid inductor from old SMPS filter, now make 25 turns of 0.7mm copper wire with two wires hence we got two coils of same turns as shown in figure.  Make Dual Coil inductor of 25 turns each After this we have to remove the old inductor from xl6009 module and then we got two PCB points at which we will connect our modified inductor. Remove the old Inductor from XL6009 module Now connect the wire of both coils of inductor as shown in figure, the first coil wires connect between +VCC input and other to SW i.e. switch pin of XL6009 IC. And other coil wire will connect between in...

How to use Hall Effect Sensor

How To Use Hall Effect Sensor Introduction : We will talk about hall sensors and their uses here I am using A3144 sensor this sensor has 3 pins VCC, GND, and OUTPUT it works on 5v dc its output is open collector so we get negative output when passes near magnet and this is digital sensor so you can use it directly with your projects it means no need of any comparator.  And this sensor is used in BLDC motor, Fridge door automatic light, magnet pole detection etc. Watch Practical experiment Video of this Sensor . Pinout of A3144 : Circuit diagram : Buy Electronics components at very cheap price :  Quartz Components 1) A3144 Hall Sensor 2) Leds 3) Resistors 4) 5v SMPS   5) Breadboard   6) Breadboard Jumper Wires 7) Crocodileclips