connect@howdiyworld.com
|

IoT Home Automation

What is Needed?

LED
Blynk Mobile App
Jumpers
HowDIY

BLOCK DIAGRAM

Procedure

  1. LED and Blynk App
  2. Creating a button in Blynk App
  3. Connections
  4. Program
  5. Output

What is an LED ?

A LED or Light Emitting Diode is a Semiconductor  two terminal(Pin) component, the two terminals are (+)Positive and (-)Negative. The voltage is applied to positive terminal and negative terminal should be ground light is emitted. Here we are using 12V LED so the maximum Voltage for positive terminal is 12V and minimum is 3V. If we use anything above 12V the LED will get short circuit.

Blynk App

Blynk app is an easy to use Android and 103 based application, helps in controlling Arduino, Raspberry Pi and others for the purpose of loT. Blynk app is a digital dashboard, where you can build a graphic interface for your project by simply dragging and dropping widgets. The best part of Blynk app is that, it is not bounded with some specific board or platform.

Setting Up Blynk App

Download Blynk Mobile Application.

·         Sign in and add new device(Raspberry Pi 3) in Blynk App.

·         An Authentication code will be sent to your mail

·         Check the Authentication code and replace it in the Python Code.

       After Authentication we will create a new button in Blynk app to control our device.

·         Click the + Button

·         Select Styled Button

·         A Styled Button is created to edit it’s properties click the created Button

·         Now in the Styled Button settings click the PIN

·         In the Select PIN pop-up, Select Virtual and V1

·         You can change the Name and output should be 0 and 1

  Now if you go back you can see that you have successfully created a button.

Setting Up the Relay Circuit for the Raspberry Pi Home Automation System

  • Connect LED’s Positive(+) to 3rdpin
  • Connect LED’s Negative(-) to 14thpin

Program

import Blynk Lib

pip install blynk-library-python

import time

import RPi.GPIO as GPIO

import getch

#import home_iot

GPIO.setmode(GPIO.BOARD)

GPIO.setwarnings(False)

GPIO.setup(3,GPIO.OUT)

BLYNK_AUTH=" Enter_AUTH_Code"

blynk = BlynkLib.Blynk(BLYNK_AUTH)

@blynk.VIRTUAL_WRITE(1)

def my_write_handler(value):

print(“Current V1 Value : {}".format(value))

value=str(value)

print(value[2])

if value[2]==’1′:

GPIO.output(3,True)

else:

GPIO.output(3,False)

while True:

blynk.run()

Output

You can use the app to control LED from anywhere.

To stop the IoT Home Automation press Ctrl + C.

Social media & sharing icons powered by UltimatelySocial
Facebook
Twitter
YouTube
LinkedIn
Instagram