Beruflich Dokumente
Kultur Dokumente
ON
IOT BASED HOME
AUTOMATION SYSTEM
SUBMITTED TO
SUBMITTED BY
CHAPTER ONE
1
INTRODUCTION
Imagine how helpful it will be to be able to switch on your air
conditioning system ten minutes before you get home on a hot afternoon
in January. How about having a security system that will detect smoke,
excessive electrical power usage, burglar attempts and unauthorized
movements in your house and alert you? This is
What home automation is about and there is no end to its application. In
fact, sophisticated home automation systems are now being
developed that can maintain an inventory of household
items, record their usage through an RFID (Radio
Frequency Identification) tag, and prepare a shopping list
or automatically order replacements.
Home automation has made it
possible to have what is often referred to as a 'smart
home', a home that can detect and identify you,
automatically adjust the lighting to your predefined taste,
open doors automatically, play your favourite music,
water your flowers in the morning, switch on the security
lights at night and switch them off in the morning, heat
water for bathe and tea, stream to you anywhere in the
world via the internet a live video of what is happening in
and around your house.
It makes it possible to link lighting,
entertainment, security, telecommunications, heating,
and air conditioning into one centrally controlled system.
This allows you to make your house an active partner in
managing your busy life. Nowadays, you can hardly find a
house without a home automation system which can
2
PROJECT DESCRIPTION
The main aim of the project is to control multiple electrical loads
remotely over internet falling under the basic principles of Internet of
Things-IOT. For this realtime scenario we can develop a webpage with
user configurable front end (GUI).The data sent from the webpage upon
buttons are sent through allotted IP fed to it, to IOT module which is
then received by a GPRS module interfaced to a Microcontroller of
ATmega8 series. Relays are then driven as per the command received at
the controller end to handle electrical loads.
The real time data is also seen at the sending
end upon a LCD display interfaced to the microcontroller that displays
the status of the loads too.The power supply consists of a step down
transformer 230/12V, which steps down the voltage to 12V AC. This is
converted to DC using a Bridge rectifier and it is then regulated to +5V
using a voltage regulator 7805 which is required for the operation of the
microcontroller.
Basic idea of Home automation using Telnet is conceived from router
configuration. As we use a remote terminal to access router instead of
console to configure it, we have used the same way to control our
controller instead of router to control our Home Appliances. The
controller atmega8 which is programmed such as that when it receives
Diagram:-
Representation Diagram:-
Pin Diagram:-
3. Security
Smart home security systems allow you to view your home no matter where you
are. You can have cameras installed, motion detectors, locks, etc., and you will be
notified immediately if something is out of the ordinary. Many of these systems
will even let you know of any unexpected temperature changes so that youre
alerted if there is a possible fire.
4. Ease of Use
Almost all smart home products can be installed without much hassle, many of
them dont even require you to bring someone into your home. Additionally if
youre already someone whos tech savvy, learning how to use most of these
products is a breeze.
5. Save Money and the Environment
Smart homes feature products like thermostats, air conditioners, and lighting.
Having the ability to put these things on a timer, or turn them on and off when
youre away from home will likely help you save money on your electricity bills.
Many of these products allow you to track your energy usage and expenditures.
I know I stated in the advantages that most smart home systems are
actually very easy to use, but at the same time there is still somewhat of
a learning curve for most people. For anyone already immersed in
technology, converting your smart home will be a breeze, but for anyone
not so tech savvy, it may make for a lot of time spent reading manuals.
If you think you might have trouble learning how
to use a smart home device, the answer may be simple. Ask for help!
Asking someone to show you how to run your smart home can far less
confusing than trying to make heads or tails of an instruction manual.
Reliability A smart home will be extremely reliant on your internet
connection. If your connection drops youll be left with a lot of smart
products that wont work. Additionally, wireless signals can possibly be
interrupted by other electronics in your home and cause some of your
smart products to function slowly or not at all.
PROJECT SCOPE:This project work is complete on its own in remotely and automatically
switching on and off of any electrical appliance not limited to household
appliances, and sends a feedback message indicating the new present
state of the appliance. It Does not implement control of multiple
appliances or automatic detection of faults in the controlled appliance.
Home automation
Home automation may designate an emerging practice of increased
PROJECT OBJECTIVE
The objective of this project is to implement a low cost, reliable and
scalable home automation system that can be used to remotely switch on
or off any household appliance, using a microcontroller to achieve
hardware simplicity, low cost short message service (SMS) for feedback
and voice dial from any phone to toggle the switch state.
CHAPTER TWO
LITERATURE REVIEW
HARDWARE COMPONENT
1. Regulated Power Supply
Power supplies are designed to convert high voltage AC mains to a suitable low
voltage supply for electronic circuits and other devices. In our project the various
electronic modules are being used for which power supply requirement is +5V DC.
The Microcontroller unit needs a pure regulated +5V DC.A power supply can be
broken down into a series of blocks, each of which performs a particular function.
For example a 5V regulated supply:
11
controller into the LCD, there by relieving the CPU of the task of
refreshing the LCD and also the ease of programming for characters and
graphics. HD 44780 based LCDs are most commonly used.
The LCD, which is used as a display in our project,
is LMB162A. The main features of this LCD are: 16 X 2 display,
intelligent LCD, used for alphanumeric characters & based on ASCII
codes. This LCD contains 16 pins, in which 8 pins are used as 8-bit data
I/O, which are extended ASCII. Three pins are used as control lines
these are Read/Write pin, Enable pin and Register select pin. Two pins
are used for Backlight and LCD voltage, another two pins are for
Backlight & LCD ground and one pin is used for contrast change.
It can display 32 characters at a time on the
display. There are two rows (lines) and 16 characters can be displayed in
each line. And it will be used in 8 bit mode i.e. its 8-bit data bus will be
used to transfer the data codes from MCU to LCD. Below is the picture
of our LCD:
14
RS (register select)
There are two important registers inside the LCD. The RS pin is used for
their selection as follows. If RS=0, the instruction command code
register is selected, then allowing to user to send a command such as
clear display, cursor at home etc.. If RS=1, the data register is selected,
allowing the user to send data to be displayed on the LCD.
R/W (read/write)
The R/W (read/write) input allowing the user to write information from
it. R/W=1, when it read and R/W=0, when it writing.
EN (enable)
The enable pin is used by the LCD to latch information presented to its
data pins. When data is supplied to data pins, a high power, a high-tolow pulse must be applied to this pin in order to for the LCD to latch in
the data presented at the data pins.
15
The coil of a relay passes a relatively large current, typically 30mA for a
12V
Relay, but it can be as much as 100mA for relays designed to operate
from lower voltages. Most ICs (chips) cannot provide this current and a
17
SPST - Single Pole Single Throw. These have two terminals which can
be connected or disconnected. Including two for the coil, such a relay
has four terminals in total. It is ambiguous whether the pole is normally
open or normally closed. The terminology "SPNO" and "SPNC" is
sometimes used to resolve the ambiguity.
DPST Double Pole Single Throw. These have two pairs of terminals.
Equivalent to two SPST switches or relays actuated by a single coil.
Including two for the coil, such a relay has six terminals in total. The
poles may be Form A or Form B (or one of each).
18
DPDT Double Pole Double Throw. These have two rows of changeover terminals. Equivalent to two SPDT switches or relays actuated by a
single coil. Such a relay has eight terminals, including the coil.
Choosing a relay
You need to consider several features when choosing a relay:
Coil voltage
The relay's coil voltage rating and resistance must suit the circuit
powering the relay coil. Many relays have a coil rated for a 12V supply
but 5V and 24V relays are also readily available. Some relays operate
perfectly well with a supply voltage which is a little lower than their
rated value.
Coil resistance
The circuit must be able to supply the current required by the relay coil.
You can use Ohm's law to calculate the current:
Relay coil current = supply voltage coil resistance
For example: A 12V supply relay with a coil resistance of 400 passes a
19
Microcontroller
A microcontroller has a CPU (a microprocessor) in addition to the fixed
amount of RAM, ROM, I/O ports, and timers are all embedded together
on the chip: therefore, the designer cannot add any external memory,
I/O, or timer to it. Microcontroller Unit is the heart of our project. It
controls all the major activities of our project. The Microcontroller unit
used in our project is based on AVR family.
Microcontroller ATmega8
20
Bridge Rectifier
A bridge rectifier can be made using four individual diodes, but it is also
available in special packages containing the four diodes required. It is
called a full-wave rectifier because it uses all AC wave (both positive
and negative sections). 1.4V is used up in the bridge rectifier because
each diode uses 0.7V when conducting and there are always two diodes
conducting, as shown in the diagram below.
Bridge rectifiers are rated by the maximum current
they can pass and the maximum reverse voltage they can withstand (this
must be at least three times the supply RMS voltage so the rectifier can
withstand the peak voltges). In this alternate pairs of diodes conduct,
changing over the connections so the alternating directions of AC are
converted to the one direction of DC.
Diagram:-
23
SMOOTHING
Smoothing is performed by a large value electrolytic capacitor
connected across the DC supply to act as a reservoir, supplying current
to the output when the varying DC voltage from the rectifier is falling.
The diagram shows the unsmoothed varying DC (dotted line) and the
smoothed DC (solid line). The capacitor charges quickly near the peak
of the varying DC, and then discharges as it supplies current to the
output. Note that smoothing significantly increases the average DC
voltage to almost the peak value (1.4 RMS value). For example 6V
RMS AC is rectified to full wave DC of about 4.6V RMS (1.4V is lost in
the bridge rectifier), with smoothing this increases to almost the peak
value giving 1.4 4.6 = 6.4V smooth DC. Smoothing is not perfect due
to the capacitor voltage falling a little as it discharges,
24
Giving a small ripple voltage. For many circuits a ripple which is 10%
of the supply voltage is satisfactory and the equation below gives the
required value for the smoothing capacitor. A larger capacitor will give
fewer ripples. The capacitor
Value must be doubled when smoothing half-wave DC.
Smoothing capacitor for 10% ripple, C = 5 Io
Vs f
Where
C = smoothing capacitance in farads (F)
Io = output current from the supply in amps (A)
Vs = supply voltage in volts (V), this is the peak value of the
unsmoothed DC
f = frequency of the AC supply in hertz (Hz), 50Hz in the UK.
REGULATOR
25
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V)
or variable output voltages. They are also rated by the maximum current
they can pass. Negative voltage regulators are available, mainly for use
in dual supplies. Most regulators include some automatic protection
from excessive current (overload protection') and overheating (thermal
protection'). Many of the fixed voltage regulator ICs has 3 leads and
look like power transistors, such as the 7805 +5V 1A regulator shown on
the right. They include a hole for attaching a heat sink if necessary.
The low voltage AC output is suitable for lamps, heaters and special AC
motors. It is not suitable for electronic circuits unless they include a
rectifier and a smoothing capacitor.
Transformer + Rectifier
26
27
28
LEDs must be connected the correct way round, the diagram may be
labeled a or + for anode and k or - for cathode (yes, it really is k, not c,
for cathode!). The cathode is the short lead and there may be a slight flat
on the body of round LEDs. If you can see inside the LED the cathode is
the larger electrode (but this is not an official identification method).
LEDs can be damaged by heat when soldering, but the risk is small
unless you are very slow. No special precautions are needed for
soldering most LEDs.
Advantages of LEDs
Shapes and Sizes
LEDs are available in many shapes and sizes, some of which are shown
in the selection below. The 'standard' LED shape is the 5mm diameter
domed type, and the smaller 3mm domed type is also popular.
1. Tri-LED array
2. 10 segment bar displays
3. Domed LED sizes 3, 5, 8, 10mm
4. Panel mounting LED.
5. PCB mounting LED
6. 26mm red & green LED cluster
29
Colors:
LEDs have traditionally been red, orange, yellow, or green, but advances
in LED technology mean that blue and white LEDs are now available,
though at a much higher price. These LEDs are considerably brighter
than standard LEDs so they could be used for lighting, but you will find
the ones described as 'white' still have a blue tinge.
The table below shows typical technical data for some 5mm diameter
round LEDswith diffused packages (plastic bodies). Only three columns
are important and these are shown in bold. Please see below for
explanations of the explanation.
IF max
Maximum forward current, forward just means with the LED connected
correctly.
F typ
Typical forward voltage VL in the LED resistor calculation.
This is about 2V, except for blue and white LEDs for which it is about
4V.
VF max
30
time. Tri-color LEDs also have two LEDs in one package, but because
they have three leads, both LEDs can be switched on together, their light
combining to make a third color, typically orange. The central lead of
such a package is the common for both LEDs. Some
Manufacturers produce true 'tri-color' LEDs incorporating red, green,
and blue LEDs, so in theory it is possible to create light of any color.
The physical color of an LED package does not necessarily indicate the
color it will be when switched on. Some LEDs have a clear plastic
package, while others may have a diffused plastic package.
Poor circuit
Since the TTL output can't source above 1mA so the LED will be very
dim.
Fair circuit
32
The LED will conduct heavily at about 2V and the extra 3V has to be
dropped in the TTL circuitry. This causes high power dissipation in the
TTL or the LED fails.
Good circuit
The resistor limits the current. The resistance can be calculated by
assuming its voltage is about 2.5V and the TTL output is 0.9V. For 2.2V
LED, 1.9V is across the resistor so the 220ohm would limit the current
to 8.6mA (1.9/220). For 1.7V LED, 2.4V is across the resistor so it
would limit the current to 10.9mA (2.4/220). The resistor should not less
than 100ohm or the LED would fail
Pin Diagram
34
Transistor
A transistor is a semiconductor device used to amplify and switch
electronic signals and power. It is composed of a semiconductor material
with at least three terminals for connection to an external circuit. A
voltage or current applied to one pair of the transistor's terminals
changes the current flowing through another pair of terminals. Because
the controlled (output) power can be higher than the controlling (input)
power, a transistor can amplify a signal.
35
Here a circuit shows interfacing of relay with PNP transistor. Here Vin
signal is given to transistor from microcontroller or other low current
digital devices. By using this driver circuit a relay can be derived from
microcontroller, but has a drawback i.e. whenever the relay gets off a
back spike is generated in the base of transistor which can harm the
controller or other digital devices. This problem can be solved by using
an optocoupler between controller and transistor's base as shown:
CHAPTER TWO
SOFTWARE COMPONENT
IOT is basically a module design to remotely access the devices through
web server and cloud computing. There are mainly three server site
scripting languages used now-a-days i.e. JSP, ASP, PHP. We preferred to
use PHP because it is an open source scripting language, runs on various
platforms (Windows, Linux, Unix, Mac OS X, etc.), compatible with
almost all servers used today (Apache, IIS, etc.), supports a wide range
of databases, runs efficiently on the server side. There are basically two
ways in which we can manage our data i.e. in structured way or in
unstructured way.
Structured data is often managed using Structured
Query Language (SQL) a programming language created for managing
and querying data in relational database management systems.
Unstructured data is all those things that can't be so readily classified
and fit into a neat box: photos and graphic images, videos, streaming
instrument data, Webpages, PDF files, PowerPoint presentations, emails,
blog entries, wikis and word processing documents.
We uses MYSQL database for storing our data in a managed way.
IOT is mainly consists of two technologies i.e. Telemetry and
Teleremote.
Telemetry
It is the automated communications process by which measurements are
made and other data collected at remote or inaccessible points and
37
Teleremote
is a concept in which user remotely operate/ manage the devices. Their
current state of the device is send to the server using PHP script. User
can access those devices through a PHP form and change the current
state of the particular device.
38
Software used to Create a webpage of the project:The main software is to create a webpage and linking with server is
XAMPP
is a free and open source cross-platform web server solution
stack package developed by Apache Friends, consisting mainly of
the Apache HTTP Server, MariaDB database, and interpreters for scripts
written in the PHP and Perl programming languages. XAMPP stands for
Cross-Platform (X), Apache (A), Maria DB (M), PHP (P) and Perl (P). It
is a simple, lightweight Apache distribution that makes it extremely easy
for developers to create a local web server for testing and deployment
purposes. Everything needed to set up a web server server application
(Apache), database (Maria DB), and scripting language (PHP) is
included in an extractable file. XAMPP is also cross-platform, which
means it works equally well on Linux, Mac and Windows. Since most
39
40
Notepad++
Notepad++ is a text editor and source code editor for use with Microsoft
Windows. Unlike Microsoft Notepad, the built-in Windows text editor, it
supports tabbed editing, which allows working with multiple open files
in a single window. The project's name comes from the Increment.
Notepad++ is distributed as free software. At first
the project was hosted on SourceForge.net, from where it has been
downloaded over 28 million times, and twice won the Source Forge
Community Choice Award for Best Developer Tool.[5] The project was
hosted on Tux Family (fr) from 2010 to 2015; since 2015 Notepad++
has been hosted on GitHub. Notepad++ uses the Scintilla editor
component.
41
Adobe Dreamweaver
Adobe Dreamweaver is a proprietary web development tool developed
by Adobe Systems. Dreamweaver was created by Macromedia in
1997, and was maintained by them until Macromedia was acquired by
Adobe Systems in 2005.
Adobe Dreamweaver is available for macOS and for Windows.
Following Adobe's acquisition of the Macromedia product
suite, releases of Dreamweaver subsequent to version 8.0 have been
more compliant with W3C standards.
Recent versions have improved support for Web technologies such
as CSS, JavaScript, and various server-side Scripting
languages and frameworks including ASP (ASP JavaScript, ASP
VBScript, ASP.NET C#, ASP.NET VB), ColdFusion, Scriptlet, and PHP.
42
43
Source Code:?php
ob_start();
include_once("conndb.php");
44
$string = "";
$par_mode = "";
$par_num = "";
if(isset($_GET['kid']) && isset($_GET['par'])){
$kit_id = $_GET['kid'];
$para = explode("_",$_GET['par']);
$total_para = sizeof($para);
if($total_para > 2){
for($i=0 ; $i < $total_para ; $i++){
// echo "<br>";
if(!empty($para[$i])){
$val = $para[$i];
if($i == 1){
$par_mode = $val[0].$val[1];
$par_num = $val[2];
}else{
$par_num = $par_num.",".$val[0];
}
}
}
}
else{
45
foreach($para as $val){
if(!empty($val)){
$par_mode = $val[0];
$par_num = $val[1];
}
}
}
if($par_mode == 'r'){
$query = "select * from device_telemonitoring
where kit_id=$kit_id order by dtm_id DESC";
$result = mysql_query($query);
if(mysql_num_rows($result)){
$fetch = mysql_fetch_array($result);
$string = $par_num.$fetch['device'.
$par_num]."_".$fetch['entry_date']."_".
$fetch['entry_time']."<br>";
}
}else if($par_mode == 'mr'){
$par_num_arr = explode(",",$par_num);
$tarr = sizeof($par_num_arr);
$query = "select * from device_telemonitoring
where kit_id=$kit_id order by dtm_id DESC";
$result = mysql_query($query);
if(mysql_num_rows($result)){
$fetch = mysql_fetch_array($result);
46
GSM
GSM which stands for Global System for Mobile
Communication is the most popular standard for mobile
phone communication in the world. It is used by over
three billion people across more than 212 countries and
territories GSM basically provides voice call and short
message service (SMS). It operates as a cellular network
that mobile phones connect to by trying to search for
cells in their immediate vicinity. The modulation used in
GSM is Gaussian minimum shift keying (GMSK), a kind of
continuous-phase frequency shift keying.
In GMSK, the signal to be
modulated onto the carrier is first smoothed with
47
CHAPTER FIVE
CONCLUSION AND RECOMMENDATION
CONCLUSION
It is evident from this project work that an individual control home
Automation system can be cheaply made from low-cost locally available
components and can be used to control multifarious home appliances
ranging from the security lamps, the television to the air conditioning
system and even the entire house lighting system. And better still, the
components required are so small and few that they can
be packaged into a small inconspicuous container.
The designed home automation system was tested
a number of times and certified to control different home appliances
used in the lighting system, air conditioning system, heating system,
home entertainment system and many more (this is as long as the
maximum power and current rating of the appliance does not exceed that
of the used relay).
Finally, this home automation system can be also
implemented over Bluetooth, Infrared and WAP connectivity without
much change to the design and yet still be able to control a variety of
home appliances. Hence, this system is scalable and flexible.
49
RECOMMENDATION
In consonance with the project work and in view of the researched
methods and undertakings in the project design, the following are
recommended:
The department should help the students in getting components that
are not locally available.
Students should be taught how to make embedded systems as the use
of computer software in most project work makes it uneconomical, and
the use of the conventional integrated circuits and logic gates makes the
project work clumsy.
Finally, this project can be further developed to control more than
one home appliance at once through the use of short message service
texts rather than voice dial though it will be more expensive and will
require more relay circuits, making it a distributed control home
automation system. Also, to cut the cost of mobile phone, the project
may be implemented using standalone GSM modems that only perform
specialised functions like text messaging and/or phone calls. This GSM
modems often are cheaper and more reliable than GSM mobile phones.
REFERENCES
Byte Craft (2002). First Steps with Embedded Systems. Byte Craft
Limited, Canada.
50
B & B Electronics (2003) RS-232 connections that work! DTE & DCE
FAQ. From http://www.bb-elec.com Retrieved on 29/03/2003 Collins, T.
J. (2008).
A project report on the design and construction of a low voltage
power line communication system. Project Report, FUTA Akure.
Intersil (2008). HIN232 datasheet. Intersil Inc, USA.
Martin Bates (2006). Interfacing PIC Microcontrollers Embedded
Design by Interactive Simulation. Newness, London.
Wikipedia (2009). Automation. From
http://en.wikipedia.org/wiki/Automation. Retrieved on 7/30/2009
Wikipedia (2009). Building Automation. From
http://en.wikipedia.org/wiki/Building_automation. Retrieved on
7/30/2009
Wikipedia (2009). Microcontroller. From
http://en.wikipedia.org/wiki/Microcontroller. Retrieved on 8/3/2009
51