Home automation using IoT concept

In this blog I am going to convey how to automate your home. In this modern world we have to automate everything. If we press the button in our phone light has to be turned on /off. To do this, one has to follow three simple steps.
Step 1-Install and Configure Blynk App
Step 2-Downloading and Setting up Arduino IDE and Blynk Libraries
Step 3-Hardware Assembly
  
Installation and Configuration of Blynk App
Open Play store and download and install the Blynk App.Once the app is installed create a new account on Blynk and login using that.After logging in,create a new project by clicking ‘New Project'.Give name for your project. Select the hardware device as NodeMCU and select the connection as WIFI, and hit create.At this point Blynk will send an Auth token to your email id. We will use this ‘Auth token’ later in the tutorial to link our app with the NodeMCU. Now since I’m using a one channel relay, I’ll add 1 button on the blank project. To add a new button just click anywhere on the blank area and select button from the side menu that pops up. You can place the button anywhere on the screen.Click on the Button and give it a name. I’ll name it ‘light’ as I’ll use it to control the relay. Below the name, in the text-box select the pin as digital pin D3.




 Downloading and Setting up Arduino IDE and Blynk Libraries
Download arduino IDE in https://www.arduino.cc/Download blynk libraries in https://www.blynk.cc/.Copy the blynk libraries and tools in the arduino library location.Connect the NodeMCU to your PC using a USB cable.Set up the Arduino IDE by
Tools > Port and make sure an appropriate port is selected
Tools > Board and select ‘NodeMCU 1.0 (ESP-12E Module)
Program your board by
Files > Examples > Blynk > Boards_WIFI > ESP8266_Standalone
In this code you have to do some modification
char auth[] = “YourAuthToken”
char ssid[] = “YourNetworkName”’
char pass[] = “YourPassword”’


Hardware Assembly
There are two types of connection has to be done to automate your home
Connect Node MCU with Relay
D3 to in1
gnd to gnd
Power up the relay by supplying 5 volt to it
 


Connect Relay with light or fan
one terminal of light or fan to NO
supply +ve to COM
motor -ve and supply -ve should be grounded
So, you can directly run your Blynk project from your phone and turn the light or fan on or off using the
buttons that we created in the app based on the notifications.We can connect fans,bulbs or any other electrical appliances that need to be automated to relay module