You are on page 1of 37

CHAPTER I

INTRODUCTION
1.1 Background

The “Home Automation” concept has existed for many years The terms “Smart
Home”, “Intelligent Home” followed and has been used to introduce the concept of
networking appliances and devices in the house. Home automation Systems (HASs)
represents a great research opportunity in creating new fields in engineering, and
Computing. HASs includes centralized control of lighting, appliances, security locks
of gates and doors and other systems, to provide improved comfort, energy efficiency
and security system. HASs becoming popular nowadays and enter quickly in this
emerging market. However, end users, especially the disabled and elderly due to their
complexity and cost, do not always accept these systems.
Due to the advancement of wireless technology, there are several different of
connections are introduced such as GSM, WIFI, and Bluetooth. Each of the
connection has their own unique specifications and applications. Among the four
popular wireless connections that often implemented in HAS project, WIFI is being
chosen with its suitable capability. The capabilities of WIFI are more than enough to
be implemented in the design. Also, most of the current laptop/notebook or
Smartphones come with built-in WIFI adapter. It will indirectly reduce the cost of this
System.

1
1.2 OBJECTIVES
Android controlled Smart Home Automation should be able to control the home
appliances wirelessly with effectively and efficiently.
Controlling home appliances using motion detection
To develop a code which includes the features of detecting the motion and controlling
the appliances.
Initiating a mail during emergency
To develop a code for initiating a mail whenever it is found that the temperature has
gone beyond specified range indicating fire emergency.
Extensible platform for future enhancement
The application is to be highly extensible, with possibility of adding features in the
future as needed.

1.3 SCOPE
The project aims at designing a prototype for controlling the home appliances that can
be controlled wirelessly using motion detection. The system can be used in a wide
range of areas. The system integrated with different features can be applied in the
following fields.
• The system can be used in home, small offices to the big malls
The system can be used from home to offices to control the electrical
appliances.
• For the development of technology friendly environment
The system incorporates the use of technology and making smart home
automation. By the use of day to day gadgets we can utilize them for different
prospective.

1.4. Technology Exposures That Project Provides:


1. Google’s Android open source technology.
2. Wi-Fi technology.
3. Interfacing Arduino to Nodemcu.
4. Embedded programming

2
CHAPTER II
LITERATURE REVIEW
2.1 Bluetooth based home automation system using cell phones:
In Bluetooth based home automation system the home appliances are connected to the
Arduino BT board at input output ports using relay. The program of Arduino BT
board is based on high level interactive C language of microcontrollers; the
connection is made via Bluetooth. The password protection is provided so only
authorized user is allowed to access the appliances. The Bluetooth connection is
established between Arduino BT board and phone for wireless communication. In this
system the python script is used and it can install on any of the Symbian OS
environment, it is portable. One circuit is designed and implemented for receiving the
feedback from the phone, which indicate the status of the device.
2.2 Zigbee based home automation system using cell phones:
To monitor and control the home appliances, the system is designed and implemented
using Zigbee.. The device performance is record and store by network coordinators.
For this the Wi-Fi network is used, which uses the four switch port standard wireless
ADSL modem router. The network SSID and security Wi-Fi parameter are
preconfigured. The message for security purpose first process by the virtual home
algorithm and when it is declared safe it is re-encrypted and forward to the real
network device of the home. Over Zigbee network, Zigbee controller sent messages to
the end. The safety and security of all messages that are received by the virtual home
algorithm. To reduce the expense of the system and the intrusiveness of respective
installation of the system Zigbee communication is helpful.
2.3 GSM based home automation system using cell phones:
Because of the mobile phone and GSM technology, the GSM based home automation
is lure to research. The SMS based home automation, GPRS based home automation
and dual tone multi frequency (DTMF) based home automation, these options we
considered mainly for communication in GSM.
2.4 Home automation using RF module:
The important goal of Home Automation System is to build a home automation
system using a RF controlled remote. Now technology is accelerating so homes are
also getting smarter. Modern homes are deliberately relocating from current l switches

3
to centralized control system, containing RF controlled switches. Today traditional
wall switches situated in various parts of the home makes it laborious for the end user
to go near them to control and operate. Even further it turns into more problematic for
the old persons or physically handicapped people to do so. Home Automation using
remote implements an easier solution with RF technology. In order to accomplish this,
an RF remote is combined to the microcontroller on transmitter side that sends
ON/OFF signals to the receiver where devices are connected. By operating the stated
remote switch on the transmitter, the loads can be turned ON/OFF globally using
wireless technology.
2.5 Home automation using Android ADK:
The devices of home are associated to the ADK and the Connection is established
between the Android device and ADK. The devices of house are linked to the
input/output ports of the board (EMBEDDED SYSTEM) and their current situation
will have passed to the ADK. The microcontroller board (Arduino ADK) is based on
the ATmega2560. It has a USB host connection to associate with Android based
phones, and that is based on the MAX3421e IC. The two important features of
Android Open Accessory Protocol 2.0(AOAP) are as follows: It has audio output that
is from the Android device to the component and it also support for the component
serves as one or more Human Interface Devices (HID) to the Android device. This
paper depends upon Android and Arduino platform in which both are FOSS(Free
Open Source Software). Including motion sensors for safety systems will detect an
unauthorized action and it will automatically notice the user through cell phone or the
security system.
2.6 Cloud Based home automation system
Home Automation using cloud based system focuses on the design and
implementation of home gateway to collect data about data from home appliances and
then send to the cloud-based data server to get store on Hadoop Distributed File
System, it is processed using MapReduce and use to implement a monitoring tasks to
Remote user Presently home Automation System is persistently developing its
resilience by assimilating the current characteristics which gratify the rising interest of
the people. This paper presents the design and development of home automation
system that use the cloud computing as service. The current system consists of three

4
important units: the first part is cloud server, handle and controls the data and
information of client and users and the status of devices The hardware interface
module is the second part which implement the relevant connection to the actuators
and sensing devices which give the physical service. Last part is Home Server, which
construct the hardware device and gives the user interface. This paper focus to build
the web services using cloud which is need for security and storage and availability of
the data. The current system is cost efficient, reliable and comfortable which also
gives a secured home automation system for entire family. The system is made up of
various client modules for various platforms.
2.7 Raspberry pi home automation with wireless sensors using smart phone
Home Automation System has been developed with Raspberry Pi by reading the
algorithm and subject of the Email. Raspberry Pi guarantees to be an efficient
platform for implementation powerful, and economic smart home automation. home
automation using Raspberry pi is better than any other home automation methods in
several ways. For example, DTMF (dual tone multi-frequency) using home
automation, the call tariff is a big demerit, which is not the problem in their proposed
method. In Home Automation using web server, the design of web server and the
memory space required is dismissed by this method, because it just uses the already
established web server service given by G-mail. LEDs were used to identify the
switching action. This System is efficient and flexible interactive.

5
CHAPTER-III
METHODOLOGY
3.1 BLOCK DIAGRAM

Fig. 1.1 Block Diagram

The major modules used in this project are ultrasonic sensor which is used for motion
detection and DHT-11 which is used as a temperature sensor This DHT-11 is used to
measure the humidity percentage and temperature in the surroundings. When these
sensors are given the power supply through arduino, the ultrasonic sensor detects the
motion and turns on the respective appliances. As the temperature exceeds a given
value, the mail is sent as a warning to the respective person.

6
3.2 CIRCUIT DIAGRAM

Fig no 1.3 Circuit Diagram

3.3 WORKING

The Home Automation using Arduino and Ultrasonic Sensor is a simple project,
where the lights in the room will automatically turn on upon detecting a human
motion and stay turned on until the person has left or there is no motion.

Working on this project is very simple and is explained here.Initially, when there is no
human movement, the ultrasonic Sensor doesn’t detect any person and its OUT pin
stays LOW. As the person enters the room, the change in ultrasonic radiation in the
room is detected by the ultrasonic Sensor.As a result, the output of the ultrasonic
Sensor becomes HIGH. Since the Data OUT of the ultrasonic Sensor is connected to
Digital Pin of Arduino, whenever it becomes HIGH, Arduino will activate the
appliances by making the appliances pin HIGH.This will turn the Light ON. The light
stays turned ON as long as there is a movement in front of the sensor.If the person
takes a nap or leaves the room, the ultrasonic Radiation will become stable (there will
be no change) and hence, the Data OUT of the ultrasonic Sensor will become LOW.
This in turn will make the Arduino to turn OFF the appliances and the room light will
be turned OFF.

7
3.4 Hardware Environment
● Arduino as the controller for its processing power and large developer
community.
● Nodmcu used to send the mail.
● Sensors are used to sense the movement of the Human.

3.5 Software Environment


● Arduino IDE

8
3.6 Hardware Description

Fig.1.3 Arduino Uno

❖ Arduino
❏ Arduino is an open-source electronics platform based on easy-to-use
hardware and software. Arduino boards are able to read inputs - light
on a sensor, a finger on a button, or a Twitter message - and turn it into
an output - activating a motor, turning on an LED, publishing
something online. You can tell your board what to do by sending a set
of instructions to the microcontroller on the board. To do so you use
the Arduino programming language (based on Wiring), and the
Arduino Software (IDE), based on Processing.

❏ Over the years Arduino has been the brain of thousands of projects,
from everyday objects to complex scientific instruments. A worldwide
community of makers - students, hobbyists, artists, programmers, and
professionals - has gathered around this open-source platform, their
contributions have added up to an incredible amount of accessible
knowledge that can be of great help to novices and experts alike.

9
❖ Nodemcu

Fig. 1.4 Nodemcu

❏ NodeMCU is an open-source firmware and development kit that helps you to


prototype or build IoT product. It includes firmware which runs on the
ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on
the ESP-12 module. The firmware uses the Lua scripting language. It is based
on the eLua project, and built on the Espressif Non-OS SDK for ESP8266.

❖ Ultrasonic Sensor

Fig.1.5 Ultrasonic Sensor

❏ An ultrasonic sensor is an instrument that measures the distance to an object


using ultrasonic sound waves.
❏ An ultrasonic sensor uses a transducer to send and receive ultrasonic pulses
that relay back information about an object’s proximity.
❏ High-frequency sound waves reflect from boundaries to produce distinct echo
patterns.

10
❖ LED

Fig.1.6 LED

❏ A light-emitting diode (LED) is a semiconductor light source that emits light


when a current flows through it. Electrons in the semiconductor recombine
with electron holes, releasing energy in the form of photons. The color of the
light (corresponding to the energy of the photon) is determined by the energy
required for electrons to cross the band gap of the semiconductor. White light
is obtained by using multiple semiconductors or a layer of light-emitting
phosphor on the semiconductor device.

❖ Fan

Fig.1.7 Fan

❏ A DC motor is a motor that transforms electrical energy into mechanical


energy by drawing in direct current. DC motors induce a rotation movement in
the machine by electromagnetism. DC motors have inductors (electromagnet)
within them that create a magnetic field that aids the rotation of the motor.

11
❖ Temperature Sensor DHT-11
❏ The DHT11 is a basic, low-cost digital temperature and humidity sensor.

Fig.1.8 Temp Sensor DTH11


❏ DHT11 is a single wire digital humidity and temperature sensor, which
provides humidity and temperature values serially with one-wire protocol.
❏ DHT11 sensor provides relative humidity value in percentage (20 to 90% RH)
and temperature values in degrees Celsius (0 to 50 °C).
❏ DHT11 sensor uses resistive humidity measurement component, and NTC
temperature measurement component.

❖ Buzzer

Fig.1.9 Buzzer
❏ A buzzer is a small yet efficient component to add sound features to our
project/system. It is very small and compact 2-pin structure hence can be
easily used on breadboard, Perf Board and even on PCBs which makes this a
widely used component in most electronic applications

12
3.7 CODE
Code for Ultrasonic Sensor
#include "dht.h"
#define dht_apin A0 // Analog Pin sensor is connected to
dht DHT;
// defines pins numbers
const int trigPin = 10;
const int echoPin = 11;
int led = 12;
// defines variables
long duration;
int distance;
void setup(){
Serial.begin(9600);
delay(500);//Delay to let system boot
Serial.println("DHT11 Humidity & temperature Sensor\n\n");
delay(1000);//Wait before accessing Sensor

pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output


pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
pinMode(led, OUTPUT);
pinMode(7, OUTPUT);
}//end "setup()"

void loop(){
//Start of Program

DHT.read11(dht_apin);

Serial.print("Current humidity = ");

13
Serial.print(DHT.humidity);
Serial.print("% ");
Serial.print("temperature = ");
Serial.print(DHT.temperature);
Serial.println("C ");

delay(500);//Wait 5 seconds before accessing sensor again.

if(DHT.temperature>=50)
{
digitalWrite(7,HIGH);
}
else
{
digitalWrite(7,LOW);
}
//Fastest should be once every two seconds.

// Clears the trigPin


digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);

14
if(distance<=30)
digitalWrite(led,HIGH);
else
digitalWrite(led,LOW);
}// end loop()
Code for getting the mail via NODEMCU
#include <ESP8266WiFi.h>
const char* ssid = "Gnsarma1"; // Enter the name of your WiFi Network.
const char* password = "hyderabad"; // Enter the Password of your WiFi Network
char server[] = "mail.smtp2go.com"; // The SMTP Server
WiFiClient espClient;
void setup()
{
pinMode(D0,INPUT);
Serial.begin(115200);
delay(10);
Serial.println("");
Serial.println("");
Serial.print("Connecting To: ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print("*");
}
Serial.println("");
Serial.println("WiFi Connected.");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
// byte ret = sendEmail();
while (1){

15
if(digitalRead(D0)==HIGH){
byte ret = sendEmail();
delay(10000);
}
}
}
void loop()
{
}
byte sendEmail()
{
if (espClient.connect(server, 2525) == 1)
{
Serial.println(F("connected"));
}
else
{
Serial.println(F("connection failed"));
return 0;
}
if (!emailResp())
return 0;
Serial.println(F("Sending EHLO"));
espClient.println("EHLO www.example.com");
if (!emailResp())
return 0;
Serial.println(F("Sending auth login"));
espClient.println("AUTH LOGIN");
if (!emailResp())
return 0;
Serial.println(F("Sending User"));

16
espClient.println("bWFoZXNoLmJhYnVAdGVjaG9sdXRpb24uY29t"); // Your
encoded Username
if (!emailResp())
return 0;
Serial.println(F("Sending Password"));
espClient.println("ODY4NjE4MDM4M20=");// Your encoded Password
if (!emailResp())
return 0;
Serial.println(F("Sending From"));
espClient.println(F("MAIL From: mahesh.babu@techolution.com")); // Enter Sender
Mail Id
if (!emailResp())
return 0;
Serial.println(F("Sending To"));
espClient.println(F("RCPT To:dharanisanthoshi99@gmail.com")); // Enter Receiver
Mail Id
if (!emailResp())
return 0;
Serial.println(F("Sending DATA"));
espClient.println(F("DATA"));
if (!emailResp())
return 0;
Serial.println(F("Sending email"));
espClient.println(F("To:dharanisanthoshi99@gmail.com")); // Enter Receiver Mail Id
// change to your address
espClient.println(F("From:mahesh.babu@techolution.com")); // Enter Sender Mail
Id
espClient.println(F("Subject: ESP8266 test e-mail\r\n"));
espClient.println(F("the temperature prescribed is exceeded.\n"));
espClient.println(F("immediate action to be taken chances of fire is high."));
espClient.println(F("if ignored fire may breakout."));
espClient.println(F("."));

17
if (!emailResp())
return 0;
Serial.println(F("Sending QUIT"));
espClient.println(F("QUIT"));
if (!emailResp())
return 0;
espClient.stop();
Serial.println(F("disconnected"));
return 1;
}
byte emailResp()
{
byte responseCode;
byte readByte;
int loopCount = 0;
while (!espClient.available())
{
delay(1);
loopCount++;
if (loopCount > 20000)
{
espClient.stop();
Serial.println(F("\r\nTimeout"));
return 0;
}
}
responseCode = espClient.peek();
while (espClient.available())
{
readByte = espClient.read();
Serial.write(readByte);
}

18
if (responseCode >= '4')
{
return 0;
}
return 1;
}

19
CHAPTER-IV
RESULTS & DISCUSSION
4.1 RESULT

Whenever the ultrasonic sensor detects an object within its range, the LED glows.

20
The above picture shows the humidity and temperature values along with the distance
in which the object is placed.

21
Whenever the temperature exceeds a given range, the above mail is sent to the owner
of the house ,giving a warning about the rising temperature which might lead to a fire
in the house.

22
4.2 APPLICATION
● Controlled electrical fixtures such as lights and air conditioners
● Simplified garden or lawn management
● HVAC
● Controlled smart home appliances
● Enhanced safety and security at home
● Water and air quality control and monitoring
● Voice based home assistant supporting natural language
● Smart locks and switches

23
CHAPTER-V
FUTURE ENHANCEMENTS / RECOMMENDATIONS
❖ Smart home automation and IoT are creating a lot of buzz in the IT industry.
Daily lives have been made simpler, better, and more comfortable with the
increasing number of smart homes and connected devices.

❖ Smart homes have changed the way people live. For example, how about
turning on the air conditioning of your home before actually stepping inside?
How about asking Alexa to play your favorite music and get weather updates
while you are still in the kitchen preparing dinner? Smart home automation
can do even more than that — it has become the future of our lives.

5.1 The Smart Home Devices and the Future


❖ By 2020, it is expected that the global smart home market will reach around
40 billion dollars. Now, these smart home devices range from anything like
smart kettles, refrigerators, and dryers to air conditioners and a range of safety
and security devices, like alarm systems and circuit security cameras.
❖ Ease and convenience are what make smart home systems so appealing, and as
they are connected with each other, it becomes easy to manage more
operations. With the help of IoT smart home devices, it becomes easy to
reduce energy consumption and costs, all the while saving time.
❖ One of the main issues that common people, as well as businessmen, are
facing when it comes to applying IoT smart homes is the high costs. They are
quite high compared to the non-connected devices, and so, when it comes
down to choosing IoT-enabled devices, they are always a bit hesitant. There is
no doubt that while IoT devices will be costly at first, they will save money
and energy in the future. This is an important factor to think about.

24
❖ Yet, it is said that 2019, as well as the years to come, will be promising for the
smart home industry. Here are predictions for smart home devices:

5.2 The Next Security and Privacy Crisis


● For the purpose of convenience, we have shared the digital footprint. When we
make use of smart home technology, we start sharing a physical footprint.
However, if devices get compromised, then the consequences will be deadly.
Access to your digital footprint could even be worse than compromising social
security numbers. When shaping this industry, security and privacy will play a
key role.

5.3 Smart Home Device Integration


● Integration can have a positive or negative effect on smart home technology.
The future is not going to be having misunderstandings with appliances that
are powered by AI. Smart homes should be able to know when to turn off the
light the moment you leave the room, deactivate the lock with your face
recognition, and much more. In 2019 and beyond, there will be more
integration towards the smart home support for homeowners.

5.4 A Better Role for Artificial Intelligence


● The use of security cameras is on the rise, and people are using it to have an
eye on their property. With proper AI integration, it will be possible to get
threat alerts automatically, and in case something goes wrong, it will
proactively alert us to take control of the situation. This will have a great deal
of effect on remote video monitoring.

5.5 Focus on Appliances and Surveillance


● From a homeowner’s perspective, consumers will be excited to have new
ways to control their home. Today, the surveillance of the home and the
extended property has become quite important. Working on appliances is also

25
a good thing as more people, today, are depending on their appliances to take
on a major part of the workload.

5.6 New Smart Home Use Cases


● In 2017, security was considered the main concern when it comes to
developing applications, and the devices on which these apps were installed
were not interoperable. Therefore, in 2018, it was key that smart home devices
be made interoperable, and for the same smart devices, new use cases will
come up like energy conservation, appliance diagnostics, and the prevention of
damages that take place during natural disasters.

5.7 Homeowner Data Sharing


● The next big thing in smart home technology will be sharing data with people
and businesses. Soon, you will have things like the temperature of your room
set before you enter or food ordered based on the items left in the fridge —
this will be something that we see more of in the future. This kind of data will
be collected from consumers and help companies come up with user-friendly
products.

5.8 Increased Efficiency, Customization, and Control


● Technology is said to become more clear and efficient. You will be able to
control kitchen and home appliances using an app. There won't be a need to
control things manually, as the AI will take care of that. These devices will
start behaving as per user preferences.

REFERENCES

● https://www.arduino.cc/en/main/software
● http://www.amazinggates.com/

26
● https://www.elprocus.com/wireless-home-automation-using-intern
et-of-things/
● http://www.microchip.co.uk/
● http://www.quora.com/
● http://www.engineeringproject.com/
● http://www.electronicsworldforyou.com/

27
28
29
30
31
32
33
34
35
36
37

You might also like