IOT HOME
BY
K.V.SAI MADHAV
Mail ID : venkatasaimadhav999@gmail.com
LinkedIn Profile: https://www.linkedin.com/in/k-v-sai-madhav-a93707152/
IOT HOME
Abstract:
The Aim of this project is to control and monitor our Home appliances
through theinternet from anywhere in the world.
Description:
Internet of Things(IoT) means connecting all devices to the
Internet and to control them from anywhere in the world.
The project is about controlling home appliances through the
Internet Using Blynk Cloud.
We interfaced home appliances to NODEMCU .
Then we connected NODEMCU (Micro Controller) to Blynk Cloud
through the Internet.
We used the Blynk Mobile Interface to connect to Blynk Cloud. By
this, we can communicate with our devices(Appliances).
Blynk Cloud provides high security by providing us a Master Key.
We can ON/OFF appliances(light,fan,socket..) by using mobile as
shown in the mobile interface.
When we press ON/OFF in the mobile app, then it sends data to
NODEMCU through Blynk Cloud.
We can also monitor Temperature and Humidity in the house as
shown in the mobile interface.
This is not a prototype. This is a real application.
Components Used:
NODEMCU, DHT11 SENSOR, RELAYS, H-BRIDGE DRIVER, DC MOTORS, BULBS
WITH SOCKETS, SERVO MOTOR, BREADBOARD, 9V BATTERIES, 230V AC
SUPPLY, CONNECTING WIRES,JUMPER WIRES, 7805 VOLTAGE REGULATOR.
CODE:
#define BLYNK_PRINT Serial
#include <BlynkSimpleEsp8266.h> // THESE 3 LIBRARIES FOR USING BLYNK CLOUD
#include <SimpleTimer.h>
#include <SPI.h>
#include<Servo.h> // SERVO MOTOR LIBRARY
#include <ESP8266WiFi.h> //NODEMCU WIFI MODULE LIBRARY
#include <DHT.h> //DHT11 SENSOR LIBRARY
char auth[] = "ms-7JXRFHoFYKmxOsglX4rL1"; //AUTHENTICATION KEY PROVIDED BY BLYNK CLOUD
char ssid[] = "naani"; //WIFI SSID
char pass[] = "12345677"; //WIFI PASSWORD
#define DHTPIN 2 //DHT 11 - TEMPERATURE AND HUMIDITY SENSOR
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
SimpleTimer timer; //SIMPLE TIMER
void Sensor() //FUNTION TO READ DHT11 SENSOR VALUES
{
int h = dht.readHumidity();
int t = dht.readTemperature();
if (isnan(h) || isnan(t))
{
Serial.println("Failed to read from DHT sensor!");
return;
}
Serial.println(h); //TO PRINT HUMIDITY VALUES ON SERIAL MONITOR
Serial.println(t); //TO PRINT TEMPERATURE VALUES ON SERIAL MONITOR
Blynk.virtualWrite(V7,h); //TO PUBLISH HUMIDITY VALUES TO BLYNK CLOUD
Blynk.virtualWrite(V8,t); //TO PUBLISH TEMPERATURE VALUES TO BLYNK CLOUD
}
Servo servo; //TO DECLARE SERVO
void setup()
{
Serial.begin(9600); //TO BEGIN SERIAL MONITOR
Blynk.begin(auth, ssid, pass);//TO BEGIN BLYNK CLOUD CONNECTION
dht.begin(); // TO BEGIN DHT11 SENSOR
timer.setInterval(1000L,Sensor); //TO EXECUTE THE FUNTION Sensor FOR EVERY SECOND
servo.attach(D8); //TO DECLARE THAT THE SERVO IS CONNECTED TO PIN D8
servo.write(0);
}
void loop()
{
Blynk.run(); //TO START PUBLISHING DATA TO BLYNK CLOUD
timer.run(); //TO START TIMER
}
BLYNK_WRITE(V1) //THIS FUNCTION IS TO WRITE THE VALUES OF SERVO FROM BLYNK MOBILE INTERFACE
{
servo.write(param.asInt());
}
Comments