SlideShare a Scribd company logo
1 of 53
A
PROJECT REPORT
ON
“IoT Home Automation System”
Contribution: Web Designing, Coding &
Database Management
AMITY SCHOOL OF ENGINEERING & TECHNOLOGY
AMITY UNIVERSITY RAJASTHAN
Guide-
Ms. Pooja Parnami
Asst. Professor, ASET
Submitted by-
Pratibha Chaudhary
B.Tech (CSE, VIII Semester)
ABSTRACT
With the rising power of technology, we are able to accomplish things at a much quicker rate. We
have at the touch of a button access to large amounts of information due to the capability of
computers and the Internet. Not only has technology given us more information, but it also has
given us the ability to communicate, organize, and manage our time. And with the inception of IoT,
the home automation has become important, because it gives the user the comfortable and easily
for using the home devices. The implementation and design of wireless home automation control
has two primary components: a circuit (using Arduino) embedded in the user’s home and a web
application that will provide the interface to operate this circuit and the appliances attached to it,
from a remote location.
Only authorized people will have the right to access the system and the system administrator can
authorize people that can access it.
D E C L A R A T I O N
I hereby declare that the project entitled “IoT Home Automation System”
submitted for the partial fulfillment of B. Tech Degree is my original work and
the project has not formed the basis for the award of any degree, associate ship,
fellowship or any other similar titles.
Signature of the Student:
Pratibha Chaudhary
Programme: B. Tech (CSE, VIII Semester)
Place: Jaipur
Date:
ACKNOWLEDGEMENT
It is indeed a great pleasure and matter of immense satisfaction for us to express our deep
sense profound gratitude towards all the people who have helped, inspired us in our project work.
First we would like to give our gratitude to Ms. Pooja Parnami (Assistant Professor, ASET)
for the effort taken by her right from the selection of the project to its completion. She spent her
precious time whenever we were in need of guidance.
Moreover we would like to thank Mr. Anil Saroliya (Assistant Professor, ASET), who was
always there whenever we needed any support and was a constant source of inspiration for
accomplishment of this project.
Pratibha Chaudhary
Table Of Contents
Title page i
Abstract ii
Declaration iii
Acknowledgment iv
Table of Contents v
List of Figure viii
1 Introduction 1
1.1 Aims & Objective 2
1.2 Internet of Things 2
1.2.1 Introduction: Towards Ubiquity 2
1.2.2 A Dynamic Internet 3
1.2.3 IoT as a Network of Networks 4
1.2.4 Why is IoT Important 4
1.2.5 IoT: Critical for Human Progression 5
1.2.6 IoT Applications 5
1.2.7 Mumbai: A Tale of Two Cities 5
1.2.8 Better Quality Life for Elderly 6
1.2.9 Challenges and Barriers to IoT 6
1.3 Home Automation Systems 7
1.3.1 Evolution of Home Automation Systems 7
1.3.2 Home Automation Developments 8
1.3.2.1 Automation 9
1.3.2.2 Remote Control 9
1.3.2.3 Home Automation Components 9
1.3.2.4 Energy Efficiency 9
1.3.3 Potential Risks and Limitations 10
1.4 Arduino 10
1.4.1 Introduction 10
1.4.2 What’s on the Board? 11
1.4.3 Communication 13
1.4.4 The Structure of an Arduino Program 14
1.4.5 Arduino Ethernet Shield 15
1.4.6 Teleduino 16
1.5 Php 17
1.5.1 What is Php? 17
1.5.2 Syntax 18
1.5.3 Datatypes 19
1.5.4 Functions 19
1.5.5 Php Objects 19
1.5.6 Security in Php 20
1.5.7 Wamp 21
2 Requirement Analysis 22
2.1 Requirement Analysis 23
2.2 Features of a Home Automation System 23
2.3 General and Non-Functional Requirements 23
2.3.1 Security Requirements 23
2.3.2 Performance Requirements 24
2.3.3 User Interface Requirements 24
2.3.4 Data Requirements 25
2.3.5 Hardware Requirements 26
2.3.6 Software Requirements 27
2.4 Constraints 27
2.4.1 External Constraints 27
2.4.2 Internal Constraints 27
3 Project Description 28
3.1 Project Overview 29
3.2 Design and Implementations 29
3.3 Software Module: Web Application 30
4 Coding 34
4.1 Home Page 35
4.2 User Login Page 37
4.3 Authenticate user(log_verify.php) 39
4.4 Session.php 40
4.5 MySQL tables used 41
5 Conclusion 42
5.1 Conclusion 43
6 Future Scope 44
6.1 Future Scope 45
References 46
List Of Figures
Sr. no. Figure No. Figure Title Page No
1 Figure 1.1 The IoT was Born Between 2008 and 2009 4
2 Figure 1.2 IoT can be viewed as a Network of Networks 4
3 Figure 1.3 Arduino UNO(R3) 11
4 Figure 1.4 Schematic Diagram of Arduino 12
5 Figure 1.5 Structure of an Arduino Program 15
6 Figure 1.6 Php logo 18
7 Figure 1.7 WampServer Logo 21
8 Figure 2.1 Data Requirements 26
9 Figure 2.2 Arduino UNO(R3) 27
10 Figure 2.3 USB cable 27
11 Figure 2.4 W5100 Ethernet shield 27
12 Figure 2.5 4-channel 5-V Relay Module for Arduino 27
13 Figure 2.6 Male-to-Female Jumper Wires 27
14 Figure 3.1 Block diagram of smart home system 30
15 Figure 3.2 System Architecture 31
16 Figure 3.3 Home Page 32
17 Figure 3.4 Explanation Page 32
18 Figure 3.5 User Login Page 33
19 Figure 3.6 User Control Page 33
20 Figure 4.1 MySQL Database used 41
CHAPTER 1
INTRODUCTION
The project titled ’IoT Home Automation System’ is designed and implemented using Arduino,
PHP and MySQL. The project aims provide user with an automated means to control the devices
in their homes using a web application from anywhere on the planet.
Home automation gives you access to control devices in your home from a mobile device
anywhere in the world. The term may be used for isolated programmable devices, like thermostats
and sprinkler systems, but home automation more accurately describes homes in which nearly
everything -- lights, appliances, electrical outlets, heating and cooling systems -- are hooked up to
a remotely controllable network. From a home security perspective, this also includes your alarm
system, and all of the doors, windows, locks, smoke detectors, surveillance cameras and any other
sensors that are linked to it.
1.1 AIMS AND OBJECTIVE
The proposed project is called “Home Automation System” and it has two primary components: a
circuit embedded in the user’s home and an android application that will provide the interface to
operate this circuit and the appliances attached to it, from a remote location.
Only authorised people will have the right to access the system and the system administrator can
authorise people that can access it.
1.2 INTERNET OF THINGS
1.2.1 INTRODUCTION: TOWARDS UBIQUITY
Born in the last century, the internet uses a coding system currently based on 32 bit addresses,
which permits the definition of some 4 billion or so separate items. Today, electronic product codes
for individual items have emerged for use on tiny tags fixed with radio transmitters. As the internet
grows, it needs to encompass more and more elements of the real world, and therefore the
abstraction has to be more complex too. Simplicity is no longer an option. Communications will
become increasingly ubiquitous in daily life, increasingly requiring identifying and addressing
systems. Our attempts to develop a structure for the internet will more intensely map the real world
onto cyberspace in increasing detail. In this context, technological ubiquity and complexity will
drive the future communication landscape.
1.2.2 A DYNAMIC INTERNET
According to the Cisco Internet Business Solutions Group (IBSG), IoT is simply the point in time
when more “things or objects” were connected to the Internet than people. [1]
In 2003, there were approximately 6.3 billion people living on the planet and 500 million devices
connected to the Internet. [2] By dividing the number of connected devices by the world
population, we find that there was less than one (0.08) device for every person. Based on Cisco
IBSG’s definition, IoT didn’t yet exist in 2003 because the number of connected things was
relatively small given that ubiquitous devices such as smartphones were just being introduced. For
example, Steve Jobs, Apple’s CEO, didn’t unveil the iPhone until January 9, 2007 at the Macworld
conference. [3]
Explosive growth of smartphones and tablet PCs brought the number of devices connected to the
Internet to 12.5 billion in 2010, while the world’s human population increased to 6.8 billion,
making the number of connected devices per person more than 1 (1.84 to be exact) for the first time
in history. [4] By 2015 more than 25 billion devices were connected to the Internet and looking to
the future, Cisco IBSG predicts the statistic will increase to 50 billion by 2020. It is important to
note that these estimates do not take into account rapid advances in Internet or device technology;
the numbers presented are based on what is known to be true today.
Figure 1.1. The Internet of Things Was “Born” Between 2008 and 2009
1.2.3 IOT AS A NETWORK OF NETWORKS
Currently, IoT is made up of a loose collection of disparate, purpose-built networks. Today’s
cars, for example, have multiple networks to control engine function, safety features,
communications systems, and so on. Commercial and residential buildings also have various
control systems for heating, venting, and air conditioning (HVAC); telephone service; security; and
lighting. As IoT evolves, these networks, and many others, will be connected with added security,
analytics, and management capabilities (see Figure 2). This will allow IoT to become even more
powerful in what it can help people achieve.
Figure 1.2. IoT Can Be Viewed as a Network of Networks
1.2.4 WHY IS IOT IMPORTANT?
IoT IS immensely important because it is the first real evolution of the Internet—a leap that will
lead to revolutionary applications that have the potential to dramatically improve the way people
live, learn, work, and entertain themselves. Already, IoT has made the Internet sensory
(temperature, pressure, vibration, light, moisture, stress), allowing us to become more proactive
and less reactive.
In addition, the Internet is expanding into places that until now have been unreachable. Patients are
ingesting Internet devices into their own bodies to help doctors diagnose and determine the causes
of certain diseases. [5] Extremely small sensors can be placed on plants, animals, and geologic
features, and connected to the Internet. [6] At the other end of the spectrum, the Internet is going
into space through Cisco’s Internet Routing in Space (IRIS) program. [7]
1.2.5 IOT: CRITICAL FOR HUMAN PROGRESSION
As the planet’s population continues to increase, it becomes even more important for people to
become stewards of the earth and its resources. In addition, people desire to live healthy, fulfilling,
and comfortable lives for themselves, their families, and those they care about. By combining the
ability of the next evolution of the Internet (IoT) to sense, collect, transmit, analyze, and distribute
data on a massive scale with the way people process information, humanity will have the
knowledge and wisdom it needs not only to survive, but to thrive in the coming months, years,
decades, and centuries.
1.2.6 IOT APPLICATIONS
When we crossed the threshold of connecting more objects than people to the Internet, a huge
window of opportunity opened for the creation of applications in the areas of automation, sensing,
and machine-to-machine communication. In fact, the possibilities are almost endless. The
following examples highlight some of the ways IoT is changing people’s lives for the better.
1.2.7 MUMBAI: A TALE OF TWO CITIES
The amount people from Dharavi pay for municipal-grade water is $1.12 per cubic meter. This
compares to $0.03 for residents of Warden Road. The injustice is clear: the poor people of Mumbai
pay 37 times more for water (a basic human necessity)[8] The main source of the disparity is the
higher cost of delivering utility services to poorer neighbourhoods because of infrastructure
inefficiencies, problems such as leaks, and theft.
IoT, because of its ubiquitous sensors and connected systems, will provide authorities with more
information and control in order to identify and fix these problems. This will allow utilities to
operate more profitably, giving them extra incentive to improve infrastructures in poorer
neighbourhoods. More efficiency will also allow for lower prices, which, in turn, will encourage
those taking services for free to become paying customers. [9]
1.2.8 BETTER QUALITY OF LIFE FOR THE ELDERLY
The world’s population is aging. In fact, approximately 1 billion people age 65 and older will be
classified as having reached “non-working age” by the middle of the century.[10] IoT can
significantly improve quality of life for the surging number of elderly people. For example,
imagine a small, wearable device that can detect a person’s vital signs and send an alert to a
healthcare professional when a certain threshold has been reached, or sense when a person has
fallen down and can’t get up.
1.2.9 CHALLENGES AND BARRIERS TO IOT
Several barriers, however, have the potential to slow the development of IoT. The three largest are
the deployment of IPv6, power for sensors, and agreement on standards.
 DEPLOYMENT OF IPv6: The world ran out of IPv4 addresses in February 2010. While
no real impact has been seen by the general public, this situation has the potential to slow
IoT’s progress since the potentially billions of new sensors will require unique IP addresses.
In addition, IPv6 makes the management of networks easier due to auto configuration
capabilities and offers improved security features.
 SENSOR ENERGY: For IoT to reach its full potential, sensors will need to be self-
sustaining. Imagine changing batteries in billions of devices deployed across the planet and
even into space. Obviously, this isn’t possible. What’s needed is a way for sensors to
generate electricity from environmental elements such as vibrations, light, and airflow.[11]
In a significant breakthrough, scientists announced a commercially viable nanogenerator—a
flexible chip that uses body movements such as the pinch of a finger to generate
electricity—at the 241st National Meeting & Exposition of the American Chemical Society
in March 2011.[12]
 STANDARDS: While much progress has been made in the area of standards, more is
needed, especially in the areas of security, privacy, architecture, and communications. IEEE
is just one of the organizations working to solve these challenges by ensuring that IPv6
packets can be routed across different network types. It is important to note that while
barriers and challenges exist, they are not insurmountable. Given the benefits of IoT, these
issues will get worked out. It is only a matter of time.
1.3 HOME AUTOMATION SYSTEMS
1.3.1 INTRODUCTION: EVOLUTION OF HOME AUTOMATION SYSTEMS.
The concept of “automation” has existed for many years. It began with a student connecting two
electric wires to the hands of an alarm clock in order to close a circuit of a battery and light bulb.
Later, companies developed automated systems of their own to control alarms, sensors, actuators
and video cameras and, in so doing, created the first automated buildings. The term “intelligent
home” followed. Due to the obvious advantages of these systems, their influence on the
conventional home was predictable and finally, in 1988, the term domotics was coined. “Domotics
is the application of computer and robot technologies to domestic appliances. It is a portmanteau
word formed from domus (Latin, meaning house) and robotics” .[13] A modern definition of
Domotics could be the interaction of technologies and services applied to different buildings with
the purpose of increasing security, comfort, communications and energy savings (Moraes et al.,
2000).
At the beginning automated devices were independent or, sometimes, grouped in small
independent systems. But the idea of giving them interoperability using a common “language”
keeps on growing up, consequently following such idea the first Home Automation Systems
(HASs) appeared bringing a new concept of a home network full of possibilities. The smart home
and home automation market is rapidly expanding. Every week more products and features are
becoming available, and the attractive prices make this the perfect time to check out smart home
products for your family.
Here are four of the best reasons to get started in home automation now:
 STAY CONNECTED TO YOUR FAMILY: With the right sensors and alerts, your smart
home can let you know when your children have arrived home from school, when they’ve
gone out and whether they turned the lights off and locked the door when they left. If you
include web-connected security cameras in your system, you can even see who’s in the
house when you’re away.
 STAY CONNECTED TO YOUR HOME: Just because you’re not in your home doesn’t
mean you can’t monitor it. Water leak sensors, door and window sensors, motion detectors,
smoke alarms and more can all be configured to send important alerts to your Smartphone.
Lighting and heating/air-conditioning systems can also be operated remotely with a home
automation system. Don’t return from vacation to a house that’s too hot or too cold. Just
open up the app for your smart thermostat and adjust the temperature before you even pull
into your street.
 SAVE ENERGY: We waste a lot of energy, and money, every day because we don’t take
the time to make small but important adjustments to our homes, such as turning off lights,
opening and lowering shades and adjusting our thermostats. All those tasks can be
automated so they happen without you ever needing to think about it.
 MANAGE YOUR LIFE INSTEAD OF YOUR DEVICES: Does it sometimes seem like
your electronics are more in charge of you than you are of them? Does it take 10 steps to
simply settle into your chair to enjoy music and a book? Your home automation system can
be programmed with lifestyle scenes that automatically adjust all your systems (lights,
temperature, entertainment, security) with one simple command so you can get on with
your life.
1.3.2 HOME AUTOMATION DEVELOPMENTS
Until fairly recently, automated central control of building-wide systems was found only in larger
commercial buildings and expensive homes. Typically involving only lighting, heating and cooling
systems, building automation rarely provided more than basic control, monitoring and scheduling
functions and was accessible only from specific control points within the building itself.
The first and most obvious beneficiaries of this approach are "smart" devices and appliances that
can be connected to a local area network, via Ethernet or Wi-Fi. However, electrical systems and
even individual points, like light switches and electrical outlets, were also integrated into home
automation networks, and businesses have even explored the potential of IP-based inventory
tracking. Although the day is still far off when you'll be able to use your mobile browser to track
down a lost sock, home networks are capable of including an increasing number of devices and
systems.
1.3.2.1 AUTOMATION
Automation is, unsurprisingly, one of the two main characteristics of home automation.
Automation refers to the ability to program and schedule events for the devices on the network.
The programming may include time-related commands, such as having your lights turn on or off at
specific times each day. It can also include non-scheduled events, such as turning on all the lights
in your home when your security system alarm is triggered.
1.3.2.2 REMOTE CONTROL
The other main characteristic of cutting-edge home automation is remote monitoring and access.
Monitoring apps can provide a wealth of information about your home, from the status of the
current moment to a detailed history of what has happened up to now. You can check your security
system's status, whether the lights are on, whether the doors are locked, what the current
temperature of your home is and much more. With cameras as part of your home automation
system, you can even pull up real-time video feeds and literally see what's going on in your home
while you're away.
1.3.2.3 HOME AUTOMATION COMPONENTS
Where home automation becomes truly "smart" is in the Internet-enabled devices that attach to this
network and control it. The classic control unit is the home computer, for which many of the earlier
home automation systems were designed. Today's home automation systems are more likely to
distribute programming and monitoring control between a dedicated device in the home, like the
control panel of a security system, and a user-friendly app interface that can be accessed via an
Internet-enabled PC, Smartphone or tablet.
1.3.2.4 ENERGY EFFICIENCY
One clear advantage of home automation is the unmatched potential for energy savings, and
therefore cost savings. Your thermostat is already "smart" in the sense that it uses a temperature
threshold to govern the home's heating and cooling system. In most cases, thermostats can also be
programmed with different target temperatures in order to keep energy usage at a minimum during
the hours when you're least likely to benefit from the heating and cooling.
1.3.3 POTENTIAL RISKS AND LIMITATIONS
Many home automation devices rely on external dependencies. For example, in 2016 the "Revolv
Hub" promised a "Lifetime Subscription" which depended on servers that Google took ownership
of in 2014 and decided to shut down permanently. This left their users with a bricked device. [14]
Other examples include remotely disabled privacy settings on Android smartphones, removed
ability to run GNU/Linux on a Playstation 3, remotely re-enforced EULA on Wii U etc. [15]
Another aspect is that owners that bought their device are not free to point their devices at a
different server, or collaborate on improved software. As such action violates the United
States DMCA section 1201, which however in 2015 got an exemption for "local use" or in local
networks. These force tinkerers into a legal grey area if they want to make their device work. [15]
The Electronic Frontier Foundation thinks buyers should refuse electronics and software that
prioritize the manufacturer's wishes above their own. [15]
 RISKS: Often IoT devices lack stringent security measures; some attacks are already
capable of exploiting vulnerabilities in Linux-based IoT systems and routers. Sometimes
attackers come in over the bridge from traditional IT systems into "operational" technology
(OT) or IoT systems like the blast furnace or factory floor operations, or the networks
supporting ATM or POS operations. Sometimes they dial-up cellular modems on these IoT
devices, and other times they attack them directly over the Internet. [16]
 LIMITATIONS: Some limitations of home automation include the high cost of ownership,
inflexibility of interconnected devices, and poor manageability. [17]
1.4 ARDUINO
1.4.1 INTRODUCTION
Arduino is an open-source platform used for building electronics projects. Arduino consists of both
a physical programmable circuit board (often referred to as a microcontroller) and a piece
of software, or IDE (Integrated Development Environment) that runs on your computer, used to
write and upload computer code to the physical board.
The Arduino platform has become quite popular with people just starting out with electronics, and
for good reason. Unlike most previous programmable circuit boards, the Arduino does not need a
separate piece of hardware (called a programmer) in order to load new code onto the board – you
can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++,
making it easier to learn to program. Finally, Arduino provides a standard form factor that breaks
out the functions of the micro-controller into a more accessible package.
Figure 1.3. Arduino UNO (R3)
1.4.2 WHAT'S ON THE BOARD?
Looking at the board from the top down, this is an outline of what you will see (parts of the board
you might interact with in the course of normal use are highlighted):
Figure 1.4: Schematic Diagram of Arduino
 POWER (USB / BARREL JACK): Every Arduino board needs a way to be connected to
a power source. The Arduino UNO can be powered from a USB cable coming from your
computer or a wall power supply that is terminated in a barrel jack.
NOTE: Do NOT use a power supply greater than 20 Volts as you will overpower (and thereby
destroy) your Arduino. The recommended voltage for most Arduino models is between 6 and 12
Volts.
 PINS (5V, 3.3V, GND, ANALOG, DIGITAL, PWM, AREF): The pins on your Arduino
are the places where you connect wires to construct a circuit (probably in conjunction with
a breadboard and some wire. They usually have black plastic ‘headers’ that allow you to
just plug a wire right into the board. The Arduino has several different kinds of pins, each
of which is labelled on the board and used for different functions.
 GND (3): Short for ‘Ground’. There are several GND pins on the Arduino, any of which can
be used to ground your circuit.
 5V (4) & 3.3V (5) : As you might guess, the 5V pin supplies 5 volts of power, and the 3.3V
pin supplies 3.3 volts of power. Most of the simple components used with the Arduino run
happily off of 5 or 3.3 volts.
 Analog (6): The area of pins under the ‘Analog In’ label (A0 through A5 on the UNO) are
Analog In pins. These pins can read the signal from an analog sensor (like a temperature
sensor) and convert it into a digital value that we can read.
 Digital (7): Across from the analog pins are the digital pins (0 through 13 on the UNO).
These pins can be used for both digital input (like telling if a button is pushed) and digital
output (like powering an LED).
 PWM (8): You may have noticed the tilde (~) next to some of the digital pins (3, 5, 6, 9, 10,
and 11 on the UNO). These pins act as normal digital pins, but can also be used for
something called Pulse-Width Modulation (PWM). We have a tutorial on PWM, but for
now, think of these pins as being able to simulate analog output (like fading an LED in and
out).
 AREF (9): Stands for Analog Reference. Most of the time you can leave this pin alone. It is
sometimes used to set an external reference voltage (between 0 and 5 Volts) as the upper
limit for the analog input pins
 RESET BUTTON: Just like the original Nintendo, the Arduino has a reset button (10).
Pushing it will temporarily connect the reset pin to ground and restart any code that is
loaded on the Arduino. This can be very useful if your code doesn’t repeat, but you want to
test it multiple times. Unlike the original Nintendo however, blowing on the Arduino
doesn’t usually fix any problems.
 POWER LED INDICATOR: Just beneath and to the right of the word “UNO” on your
circuit board, there’s a tiny LED next to the word ‘ON’ (11). This LED should light up
whenever you plug your Arduino into a power source. If this light doesn’t turn on, there’s a
good chance something is wrong. Time to re-check your circuit!
 TX RX LEDS: TX is short for transmit, RX is short for receive. These markings appear
quite a bit in electronics to indicate the pins responsible for serial communication. In our
case, there are two places on the Arduino UNO where TX and RX appear – once by digital
pins 0 and 1, and a second time next to the TX and RX indicator LEDs (12). These LEDs
will give us some nice visual indications whenever our Arduino is receiving or transmitting
data (like when we’re loading a new program onto the board).
 MAIN IC: The black thing with all the metal legs is an IC, or Integrated Circuit (13). Think
of it as the brains of our Arduino. The main IC on the Arduino is slightly different from
board type to board type, but is usually from the ATmega line of IC’s from the ATMEL
Company. This can be important, as you may need to know the IC type (along with your
board type) before loading up a new program from the Arduino software. This information
can usually be found in writing on the top side of the IC. If you want to know more about
the difference between various IC’s, reading the datasheets is often a good idea.
 VOLTAGE REGULATOR: The voltage regulator (14) is not actually something you can
(or should) interact with on the Arduino. But it is potentially useful to know that it is there
and what it’s for. The voltage regulator does exactly what it says – it controls the amount of
voltage that is let into the Arduino board. Think of it as a kind of gatekeeper; it will turn
away an extra voltage that might harm the circuit. Of course, it has its limits, so don’t hook
up your Arduino to anything greater than 20 volts.
1.4.3. COMMUNICATION
UNO has communication protocols like UART Serial communication, SPI and I2C.
UART: UNO uses digital pin0 (RX) and digital pin1 (TX) for UART TTL serial communication.
I2C: UNO uses A4 or SDA pin and A5 or SCL pin are used for I2C communication with
wire library.
 SCL is the clock signal
 SDA is the data signal
NOTE: SDA and SCL pins are not extra pins available in UNO for I2C it’s a copy of pins A4 and
A5.
SPI: Pin11: (MOSI)
Pin12: (MISO)
Pin13: (SCK)
 MOSI (Master Out Slave In) - The Master line for sending data to the peripherals.
 MISO (Master In Slave Out) -The slave line for sending data to the master.
 SCK (Serial Clock) - The clock pulse which synchronise data transmission generated by the
master.
ICSP headers can be used to program ATmega directly using boot loader.
1.4.4 THE STRUCTURE OF AN ARDUINO PROGRAM
Every Arduino program is made up of at least two functions. The first is the setup function. This is
run initially – once only – and is used to tell the Arduino what is connected and where, as well as
initialising any variables you might need in your program.
Second is the loop. This is the core of every Arduino program. When the Arduino is running, after
the setup function has completed, the loop will run through all the code, then do the whole thing
again – until either the power is lost or the reset switch is pressed. The length of time it takes to
complete one full loop depends upon the code contained. You may write some code that says “wait
6 hours”, in which case the loop isn’t going to be repeating very often.
Here’s a quick state diagram to illustrate:
Figure 1.5: Structure of an Arduino Program
1.4.5 ARDUINO ETHERNET SHIELD
The Arduino Ethernet Shield allows an Arduino board to connect to the internet. It is based on
the Wiznet W5100 Ethernet chip. The Wiznet W5100 provides a network (IP) stack capable of
both TCP and UDP. It supports up to four simultaneous socket connections. Use the Ethernet
library to write sketches which connect to the internet using the shield. The Ethernet shield
connects to an Arduino board using long wire-wrap headers which extend through the shield. This
keeps the pin layout intact and allows another shield to be stacked on top. The most recent revision
of the board exposes the 1.0 pinot on rev 3 of the Arduino UNO board.
The Ethernet Shield has a standard RJ-45 connection, with an integrated line transformer and
Power over Ethernet enabled. There is an onboard micro-SD card slot, which can be used to store
files for serving over the network. It is compatible with all the Arduino/Genuino boards. The on-
board micro SD card reader is accessible through the SD Library. When working with this library,
SS is on Pin 4. The original revision of the shield contained a full-size SD card slot; this is not
supported.
The shield also includes a reset controller, to ensure that the W5100 Ethernet module is properly
reset on power-up. Previous revisions of the shield were not compatible with the Mega and need to
be manually reset after power-up. The current shield has a Power over Ethernet (PoE) module
designed to extract power from a conventional twisted pair Category 5 Ethernet cable:
 IEEE802.3af compliant
 Low output ripple and noise (100mVpp)
 Input voltage range 36V to 57V
 Overload and short-circuit protection
 9V Output
 High efficiency DC/DC converter: type 75% @ 50% load
 1500V isolation (input to output)
The shield does not come with the PoE module built-in, it is a separate component that must be
added on. Arduino communicates with both the W5100 and SD card using the SPI bus (through the
ICSP header). This is on digital pins 10, 11, 12, and 13 on the Uno and pins 50, 51, and 52 on the
Mega. On both boards, pin 10 is used to select the W5100 and pin 4 for the SD card. These pins
cannot be used for general I/O. On the Mega, the hardware SS pin, 53, is not used to select either
the W5100 or the SD card, but it must be kept as an output or the SPI interface won't work.
Note that because the W5100 and SD card share the SPI bus, only one can be active at a time. If
you are using both peripherals in your program, this should be taken care of by the corresponding
libraries. If you're not using one of the peripherals in your program, however, you'll need to
explicitly deselect it. To do this with the SD card, set pin 4 as an output and write a high to it. For
the W5100, set digital pin 10 as a high output.
The shield provides a standard RJ45 Ethernet jack. The reset button on the shield resets both the
W5100 and the Arduino board.
The shield contains a number of informational LEDs:
 PWR: indicates that the board and shield are powered
 LINK: indicates the presence of a network link and flashes when the shield transmits or receives
data
 FULLD: indicates that the network connection is full duplex
 100M: indicates the presence of a 100 Mb/s network connection (as opposed to 10 Mb/s)
 RX: flashes when the shield receives data
 TX: flashes when the shield sends data
 COLL: flashes when network collisions are detected
The solder jumper marked "INT" can be connected to allow the Arduino board to receive interrupt-
driven notification of events from the W5100, but this is not supported by the Ethernet library. The
jumper connects the INT pin of the W5100 to digital pin 2 of the Arduino.
1.4.6 TELEDUINO
Teleduino converts your Ethernet enabled Arduino into a powerful and versatile tool for interacting
with devices over the internet. Not only that, but it makes it quick and easy.
Once your Teleduino is configured, it automatically connects itself to the Teleduino server when
powered on. The Teleduino server translates instructions received from the internet into actions on
the Teleduino device.
Using the Teleduino platform, you can perform the following tasks with your Arduino via the
simple web service:
 Reset, ping, get uptime, and get free memory.
 Define pin modes, set digital outputs, set analog outputs, read digital inputs, read analog inputs,
or read all inputs with a single API call.
 Define up to 2 'banks' (4 for the Mega) of shift registers. Each 'bank' can contain up to 32
cascaded shift registers, giving a total of 512 digital outputs (1024 for the Mega).
 Shift register outputs can be set, or merged, and expire times can be set on merges (you could
set an output(s) high for X number of milliseconds).
 Define, and read and write from serial port (4 for the Mega).
 Read and write from EEPROM.
 Define and position up to 6 servos (48 for the Mega).
 Interface with I2C (TWI) sensors and devices.
 Set preset values for the above functions, which get set during boot. Preset values are stored in
the first 178 bytes of the EEPROM (413 for the Mega).
1.5 PHP
1.5.1 WHAT IS PHP?
Figure 1.6: PHP Logo
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-
purpose scripting language that is especially suited for web development and can be embedded into
HTML.
1.5.2 SYNTAX
Example: An introductory example
<! DOCTYPE HTML>
<Html>
<Head>
<Title>Example</title>
</head>
<Body>
<?php
echo "Hi, I'm a PHP script!";
?>
</body>
</html>
Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain HTML
with embedded code that does "something" (in this case, output "Hi, I'm a PHP script!"). The PHP
code is enclosed in special start and end processing instructions <?php and ?> that allow you to
jump into and out of "PHP mode."
What distinguishes PHP from something like client-side JavaScript is that the code is executed on
the server, generating HTML which is then sent to the client. The client would receive the results
of running that script, but would not know what the underlying code was. You can even configure
your web server to process all your HTML files with PHP, and then there's really no way that users
can tell what you have up your sleeve.
The best things in using PHP are that it is extremely simple for a newcomer, but offers many
advanced features for a professional programmer. Don't be afraid reading the long list of PHP's
features. You can jump in, in a short time, and start writing simple scripts in a few hours.
Although PHP's development is focused on server-side scripting, you can do much more with it.
1.5.3 DATATYPES
PHP stores whole numbers in a platform-dependent range, either a 64-bit or 32-
bit signed integer equivalent to the C-language long type. Unsigned integers are converted to
signed values in certain situations; this behaviour is different from other programming languages.
Integer variables can be assigned using decimal (positive and negative), octal, hexadecimal,
and binary notations.
Floating point numbers are also stored in a platform-specific range. They can be specified using
floating point notation, or two forms of scientific notation. PHP has a native Boolean type that is
similar to the native Boolean types in Java and C++. The null data type represents a variable that
has no value; NULL is the only allowed value for this data type
1.5.4 FUNCTIONS
PHP defines a large array of functions in the core language and many are also available in various
extensions; these functions are well documented in the online PHP documentation. However, the
built-in library has a wide variety of naming conventions and associated inconsistencies.
In lieu of function pointers, functions in PHP can be referenced by a string containing their name.
In this manner, normal PHP functions can be used, for example, as callbacks or within function
tables. User-defined functions may be created at any time without being prototyped. Functions may
be defined inside code blocks, permitting a run-time decision as to whether or not a function should
be defined. There is a function_exists function that determines whether a function with a given
name has already been defined. Function calls must use parentheses, with the exception of zero-
argument class constructor functions called with the PHP operator new, in which case parentheses
are optional.
1.5.5 PHP OBJECTS
Basic object-oriented programming functionality was added in PHP 3 and improved in PHP 4. This
allowed for PHP to gain further abstraction, making creative tasks easier for programmers using the
language. Object handling was completely rewritten for PHP 5, expanding the feature set and
enhancing performance. In previous versions of PHP, objects were handled like value types. The
drawback of this method was that code had to make heavy use of PHP's "reference" variables if it
wanted to modify an object it was passed rather than creating a copy of it. In the new approach,
objects are referenced by handle, and not by value.
1.5.6 SECURITY IN PHP
PHP is a powerful language and the interpreter, whether included in a web server as a module or
executed as a separate CGI binary, is able to access files, execute commands and open network
connections on the server. These properties make anything run on a web server insecure by default.
PHP is designed specifically to be a more secure language for writing CGI programs than Perl or
C, and with correct selection of compile-time and runtime configuration options, and proper coding
practices, it can give you exactly the combination of freedom and security you need.
As there are many different ways of utilizing PHP, there are many configuration options
controlling its behaviour. A large selection of options guarantees you can use PHP for a lot of
purposes, but it also means there are combinations of these options and server configurations that
result in an insecure setup.
The configuration flexibility of PHP is equally rivalled by the code flexibility. PHP can be used to
build complete server applications, with all the power of a shell user, or it can be used for simple
server-side includes with little risk in a tightly controlled environment. How you build that
environment, and how secure it is, is largely up to the PHP developer.
1.5.7 WAMP
Figure 1.7: WampServer Logo
Stands for "Windows, Apache, MySQL, and PHP." WAMP is a variation of LAMP for Windows
systems and is often installed as a software bundle (Apache, MySQL, and PHP). It is often used
for web development and internal testing, but may also be used to serve live websites.
The most important part of the WAMP package is Apache (or "Apache HTTP Server") which is
used run the web server within Windows. By running a local Apache web server on a Windows
machine, a web developer can test WebPages in a web browser without publishing them live on the
Internet.
WAMP also includes MySQL and PHP, which are two of the most common technologies used for
creating dynamic websites. MySQL is a high-speed database, while PHP is a scripting language
that can be used to access data from the database. By installing these two components locally, a
developer can build and test a dynamic website before publishing it to a public web server.
While Apache, MySQL, and PHP are open source components that can be installed individually,
they are usually installed together. One popular package is called "WampServer," which provides a
user-friendly way to install and configure the "AMP" components on Windows.
Chapter 2
Requirement Analysis
2.1 REQUIREMENTS ANALYSIS
There are a number of requirements for this project design. The main requirements are;
 The system should be as easy to use as possible and should allow the user to access all
functionality via a web-based interface.
 The system should be designed in a modular fashion. A modular system allows for easier
implementation and well as easier modification at a later stage.
2.2 FEATURES OF A HOME AUTOMATION SYSTEM
 THE ABILITY TO CONTROL A DEVICE – This is simply the ability to turn On or Off
a device, e.g. a lamp, from the Home Automation interface.

 THE ABILITY TO AUTHENTICATE USERS – This authenticates user connections to
the Home Automation System to prevent unauthorised access.
 THE ABILITY TO ASSIGN DEVICES TO A LOGICAL GROUP – This simply
means that a collection of devices are abstracted to logical groups of devices for ease of
operation and organisation of devices. These logical groups in this project will be referred
to as ‘Rooms’ in the Home Automation System, which can hold any number of devices.
2.3GENERAL AND NON-FUNCTIONAL REQUIREMENTS
2.3.1 SECURITY REQUIREMENTS
There are security risks associated with using the Home Automation System as it is designed to
operate on a network like the Internet. When accessing the system the user needs to be assured that
intruders, such as hacker attempts and third party invasions, cannot have access to the Home
Automation System. The user therefore needs to be confident that the Home Automation System is
secure. The ability to authenticate user connections to the system is required.
To prevent unauthorised access the user has to log on to a website in order to have access to the
Home Automation System. A secure system to validate the username and password information is
required. The system will accept this information as proof of the identity and allow the user to
access the Home Automation System.
2.3.2 PERFORMANCE REQUIREMENTS
 Speed of the Internet connection from the remote computer and the speed of the connection
to the server will affect performance. The Home Automation System will be designed to be
capable of operating even with slow Internet connections e.g. a standard 56K modem dial
up connection to the network.
 The Home Automation System will be designed to operate on a standard personal computer
with a standard web browser installed. Response times to commands should be minimal
from the browser.
 The size of the website HTML, PHP and jQuery code should be minimized to improve
performance on slower connections to the Internet. The means minimising use of graphics
and concentrating on a more functional design. This will be addressed in more detail in
Section 2.3.3 User Interface Requirements section.
 Efficiency of the software code will have an effect on how quickly commands to the system
are given. Every effort will be made to design the code with performance in mind.
 Hardware connected to the system may suffer from a latency factor between issuing of a
command and when that command is carried out. This will be taken into account and may
influence how fast the commands are processed within the system.
2.3.3 USER INTERFACE REQUIREMENTS
 The user interface of the Home Automation System should be intuitive and easy to use. We
plan to provide a web-based interface for users to access the Home Automation System.
This will enable users to use the system more easily, since it will be accessible through a
common web browser from any computer connected to the Internet. This eliminates the
need for installation and configuration of proprietary software.
 The user interface will feature the use of meaningful graphics and icons, which will allow
the user to easily identify options available. The number and size of these graphics,
however, should be kept to a minimum to improve performance on computers with slow
connections to the Internet.
 As most people are familiar with browsing on the Internet the web based user interface
should have a look and feel that is familiar to the user.
 The user interface should consist of several windows and buttons to control the different
control devices e.g. a lamp.
 The user will be able to access the status of all devices that are currently installed and
running on the Home Automation System.
 The Administrator will be able to add/remove devices to the system. The administrator will
also be view all users and their devices.
The proposed system will use a web-based Graphical User Interface, which will have the following
characteristics:
 Website – The user will be able to access the main website from any web browser.
 Login screen – This will be the main entrance to the system. This will feature a pop-up
screen and have two text boxes for typing the username and password.
 Control Panel – Once the user logs in, a navigation menu will allow the user to select all
options available from the main menu page.
2.3.4 DATA REQUIREMENTS
The data for the Home Automation System will need to be stored and accessed in a reliable and
accurate way. A database will store the username and passwords of several users at any one time.
The database will also keep track of the number and recorded status of all available automated
appliances.
Several text files will also be used to store initial start-up configuration details for the Home
Automation System. The following table illustrates the data required;
Database Tables
Register Table
Login Table
UserKey Table
Device Table
Figure2.1: Data Requirements
2.3.5 HARDWARE REQUIREMENTS
The hardware requirements for the Home Automation System consist of a computer controlled
switching mechanism that will control the device to be automated.
 Arduino Uno(R3) Figure 2.2
 USB Cable Figure 2.3
 Arudino W5100 Ethernet Shield Figure 2.4
 4 Channel 5-V Relay Board for Arduino Figure 2.5
 Male-to-Female Jumper Wires Figure 2.6
2.3.6 SOFTWARE REQUIREMENTS
During the stage of research, we use many types of software to integrate our project, this software
varies from programming software to designing, to software for circuits, etc, these software’s
names discussed before.
 Arduino IDE
 Notepad++
 Wampserver
 Microsoft Word
 MySQL
 Google Chrome
2.4CONSTRAINTS
There are several external and internal constraints associated with this project.
2.4.1 EXTERNAL CONSTRAINTS
 Power Cuts- One of the external constraints is the possibility of unreliability of electrical
power in the home. The system should be capable of operating and functioning correctly
even after such an event has occurred.
 Damage of devices- This condition will be series condition and there is no way to know the
status of the device in this condition.
2.4.2 INTERNAL CONSTRAINTS
 Software - The development of this project will be constrained to using the php, and
Arduino programming languages and related APIs.
 Functionality- The functionally of the Home Automation system will be constrained to
operating on only leds that will act as the devices on home because the difficulties of high
electricity and components that will cannot treat the high power .
CHAPTER-3
PROJECT DESCRIPTION
3.1 PROJECT OVERVIEW
Smart Home system uses three loads to demonstrate as house lighting. Our user friendly interface
allows a user to easily control these home appliances through the internet. For this system we use
an Arduino UNO board as a controller and a 5V relay. This Arduino UNO is interfaced with an
Ethernet shield w5100 to get user commands over the internet.5V Relay switch is used to send
control signals from the micro-controller (Arduino) to the electronic device used to achieve the
switching on and off action. A web portal named Smart Home is designed with a one-factor
authentication system (username and password) to check authenticity of the home user. It acts as
an input device to control the home appliances and also acts as an output device to read the values
of the physical conditions. The mobile application also utilizes this same procedure to act as an
input and output device. Hardware Circuit is powered by using USB cable from laptop. After
receiving user commands over the internet, Arduino processes these instructions to operate these
loads accordingly and display the system. Thus this system allows for efficient home automation
over the internet.
Figure 3.1: Block diagram of Smart Home System
3.2 DESIGN AND IMPLEMENTATION
A low cost and efficient smart home system is presented in our design. This system has two main
modules: the hardware interface module and the software communication module. At the heart of
this system is the Arduino UNO microcontroller which is also capable of functioning as a micro
web server and the interface for all the hardware modules. All communication and controls in this
system pass through the microcontroller. As we can see in above figure, the smart home system
offers switching functionalities to control lighting and other home appliances connected to the relay
system. All features can be controlled from the Android smart phone app or web application.
Figure 3.2: SystemArchitecture of Smart Home System
3.3 SOFTWARE MODULE: WEB APPLICATION
In this work it is implemented using the Arduino as a micro web server through which we can
connect to the hardware modules, receive status updates from them and also send control
information to the microcontroller.
Figure 3.3: Home Page
Figure 3.4: How Smart Home Works explanation Page
Figure 3.5: User Login Page
Figure 3.6: After logging, User can control devices
For our web application, which in this text is a website, we used Notepad++ as our programming
environment and we used Hypertext Pre-Processor (PHP) and also jQuery for our programming
languages. The website will control the Arduino by passing information to it as codes. In this case,
the Arduino micro-controller acts as a client and the PHP will act as a server (Wamp, IIS or
Apache servers can be used) because PHP is not a client based programming language. The design
of the web pages was chosen to be in a style as it gives user friendliness and also a colourful
display of the web items as shown in figure. The web page will display all the variables being read
from the Arduino micro-controller and also be able to perform the functions as the mobile
application. The Ethernet shield connected with the Arduino board will be the link between the
web pages and the Arduino. When connected to the IP address of the Arduino and the PHP will be
able to send information over this IP address which in turn is interpreted by the Arduino.
CHAPTER-4
CODING
4.1 HOME PAGE
<html><div id="header">
<div id="logo">
<img src="../images/logo.png" id="imglogo">
<div id="logotext"><b>SMART HOME</b></div>
<div id="div3">
<ul id="head1">
<li><a href="smart_home.php"> What is Smart Home</a> </li>
<li><a href="features.php"> Features</a> </li>
<li><a href="work.php"> How it work</a></li> </ul>
<div id="user_icon_div">
<a href="user_login.php"> <img id="user_img" src="../images/user1.png"> </a> &nbsp; &nbsp;
</div>
</div> </div>
</div>
<div id="wowslider-container1">
<div class="ws_images"><ul>
<li><img src="data1/images/homeautomation.jpg" alt="Control your Home System from
anywhere in the world.........." title="Control your Home System from anywhere in the
world.........." id="wows1_0"/><a href="user_login.php"><input id="button_start" type="button"
value="Start Here"></a></li>
<li><img src="data1/images/a.jpg" alt="Direct your Home from your favourite seat." title="Direct
your Home from your favourite seat." id="wows1_1"/></li>
<li><img src="data1/images/homeautomation_0.jpg" alt="" title="" id="wows1_2"/></li>
<li><img src="data1/images/shome1.jpg" alt="Our primary goal is to make your home systems,
safe, elegant, fun and easy to use. " title="Our primary goal is to make your home systems, safe,
elegant, fun and easy to use. " id="wows1_3"/></li>
</ul></div>
<div class="ws_bullets"><div>
<a href="#" title="Control your Home System from anywhere in the world.........."><img
src="data1/tooltips/homeautomation.jpg" alt="Control your Home System from anywhere in the
world.........."/>1</a>
<a href="#" title="Direct your Home from your favourite seat."><img src="data1/tooltips/a.jpg"
alt="Direct your Home from your favourite seat."/>2</a>
<a href="#" title=""><img src="data1/tooltips/homeautomation_0.jpg" alt=""/>3</a>
<a href="#" title="Our primary goal is to make your home systems, safe, elegant, fun and easy to
use. "><img src="data1/tooltips/shome1.jpg" alt="Our primary goal is to make your home systems,
safe, elegant, fun and easy to use. "/>4</a>
</div></div>
<a class="wsl" href="http://wowslider.com">Photo Slideshow Creator by WOWSlider.com
v3.0</a>
<div class="ws_shadow"></div>
</div>
<script type="text/javascript" src="engine1/wowslider.js"></script>
<script type="text/javascript" src="engine1/script.js"></script>
<div id="footer"><p id="foot_p"> <i> ---> Created by Shobhi Maheshwari & Pratibha
Chaudhary</i></p>
</div></body></html>
2. USER LOGIN PAGE
<html>
<body>
<div id="div1">
<img src="../images/logo.png" id="imglogo">
<div id="logotext"><b>SMART HOME</b></div>
<div id="div2">
<center>
<label id="text1"><h3>User login</h3></label><br>
<div id="div3">
<form action="user_verify.php" method="POST">
<input id="inputusername" type="text" placeholder=" Username"
name="uname">&nbsp;<span id="username_span"><br>Username is required.</span><br><br>
<input id="password" type="password" placeholder=" Password"
name="pswd">&nbsp;<span id="password_span"><br>Password is required.</span><br>
<br><br><br><input id="logbutton" type="submit" value="Login">
</form><br>
<span id="regis_span">New User Register Here</span>
</div>
</center>
</div>
<div id="register_div">
<div id="register_wrap_div">
<label><h2>New User Register here</h2></label><br>
<form action="user_register.php" method="POST">
Name<br>
<input id="first" type="text" placeholder="First" name="firstname"> &nbsp;
<input id="last" type="text" placeholder="Last" name="lastname"><br>
<span id="reg_first">First name is required</span><br>
<span id="reg_last">Last name is required</span>
<br><br>
Choose your Username<br>
<input id="reg_inputusername" type="text" name="uname"><br>
<span id="reg_username"><br>Username is required.</span><br><br>
Create a Password<br>
<input id="reg_inputpassword" type="password" placeholder="******"
name="pswd"><br>
<span id="reg_password"><br>Password is required.</span><br>
<br>Confirm Password<br>
<input id="reg_inputpasswordc" type="password" placeholder="******"
name="pswd_c"><br>
<span id="reg_passwordc"><br>Confirm Password is required.</span>
<br>
<br>E-mail ID<br>
<input id="email" type="text" placeholder="
@gmail.com" name="email"><br>
<span id="reg_email"><br>Email is required.</span><br>
<span id="reg_e"><br>Valid Email is required.</span>
<br><br>Gender<br><select id="select_gender" name="gender">
<option>I am</option>
<option>Male</option>
<option>Female</option>
</select><br>
<span id="reg_gender"><br>Gender is required.</span>
<br><br>Mobile Number
<input type="text" maxlength="10" name="mobile" id="mobile">
<br><span id="reg_mobile"><br>Mobile number is required.</span>
<br><br>Key<br>
<input type="text" maxlength="32" name="key" id="key">
<br><span id="reg_key"><br>enter key</span>
<br><br>
<input id="regbutton" type="submit" value="Register">
<br><br>
</form>
</div>
</div>
<div>
</body>
</html>
4.3 AUTHENTICATE USER (User_Verify.Php)
<?php
include "session.php";
$uname=$_POST['uname'];
$pswd=$_POST['pswd'];
$sql = "SELECT * FROM UserKey WHERE UserName = '$uname'";
$result = mysqli_query($conn,$sql);
$row = mysqli_fetch_array($result);
$_SESSION['unikey'] = $row['UniKey'];
$sql="select * from user where username='$uname'&& password='$pswd' ";
$result = mysqli_query($conn,$sql);
$row=mysqli_fetch_array($result);
if($row['password']==$pswd && $row['username']==$uname)
{
$_SESSION['username']=$uname;
$_SESSION['password']=$pswd;
header("location:controlpanel_device.php");
}
else
{
header("location:user_login.php");
}
?>
4.4 Session.php
<?php
session_start();
$servername = "localhost";
$username = "root";
$password = "admin";
$dbname = "home_automation";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
?>
4.5 MYSQL TABLES USED
Figure 4.1: MySQl Database used
Chapter 5
Conclusion
5.1 CONCLUSION:
The project in general has been successfully implemented. The software produced for the project is
functionally correct, reasonably robust, and usable. The project has met the entire General and
Non-Functional Requirements stated in Section 2, and in addition, has been implemented in a
modular fashion, which can be easily modified or rewritten at a later stage.
The user interface is easy to use, and works in all web browsers. It does not require any propriety
interfaces or plug-ins to operate. This means that the Home Automation System is accessible from
any web browser and that the system could be usable from anywhere on the Internet and therefore
from anywhere on the planet!
The software is robust. The design of the software means that most errors are caught in a non-fatal
manner, meaning that the software can continue executing even after a bad request.
Chapter 6
Future Scope
6.1 Future Scope
As the software was being developed, a number of minor shortcomings in the system were
found. There are a number of changes to the design that could be considered in future additions
to the software;
 Due to the nature of the type of Arduino module used in this project, the module did not
have the ability to respond to a request for status, so it is not possible to query devices for
status when the Home Automation System is first started. Therefore, when the system
starts, the status of devices is at first unknown, and so is assumed to be ‘Off’ for each
device.
 The performance of the software is something that could also be improved by optimising
the code if given more time. The performance gains to do this however would only be
noticeable on very slow connections to the Internet.
 Future scope of this project will include making smart home automation system that
could detect the presence of someone in a room, through sensors and manage the
appliances accordingly. This will also help towards conservation of energy and increasing
the lifetime of the appliances.
 Because of the hardware limitations of the Arduino there are only a fixed number of
devices that can be attached to the system. Further work will include trying to design
hardware that can easily be expanded o accommodate large number of devices
The changes mentioned here would not be too complex to implement. The modular design of the
system would allow for changes to be made without significant changes to the existing code.
2
REFERENCES
1 Source: Cisco IBSG, 2011.
2 Sources: U.S. Census Bureau, 2010; Forrester Research, 2003.
3 Source: Wikipedia, 2010.
4 Sources: Cisco IBSG, 2010; U.S. Census Bureau, 2010.
5 Source: “The Networked Pill,” Michael Chorost, MIT Technology Review, March
20,2008,http://www.technologyreview.com/biomedicine/20434/?a=f
6 Source: “Researchers Debut One-Cubic-Millimeter Computer, Want to Stick It in Your Eye,”
Christopher Trout, Endadget, February 26,
2011,http://www.engadget.com/2011/02/26/researchers-debut-one-cubic-
millimetercomputer-want-to-stick-i/
7 Cisco’s Internet Routing in Space (IRIS) program uses the Cisco Space Router to extend IP
access using satellites. The router eliminates the need to send data to and from an extra
ground station, which can be expensive and time-consuming. Further, Cisco Space Routers
extend IP access to areas not covered by traditional ground networks or 3G networks,
delivering consistent and pervasive IP capabilities regardless of geographic location.
8 Source: Fortune at the Bottom of the Pyramid: Eradicating Poverty Through Profits, Dr.
C.K. Prahalad.
9 Source: “India Has Its Own Kind of Power Struggle,” The Wall Street Journal, Jackie Range,
August 7, 2009.
10 Source: United Nations, 2010.
11 Source: “Smart Dust Sensor Network with Piezoelectric Energy Harvesting,” Yee Win Shwe
and Yun
12 Kit Walsh (2016-04-05). "Nest Reminds Customers That Ownership Isn't What It Used to
Be". Retrieved 2016-04-07.
13 "The Internet of Things (IoT) and Security Risks". www.symantec.com. Retrieved 2016-04-
20.
3
14 "Home Automation in the Wild: Challenges and Opportunities". Retrieved 2016-04-20
WEB REFERENCES
15 https://learn.sparkfun.com/tutorials/what-is-an-arduino
16 https://www.arduino.cc/en/reference/board
17 http://php.net/manual/en/intro-whatis.php
18 https://en.wikipedia.org/wiki/PHP
19 https://www.sparkfun.com/products/11166
20 http://php.net/manual/en/security.intro.php
21 http://www.webopedia.com/TERM/W/WAMP.html
22 http://techterms.com/definition/wamp
23 C. Liang, ICITA, 2009, http://www.icita.org/papers/34-sg-Liang- 217.pdf
24 http://en.wikipedia.org/wiki/Domotics
25 http://www.electronichouse.com/daily/smart-home/free-special-report-great-ideas-for-home-
automation/
26 http://www.safewise.com/home-security-faq/how-does-home-automation-work

More Related Content

What's hot

Home automation using IoT
Home automation using IoTHome automation using IoT
Home automation using IoTAthira_1993
 
SMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATIONSMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATIONEklavya Sharma
 
Internet of Things (IoT) Based Smart Security & Home Automation System.
Internet of Things (IoT) Based Smart Security & Home Automation System.Internet of Things (IoT) Based Smart Security & Home Automation System.
Internet of Things (IoT) Based Smart Security & Home Automation System.sayed78
 
iot based home automation
iot based home automationiot based home automation
iot based home automationparvathy s m
 
IoT home automation project
IoT home automation projectIoT home automation project
IoT home automation projectShohin Aheleroff
 
Smart Home Automation And security System
Smart Home Automation And security SystemSmart Home Automation And security System
Smart Home Automation And security SystemAmit Kundu
 
Home automation using arduino
Home automation using arduinoHome automation using arduino
Home automation using arduinoIkram Arshad
 
Final year project presentation IOT Based home security system
Final year project presentation IOT Based home security systemFinal year project presentation IOT Based home security system
Final year project presentation IOT Based home security systemSarmadMalik18
 
Home automation using wifi
Home automation using wifiHome automation using wifi
Home automation using wifiKhairunnisa Naaz
 
Arduino based Home Automation System with Android
Arduino based Home Automation System with AndroidArduino based Home Automation System with Android
Arduino based Home Automation System with AndroidSayan Seth
 
IoT Based Home Automation System over Cloud
IoT Based Home Automation System over CloudIoT Based Home Automation System over Cloud
IoT Based Home Automation System over Cloudijtsrd
 
Home automation in client server using NodeMcu approach along with user notif...
Home automation in client server using NodeMcu approach along with user notif...Home automation in client server using NodeMcu approach along with user notif...
Home automation in client server using NodeMcu approach along with user notif...Brundha Sholaganga
 
FYP PRESENTATION-ROOM MONITORING SYSTEM USING IOT
FYP PRESENTATION-ROOM MONITORING SYSTEM USING IOTFYP PRESENTATION-ROOM MONITORING SYSTEM USING IOT
FYP PRESENTATION-ROOM MONITORING SYSTEM USING IOTinrhumaira
 
Home automation system
Home automation systemHome automation system
Home automation systemNaman Gautam
 
home automation using esp8266
home automation using esp8266home automation using esp8266
home automation using esp8266smit bakori
 
Home Automation using Android Phones-Project first phase
Home Automation using Android Phones-Project first phaseHome Automation using Android Phones-Project first phase
Home Automation using Android Phones-Project first phasethrishma reddy
 

What's hot (20)

Home automation using IoT
Home automation using IoTHome automation using IoT
Home automation using IoT
 
SMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATIONSMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATION
 
Internet of Things (IoT) Based Smart Security & Home Automation System.
Internet of Things (IoT) Based Smart Security & Home Automation System.Internet of Things (IoT) Based Smart Security & Home Automation System.
Internet of Things (IoT) Based Smart Security & Home Automation System.
 
Home Automation
Home AutomationHome Automation
Home Automation
 
iot based home automation
iot based home automationiot based home automation
iot based home automation
 
IoT home automation project
IoT home automation projectIoT home automation project
IoT home automation project
 
Smart Home Automation And security System
Smart Home Automation And security SystemSmart Home Automation And security System
Smart Home Automation And security System
 
Home automation
Home automationHome automation
Home automation
 
Home automation using arduino
Home automation using arduinoHome automation using arduino
Home automation using arduino
 
Home automation using IOT
Home automation using IOTHome automation using IOT
Home automation using IOT
 
Final year project presentation IOT Based home security system
Final year project presentation IOT Based home security systemFinal year project presentation IOT Based home security system
Final year project presentation IOT Based home security system
 
Home automation using wifi
Home automation using wifiHome automation using wifi
Home automation using wifi
 
Arduino based Home Automation System with Android
Arduino based Home Automation System with AndroidArduino based Home Automation System with Android
Arduino based Home Automation System with Android
 
IoT Based Home Automation System over Cloud
IoT Based Home Automation System over CloudIoT Based Home Automation System over Cloud
IoT Based Home Automation System over Cloud
 
Home automation in client server using NodeMcu approach along with user notif...
Home automation in client server using NodeMcu approach along with user notif...Home automation in client server using NodeMcu approach along with user notif...
Home automation in client server using NodeMcu approach along with user notif...
 
IOT PPT
IOT PPTIOT PPT
IOT PPT
 
FYP PRESENTATION-ROOM MONITORING SYSTEM USING IOT
FYP PRESENTATION-ROOM MONITORING SYSTEM USING IOTFYP PRESENTATION-ROOM MONITORING SYSTEM USING IOT
FYP PRESENTATION-ROOM MONITORING SYSTEM USING IOT
 
Home automation system
Home automation systemHome automation system
Home automation system
 
home automation using esp8266
home automation using esp8266home automation using esp8266
home automation using esp8266
 
Home Automation using Android Phones-Project first phase
Home Automation using Android Phones-Project first phaseHome Automation using Android Phones-Project first phase
Home Automation using Android Phones-Project first phase
 

Similar to IoT Home Automation System

Design of a Hybrid Authentication Technique for User and Device Authenticatio...
Design of a Hybrid Authentication Technique for User and Device Authenticatio...Design of a Hybrid Authentication Technique for User and Device Authenticatio...
Design of a Hybrid Authentication Technique for User and Device Authenticatio...IRJET Journal
 
Data Value Creation in the Industrial IoT
Data Value Creation in the Industrial IoTData Value Creation in the Industrial IoT
Data Value Creation in the Industrial IoTSemyon Teplisky
 
Compiler design presentaion
Compiler design presentaionCompiler design presentaion
Compiler design presentaionMdShahinAlam25
 
The Best IoT Embedded Course: A Comprehensive Guide 2024
The Best IoT Embedded Course: A Comprehensive Guide 2024The Best IoT Embedded Course: A Comprehensive Guide 2024
The Best IoT Embedded Course: A Comprehensive Guide 2024SivaPriyaHariharan1
 
Fundamental Concept of Internet of Things
Fundamental Concept of Internet of ThingsFundamental Concept of Internet of Things
Fundamental Concept of Internet of ThingsIRJET Journal
 
Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report
Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report
Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report Raybaen
 
Home Automation using IOT and Mobile App
Home Automation using IOT and Mobile AppHome Automation using IOT and Mobile App
Home Automation using IOT and Mobile AppIRJET Journal
 
HOME-AUTOMATION-SYSTEM-USING-INTERNET-OF-THINGS.pdf
HOME-AUTOMATION-SYSTEM-USING-INTERNET-OF-THINGS.pdfHOME-AUTOMATION-SYSTEM-USING-INTERNET-OF-THINGS.pdf
HOME-AUTOMATION-SYSTEM-USING-INTERNET-OF-THINGS.pdfKanagarajanSwamiappa
 
IRJET - Smart Classroom Automation based on IoT
IRJET -  	  Smart Classroom Automation based on IoTIRJET -  	  Smart Classroom Automation based on IoT
IRJET - Smart Classroom Automation based on IoTIRJET Journal
 
IRJET - Android based Secure and Smart Home Application using IoT
IRJET -  	  Android based Secure and Smart Home Application using IoTIRJET -  	  Android based Secure and Smart Home Application using IoT
IRJET - Android based Secure and Smart Home Application using IoTIRJET Journal
 
UBIQUITOUS SMART HOME SYSTEM USING ANDROID APPLICATION
UBIQUITOUS SMART HOME SYSTEM USING ANDROID APPLICATIONUBIQUITOUS SMART HOME SYSTEM USING ANDROID APPLICATION
UBIQUITOUS SMART HOME SYSTEM USING ANDROID APPLICATIONIJCNCJournal
 
summaryg.pdffgdfgdfgfgfgfgfgffgfdfgfgffg
summaryg.pdffgdfgdfgfgfgfgfgffgfdfgfgffgsummaryg.pdffgdfgdfgfgfgfgfgffgfdfgfgffg
summaryg.pdffgdfgdfgfgfgfgfgffgfdfgfgffgHakkemB
 
Implementation of Real Time Home Automation of Embedded System Design with In...
Implementation of Real Time Home Automation of Embedded System Design with In...Implementation of Real Time Home Automation of Embedded System Design with In...
Implementation of Real Time Home Automation of Embedded System Design with In...IRJET Journal
 
INTERNET OF THINGS AS A TOOL FOR ENHANCEMENT OF EDUCATION ADMINISTRATION AND ...
INTERNET OF THINGS AS A TOOL FOR ENHANCEMENT OF EDUCATION ADMINISTRATION AND ...INTERNET OF THINGS AS A TOOL FOR ENHANCEMENT OF EDUCATION ADMINISTRATION AND ...
INTERNET OF THINGS AS A TOOL FOR ENHANCEMENT OF EDUCATION ADMINISTRATION AND ...IAEME Publication
 
IRJET- Smart Home Automation using IoT with Security Features
IRJET- Smart Home Automation using IoT with Security FeaturesIRJET- Smart Home Automation using IoT with Security Features
IRJET- Smart Home Automation using IoT with Security FeaturesIRJET Journal
 

Similar to IoT Home Automation System (20)

Design of a Hybrid Authentication Technique for User and Device Authenticatio...
Design of a Hybrid Authentication Technique for User and Device Authenticatio...Design of a Hybrid Authentication Technique for User and Device Authenticatio...
Design of a Hybrid Authentication Technique for User and Device Authenticatio...
 
iot m1.pdf
iot m1.pdfiot m1.pdf
iot m1.pdf
 
INTERNSHIP PPT JP.pptx
INTERNSHIP PPT JP.pptxINTERNSHIP PPT JP.pptx
INTERNSHIP PPT JP.pptx
 
Data Value Creation in the Industrial IoT
Data Value Creation in the Industrial IoTData Value Creation in the Industrial IoT
Data Value Creation in the Industrial IoT
 
smart automation system
smart automation systemsmart automation system
smart automation system
 
Compiler design presentaion
Compiler design presentaionCompiler design presentaion
Compiler design presentaion
 
The Best IoT Embedded Course: A Comprehensive Guide 2024
The Best IoT Embedded Course: A Comprehensive Guide 2024The Best IoT Embedded Course: A Comprehensive Guide 2024
The Best IoT Embedded Course: A Comprehensive Guide 2024
 
Fundamental Concept of Internet of Things
Fundamental Concept of Internet of ThingsFundamental Concept of Internet of Things
Fundamental Concept of Internet of Things
 
Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report
Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report
Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report
 
Home Automation using IOT and Mobile App
Home Automation using IOT and Mobile AppHome Automation using IOT and Mobile App
Home Automation using IOT and Mobile App
 
HOME-AUTOMATION-SYSTEM-USING-INTERNET-OF-THINGS.pdf
HOME-AUTOMATION-SYSTEM-USING-INTERNET-OF-THINGS.pdfHOME-AUTOMATION-SYSTEM-USING-INTERNET-OF-THINGS.pdf
HOME-AUTOMATION-SYSTEM-USING-INTERNET-OF-THINGS.pdf
 
IRJET - Smart Classroom Automation based on IoT
IRJET -  	  Smart Classroom Automation based on IoTIRJET -  	  Smart Classroom Automation based on IoT
IRJET - Smart Classroom Automation based on IoT
 
IRJET - Android based Secure and Smart Home Application using IoT
IRJET -  	  Android based Secure and Smart Home Application using IoTIRJET -  	  Android based Secure and Smart Home Application using IoT
IRJET - Android based Secure and Smart Home Application using IoT
 
UBIQUITOUS SMART HOME SYSTEM USING ANDROID APPLICATION
UBIQUITOUS SMART HOME SYSTEM USING ANDROID APPLICATIONUBIQUITOUS SMART HOME SYSTEM USING ANDROID APPLICATION
UBIQUITOUS SMART HOME SYSTEM USING ANDROID APPLICATION
 
azeem final iot report.docx
azeem final iot report.docxazeem final iot report.docx
azeem final iot report.docx
 
summaryg.pdffgdfgdfgfgfgfgfgffgfdfgfgffg
summaryg.pdffgdfgdfgfgfgfgfgffgfdfgfgffgsummaryg.pdffgdfgdfgfgfgfgfgffgfdfgfgffg
summaryg.pdffgdfgdfgfgfgfgfgffgfdfgfgffg
 
Implementation of Real Time Home Automation of Embedded System Design with In...
Implementation of Real Time Home Automation of Embedded System Design with In...Implementation of Real Time Home Automation of Embedded System Design with In...
Implementation of Real Time Home Automation of Embedded System Design with In...
 
Chapter 4 - EMTE.pptx
Chapter 4 - EMTE.pptxChapter 4 - EMTE.pptx
Chapter 4 - EMTE.pptx
 
INTERNET OF THINGS AS A TOOL FOR ENHANCEMENT OF EDUCATION ADMINISTRATION AND ...
INTERNET OF THINGS AS A TOOL FOR ENHANCEMENT OF EDUCATION ADMINISTRATION AND ...INTERNET OF THINGS AS A TOOL FOR ENHANCEMENT OF EDUCATION ADMINISTRATION AND ...
INTERNET OF THINGS AS A TOOL FOR ENHANCEMENT OF EDUCATION ADMINISTRATION AND ...
 
IRJET- Smart Home Automation using IoT with Security Features
IRJET- Smart Home Automation using IoT with Security FeaturesIRJET- Smart Home Automation using IoT with Security Features
IRJET- Smart Home Automation using IoT with Security Features
 

Recently uploaded

OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 

Recently uploaded (20)

OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 

IoT Home Automation System

  • 1. A PROJECT REPORT ON “IoT Home Automation System” Contribution: Web Designing, Coding & Database Management AMITY SCHOOL OF ENGINEERING & TECHNOLOGY AMITY UNIVERSITY RAJASTHAN Guide- Ms. Pooja Parnami Asst. Professor, ASET Submitted by- Pratibha Chaudhary B.Tech (CSE, VIII Semester)
  • 2. ABSTRACT With the rising power of technology, we are able to accomplish things at a much quicker rate. We have at the touch of a button access to large amounts of information due to the capability of computers and the Internet. Not only has technology given us more information, but it also has given us the ability to communicate, organize, and manage our time. And with the inception of IoT, the home automation has become important, because it gives the user the comfortable and easily for using the home devices. The implementation and design of wireless home automation control has two primary components: a circuit (using Arduino) embedded in the user’s home and a web application that will provide the interface to operate this circuit and the appliances attached to it, from a remote location. Only authorized people will have the right to access the system and the system administrator can authorize people that can access it.
  • 3. D E C L A R A T I O N I hereby declare that the project entitled “IoT Home Automation System” submitted for the partial fulfillment of B. Tech Degree is my original work and the project has not formed the basis for the award of any degree, associate ship, fellowship or any other similar titles. Signature of the Student: Pratibha Chaudhary Programme: B. Tech (CSE, VIII Semester) Place: Jaipur Date:
  • 4. ACKNOWLEDGEMENT It is indeed a great pleasure and matter of immense satisfaction for us to express our deep sense profound gratitude towards all the people who have helped, inspired us in our project work. First we would like to give our gratitude to Ms. Pooja Parnami (Assistant Professor, ASET) for the effort taken by her right from the selection of the project to its completion. She spent her precious time whenever we were in need of guidance. Moreover we would like to thank Mr. Anil Saroliya (Assistant Professor, ASET), who was always there whenever we needed any support and was a constant source of inspiration for accomplishment of this project. Pratibha Chaudhary
  • 5. Table Of Contents Title page i Abstract ii Declaration iii Acknowledgment iv Table of Contents v List of Figure viii 1 Introduction 1 1.1 Aims & Objective 2 1.2 Internet of Things 2 1.2.1 Introduction: Towards Ubiquity 2 1.2.2 A Dynamic Internet 3 1.2.3 IoT as a Network of Networks 4 1.2.4 Why is IoT Important 4 1.2.5 IoT: Critical for Human Progression 5 1.2.6 IoT Applications 5 1.2.7 Mumbai: A Tale of Two Cities 5 1.2.8 Better Quality Life for Elderly 6 1.2.9 Challenges and Barriers to IoT 6 1.3 Home Automation Systems 7 1.3.1 Evolution of Home Automation Systems 7 1.3.2 Home Automation Developments 8 1.3.2.1 Automation 9 1.3.2.2 Remote Control 9 1.3.2.3 Home Automation Components 9 1.3.2.4 Energy Efficiency 9 1.3.3 Potential Risks and Limitations 10 1.4 Arduino 10 1.4.1 Introduction 10 1.4.2 What’s on the Board? 11 1.4.3 Communication 13 1.4.4 The Structure of an Arduino Program 14 1.4.5 Arduino Ethernet Shield 15 1.4.6 Teleduino 16 1.5 Php 17
  • 6. 1.5.1 What is Php? 17 1.5.2 Syntax 18 1.5.3 Datatypes 19 1.5.4 Functions 19 1.5.5 Php Objects 19 1.5.6 Security in Php 20 1.5.7 Wamp 21 2 Requirement Analysis 22 2.1 Requirement Analysis 23 2.2 Features of a Home Automation System 23 2.3 General and Non-Functional Requirements 23 2.3.1 Security Requirements 23 2.3.2 Performance Requirements 24 2.3.3 User Interface Requirements 24 2.3.4 Data Requirements 25 2.3.5 Hardware Requirements 26 2.3.6 Software Requirements 27 2.4 Constraints 27 2.4.1 External Constraints 27 2.4.2 Internal Constraints 27 3 Project Description 28 3.1 Project Overview 29 3.2 Design and Implementations 29 3.3 Software Module: Web Application 30 4 Coding 34 4.1 Home Page 35 4.2 User Login Page 37 4.3 Authenticate user(log_verify.php) 39 4.4 Session.php 40 4.5 MySQL tables used 41
  • 7. 5 Conclusion 42 5.1 Conclusion 43 6 Future Scope 44 6.1 Future Scope 45 References 46
  • 8. List Of Figures Sr. no. Figure No. Figure Title Page No 1 Figure 1.1 The IoT was Born Between 2008 and 2009 4 2 Figure 1.2 IoT can be viewed as a Network of Networks 4 3 Figure 1.3 Arduino UNO(R3) 11 4 Figure 1.4 Schematic Diagram of Arduino 12 5 Figure 1.5 Structure of an Arduino Program 15 6 Figure 1.6 Php logo 18 7 Figure 1.7 WampServer Logo 21 8 Figure 2.1 Data Requirements 26 9 Figure 2.2 Arduino UNO(R3) 27 10 Figure 2.3 USB cable 27 11 Figure 2.4 W5100 Ethernet shield 27 12 Figure 2.5 4-channel 5-V Relay Module for Arduino 27 13 Figure 2.6 Male-to-Female Jumper Wires 27 14 Figure 3.1 Block diagram of smart home system 30 15 Figure 3.2 System Architecture 31 16 Figure 3.3 Home Page 32 17 Figure 3.4 Explanation Page 32 18 Figure 3.5 User Login Page 33 19 Figure 3.6 User Control Page 33 20 Figure 4.1 MySQL Database used 41
  • 10. The project titled ’IoT Home Automation System’ is designed and implemented using Arduino, PHP and MySQL. The project aims provide user with an automated means to control the devices in their homes using a web application from anywhere on the planet. Home automation gives you access to control devices in your home from a mobile device anywhere in the world. The term may be used for isolated programmable devices, like thermostats and sprinkler systems, but home automation more accurately describes homes in which nearly everything -- lights, appliances, electrical outlets, heating and cooling systems -- are hooked up to a remotely controllable network. From a home security perspective, this also includes your alarm system, and all of the doors, windows, locks, smoke detectors, surveillance cameras and any other sensors that are linked to it. 1.1 AIMS AND OBJECTIVE The proposed project is called “Home Automation System” and it has two primary components: a circuit embedded in the user’s home and an android application that will provide the interface to operate this circuit and the appliances attached to it, from a remote location. Only authorised people will have the right to access the system and the system administrator can authorise people that can access it. 1.2 INTERNET OF THINGS 1.2.1 INTRODUCTION: TOWARDS UBIQUITY Born in the last century, the internet uses a coding system currently based on 32 bit addresses, which permits the definition of some 4 billion or so separate items. Today, electronic product codes for individual items have emerged for use on tiny tags fixed with radio transmitters. As the internet grows, it needs to encompass more and more elements of the real world, and therefore the abstraction has to be more complex too. Simplicity is no longer an option. Communications will become increasingly ubiquitous in daily life, increasingly requiring identifying and addressing systems. Our attempts to develop a structure for the internet will more intensely map the real world onto cyberspace in increasing detail. In this context, technological ubiquity and complexity will drive the future communication landscape. 1.2.2 A DYNAMIC INTERNET
  • 11. According to the Cisco Internet Business Solutions Group (IBSG), IoT is simply the point in time when more “things or objects” were connected to the Internet than people. [1] In 2003, there were approximately 6.3 billion people living on the planet and 500 million devices connected to the Internet. [2] By dividing the number of connected devices by the world population, we find that there was less than one (0.08) device for every person. Based on Cisco IBSG’s definition, IoT didn’t yet exist in 2003 because the number of connected things was relatively small given that ubiquitous devices such as smartphones were just being introduced. For example, Steve Jobs, Apple’s CEO, didn’t unveil the iPhone until January 9, 2007 at the Macworld conference. [3] Explosive growth of smartphones and tablet PCs brought the number of devices connected to the Internet to 12.5 billion in 2010, while the world’s human population increased to 6.8 billion, making the number of connected devices per person more than 1 (1.84 to be exact) for the first time in history. [4] By 2015 more than 25 billion devices were connected to the Internet and looking to the future, Cisco IBSG predicts the statistic will increase to 50 billion by 2020. It is important to note that these estimates do not take into account rapid advances in Internet or device technology; the numbers presented are based on what is known to be true today. Figure 1.1. The Internet of Things Was “Born” Between 2008 and 2009 1.2.3 IOT AS A NETWORK OF NETWORKS Currently, IoT is made up of a loose collection of disparate, purpose-built networks. Today’s cars, for example, have multiple networks to control engine function, safety features, communications systems, and so on. Commercial and residential buildings also have various
  • 12. control systems for heating, venting, and air conditioning (HVAC); telephone service; security; and lighting. As IoT evolves, these networks, and many others, will be connected with added security, analytics, and management capabilities (see Figure 2). This will allow IoT to become even more powerful in what it can help people achieve. Figure 1.2. IoT Can Be Viewed as a Network of Networks 1.2.4 WHY IS IOT IMPORTANT? IoT IS immensely important because it is the first real evolution of the Internet—a leap that will lead to revolutionary applications that have the potential to dramatically improve the way people live, learn, work, and entertain themselves. Already, IoT has made the Internet sensory (temperature, pressure, vibration, light, moisture, stress), allowing us to become more proactive and less reactive. In addition, the Internet is expanding into places that until now have been unreachable. Patients are ingesting Internet devices into their own bodies to help doctors diagnose and determine the causes of certain diseases. [5] Extremely small sensors can be placed on plants, animals, and geologic features, and connected to the Internet. [6] At the other end of the spectrum, the Internet is going into space through Cisco’s Internet Routing in Space (IRIS) program. [7] 1.2.5 IOT: CRITICAL FOR HUMAN PROGRESSION As the planet’s population continues to increase, it becomes even more important for people to become stewards of the earth and its resources. In addition, people desire to live healthy, fulfilling, and comfortable lives for themselves, their families, and those they care about. By combining the ability of the next evolution of the Internet (IoT) to sense, collect, transmit, analyze, and distribute data on a massive scale with the way people process information, humanity will have the
  • 13. knowledge and wisdom it needs not only to survive, but to thrive in the coming months, years, decades, and centuries. 1.2.6 IOT APPLICATIONS When we crossed the threshold of connecting more objects than people to the Internet, a huge window of opportunity opened for the creation of applications in the areas of automation, sensing, and machine-to-machine communication. In fact, the possibilities are almost endless. The following examples highlight some of the ways IoT is changing people’s lives for the better. 1.2.7 MUMBAI: A TALE OF TWO CITIES The amount people from Dharavi pay for municipal-grade water is $1.12 per cubic meter. This compares to $0.03 for residents of Warden Road. The injustice is clear: the poor people of Mumbai pay 37 times more for water (a basic human necessity)[8] The main source of the disparity is the higher cost of delivering utility services to poorer neighbourhoods because of infrastructure inefficiencies, problems such as leaks, and theft. IoT, because of its ubiquitous sensors and connected systems, will provide authorities with more information and control in order to identify and fix these problems. This will allow utilities to operate more profitably, giving them extra incentive to improve infrastructures in poorer neighbourhoods. More efficiency will also allow for lower prices, which, in turn, will encourage those taking services for free to become paying customers. [9] 1.2.8 BETTER QUALITY OF LIFE FOR THE ELDERLY The world’s population is aging. In fact, approximately 1 billion people age 65 and older will be classified as having reached “non-working age” by the middle of the century.[10] IoT can significantly improve quality of life for the surging number of elderly people. For example, imagine a small, wearable device that can detect a person’s vital signs and send an alert to a healthcare professional when a certain threshold has been reached, or sense when a person has fallen down and can’t get up. 1.2.9 CHALLENGES AND BARRIERS TO IOT Several barriers, however, have the potential to slow the development of IoT. The three largest are the deployment of IPv6, power for sensors, and agreement on standards.
  • 14.  DEPLOYMENT OF IPv6: The world ran out of IPv4 addresses in February 2010. While no real impact has been seen by the general public, this situation has the potential to slow IoT’s progress since the potentially billions of new sensors will require unique IP addresses. In addition, IPv6 makes the management of networks easier due to auto configuration capabilities and offers improved security features.  SENSOR ENERGY: For IoT to reach its full potential, sensors will need to be self- sustaining. Imagine changing batteries in billions of devices deployed across the planet and even into space. Obviously, this isn’t possible. What’s needed is a way for sensors to generate electricity from environmental elements such as vibrations, light, and airflow.[11] In a significant breakthrough, scientists announced a commercially viable nanogenerator—a flexible chip that uses body movements such as the pinch of a finger to generate electricity—at the 241st National Meeting & Exposition of the American Chemical Society in March 2011.[12]  STANDARDS: While much progress has been made in the area of standards, more is needed, especially in the areas of security, privacy, architecture, and communications. IEEE is just one of the organizations working to solve these challenges by ensuring that IPv6 packets can be routed across different network types. It is important to note that while barriers and challenges exist, they are not insurmountable. Given the benefits of IoT, these issues will get worked out. It is only a matter of time. 1.3 HOME AUTOMATION SYSTEMS 1.3.1 INTRODUCTION: EVOLUTION OF HOME AUTOMATION SYSTEMS. The concept of “automation” has existed for many years. It began with a student connecting two electric wires to the hands of an alarm clock in order to close a circuit of a battery and light bulb. Later, companies developed automated systems of their own to control alarms, sensors, actuators and video cameras and, in so doing, created the first automated buildings. The term “intelligent home” followed. Due to the obvious advantages of these systems, their influence on the conventional home was predictable and finally, in 1988, the term domotics was coined. “Domotics is the application of computer and robot technologies to domestic appliances. It is a portmanteau word formed from domus (Latin, meaning house) and robotics” .[13] A modern definition of Domotics could be the interaction of technologies and services applied to different buildings with the purpose of increasing security, comfort, communications and energy savings (Moraes et al., 2000).
  • 15. At the beginning automated devices were independent or, sometimes, grouped in small independent systems. But the idea of giving them interoperability using a common “language” keeps on growing up, consequently following such idea the first Home Automation Systems (HASs) appeared bringing a new concept of a home network full of possibilities. The smart home and home automation market is rapidly expanding. Every week more products and features are becoming available, and the attractive prices make this the perfect time to check out smart home products for your family. Here are four of the best reasons to get started in home automation now:  STAY CONNECTED TO YOUR FAMILY: With the right sensors and alerts, your smart home can let you know when your children have arrived home from school, when they’ve gone out and whether they turned the lights off and locked the door when they left. If you include web-connected security cameras in your system, you can even see who’s in the house when you’re away.  STAY CONNECTED TO YOUR HOME: Just because you’re not in your home doesn’t mean you can’t monitor it. Water leak sensors, door and window sensors, motion detectors, smoke alarms and more can all be configured to send important alerts to your Smartphone. Lighting and heating/air-conditioning systems can also be operated remotely with a home automation system. Don’t return from vacation to a house that’s too hot or too cold. Just open up the app for your smart thermostat and adjust the temperature before you even pull into your street.  SAVE ENERGY: We waste a lot of energy, and money, every day because we don’t take the time to make small but important adjustments to our homes, such as turning off lights, opening and lowering shades and adjusting our thermostats. All those tasks can be automated so they happen without you ever needing to think about it.  MANAGE YOUR LIFE INSTEAD OF YOUR DEVICES: Does it sometimes seem like your electronics are more in charge of you than you are of them? Does it take 10 steps to simply settle into your chair to enjoy music and a book? Your home automation system can be programmed with lifestyle scenes that automatically adjust all your systems (lights, temperature, entertainment, security) with one simple command so you can get on with your life. 1.3.2 HOME AUTOMATION DEVELOPMENTS
  • 16. Until fairly recently, automated central control of building-wide systems was found only in larger commercial buildings and expensive homes. Typically involving only lighting, heating and cooling systems, building automation rarely provided more than basic control, monitoring and scheduling functions and was accessible only from specific control points within the building itself. The first and most obvious beneficiaries of this approach are "smart" devices and appliances that can be connected to a local area network, via Ethernet or Wi-Fi. However, electrical systems and even individual points, like light switches and electrical outlets, were also integrated into home automation networks, and businesses have even explored the potential of IP-based inventory tracking. Although the day is still far off when you'll be able to use your mobile browser to track down a lost sock, home networks are capable of including an increasing number of devices and systems. 1.3.2.1 AUTOMATION Automation is, unsurprisingly, one of the two main characteristics of home automation. Automation refers to the ability to program and schedule events for the devices on the network. The programming may include time-related commands, such as having your lights turn on or off at specific times each day. It can also include non-scheduled events, such as turning on all the lights in your home when your security system alarm is triggered. 1.3.2.2 REMOTE CONTROL The other main characteristic of cutting-edge home automation is remote monitoring and access. Monitoring apps can provide a wealth of information about your home, from the status of the current moment to a detailed history of what has happened up to now. You can check your security system's status, whether the lights are on, whether the doors are locked, what the current temperature of your home is and much more. With cameras as part of your home automation system, you can even pull up real-time video feeds and literally see what's going on in your home while you're away. 1.3.2.3 HOME AUTOMATION COMPONENTS Where home automation becomes truly "smart" is in the Internet-enabled devices that attach to this network and control it. The classic control unit is the home computer, for which many of the earlier home automation systems were designed. Today's home automation systems are more likely to distribute programming and monitoring control between a dedicated device in the home, like the
  • 17. control panel of a security system, and a user-friendly app interface that can be accessed via an Internet-enabled PC, Smartphone or tablet. 1.3.2.4 ENERGY EFFICIENCY One clear advantage of home automation is the unmatched potential for energy savings, and therefore cost savings. Your thermostat is already "smart" in the sense that it uses a temperature threshold to govern the home's heating and cooling system. In most cases, thermostats can also be programmed with different target temperatures in order to keep energy usage at a minimum during the hours when you're least likely to benefit from the heating and cooling. 1.3.3 POTENTIAL RISKS AND LIMITATIONS Many home automation devices rely on external dependencies. For example, in 2016 the "Revolv Hub" promised a "Lifetime Subscription" which depended on servers that Google took ownership of in 2014 and decided to shut down permanently. This left their users with a bricked device. [14] Other examples include remotely disabled privacy settings on Android smartphones, removed ability to run GNU/Linux on a Playstation 3, remotely re-enforced EULA on Wii U etc. [15] Another aspect is that owners that bought their device are not free to point their devices at a different server, or collaborate on improved software. As such action violates the United States DMCA section 1201, which however in 2015 got an exemption for "local use" or in local networks. These force tinkerers into a legal grey area if they want to make their device work. [15] The Electronic Frontier Foundation thinks buyers should refuse electronics and software that prioritize the manufacturer's wishes above their own. [15]  RISKS: Often IoT devices lack stringent security measures; some attacks are already capable of exploiting vulnerabilities in Linux-based IoT systems and routers. Sometimes attackers come in over the bridge from traditional IT systems into "operational" technology (OT) or IoT systems like the blast furnace or factory floor operations, or the networks supporting ATM or POS operations. Sometimes they dial-up cellular modems on these IoT devices, and other times they attack them directly over the Internet. [16]  LIMITATIONS: Some limitations of home automation include the high cost of ownership, inflexibility of interconnected devices, and poor manageability. [17] 1.4 ARDUINO 1.4.1 INTRODUCTION
  • 18. Arduino is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board. The Arduino platform has become quite popular with people just starting out with electronics, and for good reason. Unlike most previous programmable circuit boards, the Arduino does not need a separate piece of hardware (called a programmer) in order to load new code onto the board – you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to program. Finally, Arduino provides a standard form factor that breaks out the functions of the micro-controller into a more accessible package. Figure 1.3. Arduino UNO (R3) 1.4.2 WHAT'S ON THE BOARD? Looking at the board from the top down, this is an outline of what you will see (parts of the board you might interact with in the course of normal use are highlighted): Figure 1.4: Schematic Diagram of Arduino
  • 19.  POWER (USB / BARREL JACK): Every Arduino board needs a way to be connected to a power source. The Arduino UNO can be powered from a USB cable coming from your computer or a wall power supply that is terminated in a barrel jack. NOTE: Do NOT use a power supply greater than 20 Volts as you will overpower (and thereby destroy) your Arduino. The recommended voltage for most Arduino models is between 6 and 12 Volts.  PINS (5V, 3.3V, GND, ANALOG, DIGITAL, PWM, AREF): The pins on your Arduino are the places where you connect wires to construct a circuit (probably in conjunction with a breadboard and some wire. They usually have black plastic ‘headers’ that allow you to just plug a wire right into the board. The Arduino has several different kinds of pins, each of which is labelled on the board and used for different functions.  GND (3): Short for ‘Ground’. There are several GND pins on the Arduino, any of which can be used to ground your circuit.  5V (4) & 3.3V (5) : As you might guess, the 5V pin supplies 5 volts of power, and the 3.3V pin supplies 3.3 volts of power. Most of the simple components used with the Arduino run happily off of 5 or 3.3 volts.  Analog (6): The area of pins under the ‘Analog In’ label (A0 through A5 on the UNO) are Analog In pins. These pins can read the signal from an analog sensor (like a temperature sensor) and convert it into a digital value that we can read.  Digital (7): Across from the analog pins are the digital pins (0 through 13 on the UNO). These pins can be used for both digital input (like telling if a button is pushed) and digital output (like powering an LED).  PWM (8): You may have noticed the tilde (~) next to some of the digital pins (3, 5, 6, 9, 10, and 11 on the UNO). These pins act as normal digital pins, but can also be used for something called Pulse-Width Modulation (PWM). We have a tutorial on PWM, but for now, think of these pins as being able to simulate analog output (like fading an LED in and out).  AREF (9): Stands for Analog Reference. Most of the time you can leave this pin alone. It is sometimes used to set an external reference voltage (between 0 and 5 Volts) as the upper limit for the analog input pins  RESET BUTTON: Just like the original Nintendo, the Arduino has a reset button (10). Pushing it will temporarily connect the reset pin to ground and restart any code that is loaded on the Arduino. This can be very useful if your code doesn’t repeat, but you want to
  • 20. test it multiple times. Unlike the original Nintendo however, blowing on the Arduino doesn’t usually fix any problems.  POWER LED INDICATOR: Just beneath and to the right of the word “UNO” on your circuit board, there’s a tiny LED next to the word ‘ON’ (11). This LED should light up whenever you plug your Arduino into a power source. If this light doesn’t turn on, there’s a good chance something is wrong. Time to re-check your circuit!  TX RX LEDS: TX is short for transmit, RX is short for receive. These markings appear quite a bit in electronics to indicate the pins responsible for serial communication. In our case, there are two places on the Arduino UNO where TX and RX appear – once by digital pins 0 and 1, and a second time next to the TX and RX indicator LEDs (12). These LEDs will give us some nice visual indications whenever our Arduino is receiving or transmitting data (like when we’re loading a new program onto the board).  MAIN IC: The black thing with all the metal legs is an IC, or Integrated Circuit (13). Think of it as the brains of our Arduino. The main IC on the Arduino is slightly different from board type to board type, but is usually from the ATmega line of IC’s from the ATMEL Company. This can be important, as you may need to know the IC type (along with your board type) before loading up a new program from the Arduino software. This information can usually be found in writing on the top side of the IC. If you want to know more about the difference between various IC’s, reading the datasheets is often a good idea.  VOLTAGE REGULATOR: The voltage regulator (14) is not actually something you can (or should) interact with on the Arduino. But it is potentially useful to know that it is there and what it’s for. The voltage regulator does exactly what it says – it controls the amount of voltage that is let into the Arduino board. Think of it as a kind of gatekeeper; it will turn away an extra voltage that might harm the circuit. Of course, it has its limits, so don’t hook up your Arduino to anything greater than 20 volts. 1.4.3. COMMUNICATION UNO has communication protocols like UART Serial communication, SPI and I2C. UART: UNO uses digital pin0 (RX) and digital pin1 (TX) for UART TTL serial communication. I2C: UNO uses A4 or SDA pin and A5 or SCL pin are used for I2C communication with wire library.  SCL is the clock signal  SDA is the data signal
  • 21. NOTE: SDA and SCL pins are not extra pins available in UNO for I2C it’s a copy of pins A4 and A5. SPI: Pin11: (MOSI) Pin12: (MISO) Pin13: (SCK)  MOSI (Master Out Slave In) - The Master line for sending data to the peripherals.  MISO (Master In Slave Out) -The slave line for sending data to the master.  SCK (Serial Clock) - The clock pulse which synchronise data transmission generated by the master. ICSP headers can be used to program ATmega directly using boot loader. 1.4.4 THE STRUCTURE OF AN ARDUINO PROGRAM Every Arduino program is made up of at least two functions. The first is the setup function. This is run initially – once only – and is used to tell the Arduino what is connected and where, as well as initialising any variables you might need in your program. Second is the loop. This is the core of every Arduino program. When the Arduino is running, after the setup function has completed, the loop will run through all the code, then do the whole thing again – until either the power is lost or the reset switch is pressed. The length of time it takes to complete one full loop depends upon the code contained. You may write some code that says “wait 6 hours”, in which case the loop isn’t going to be repeating very often. Here’s a quick state diagram to illustrate: Figure 1.5: Structure of an Arduino Program 1.4.5 ARDUINO ETHERNET SHIELD The Arduino Ethernet Shield allows an Arduino board to connect to the internet. It is based on the Wiznet W5100 Ethernet chip. The Wiznet W5100 provides a network (IP) stack capable of both TCP and UDP. It supports up to four simultaneous socket connections. Use the Ethernet library to write sketches which connect to the internet using the shield. The Ethernet shield
  • 22. connects to an Arduino board using long wire-wrap headers which extend through the shield. This keeps the pin layout intact and allows another shield to be stacked on top. The most recent revision of the board exposes the 1.0 pinot on rev 3 of the Arduino UNO board. The Ethernet Shield has a standard RJ-45 connection, with an integrated line transformer and Power over Ethernet enabled. There is an onboard micro-SD card slot, which can be used to store files for serving over the network. It is compatible with all the Arduino/Genuino boards. The on- board micro SD card reader is accessible through the SD Library. When working with this library, SS is on Pin 4. The original revision of the shield contained a full-size SD card slot; this is not supported. The shield also includes a reset controller, to ensure that the W5100 Ethernet module is properly reset on power-up. Previous revisions of the shield were not compatible with the Mega and need to be manually reset after power-up. The current shield has a Power over Ethernet (PoE) module designed to extract power from a conventional twisted pair Category 5 Ethernet cable:  IEEE802.3af compliant  Low output ripple and noise (100mVpp)  Input voltage range 36V to 57V  Overload and short-circuit protection  9V Output  High efficiency DC/DC converter: type 75% @ 50% load  1500V isolation (input to output) The shield does not come with the PoE module built-in, it is a separate component that must be added on. Arduino communicates with both the W5100 and SD card using the SPI bus (through the ICSP header). This is on digital pins 10, 11, 12, and 13 on the Uno and pins 50, 51, and 52 on the Mega. On both boards, pin 10 is used to select the W5100 and pin 4 for the SD card. These pins cannot be used for general I/O. On the Mega, the hardware SS pin, 53, is not used to select either the W5100 or the SD card, but it must be kept as an output or the SPI interface won't work. Note that because the W5100 and SD card share the SPI bus, only one can be active at a time. If you are using both peripherals in your program, this should be taken care of by the corresponding libraries. If you're not using one of the peripherals in your program, however, you'll need to explicitly deselect it. To do this with the SD card, set pin 4 as an output and write a high to it. For the W5100, set digital pin 10 as a high output.
  • 23. The shield provides a standard RJ45 Ethernet jack. The reset button on the shield resets both the W5100 and the Arduino board. The shield contains a number of informational LEDs:  PWR: indicates that the board and shield are powered  LINK: indicates the presence of a network link and flashes when the shield transmits or receives data  FULLD: indicates that the network connection is full duplex  100M: indicates the presence of a 100 Mb/s network connection (as opposed to 10 Mb/s)  RX: flashes when the shield receives data  TX: flashes when the shield sends data  COLL: flashes when network collisions are detected The solder jumper marked "INT" can be connected to allow the Arduino board to receive interrupt- driven notification of events from the W5100, but this is not supported by the Ethernet library. The jumper connects the INT pin of the W5100 to digital pin 2 of the Arduino. 1.4.6 TELEDUINO Teleduino converts your Ethernet enabled Arduino into a powerful and versatile tool for interacting with devices over the internet. Not only that, but it makes it quick and easy. Once your Teleduino is configured, it automatically connects itself to the Teleduino server when powered on. The Teleduino server translates instructions received from the internet into actions on the Teleduino device. Using the Teleduino platform, you can perform the following tasks with your Arduino via the simple web service:  Reset, ping, get uptime, and get free memory.  Define pin modes, set digital outputs, set analog outputs, read digital inputs, read analog inputs, or read all inputs with a single API call.  Define up to 2 'banks' (4 for the Mega) of shift registers. Each 'bank' can contain up to 32 cascaded shift registers, giving a total of 512 digital outputs (1024 for the Mega).  Shift register outputs can be set, or merged, and expire times can be set on merges (you could set an output(s) high for X number of milliseconds).  Define, and read and write from serial port (4 for the Mega).
  • 24.  Read and write from EEPROM.  Define and position up to 6 servos (48 for the Mega).  Interface with I2C (TWI) sensors and devices.  Set preset values for the above functions, which get set during boot. Preset values are stored in the first 178 bytes of the EEPROM (413 for the Mega). 1.5 PHP 1.5.1 WHAT IS PHP? Figure 1.6: PHP Logo PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general- purpose scripting language that is especially suited for web development and can be embedded into HTML. 1.5.2 SYNTAX Example: An introductory example <! DOCTYPE HTML> <Html> <Head> <Title>Example</title> </head> <Body> <?php echo "Hi, I'm a PHP script!"; ?> </body>
  • 25. </html> Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain HTML with embedded code that does "something" (in this case, output "Hi, I'm a PHP script!"). The PHP code is enclosed in special start and end processing instructions <?php and ?> that allow you to jump into and out of "PHP mode." What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server, generating HTML which is then sent to the client. The client would receive the results of running that script, but would not know what the underlying code was. You can even configure your web server to process all your HTML files with PHP, and then there's really no way that users can tell what you have up your sleeve. The best things in using PHP are that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer. Don't be afraid reading the long list of PHP's features. You can jump in, in a short time, and start writing simple scripts in a few hours. Although PHP's development is focused on server-side scripting, you can do much more with it. 1.5.3 DATATYPES PHP stores whole numbers in a platform-dependent range, either a 64-bit or 32- bit signed integer equivalent to the C-language long type. Unsigned integers are converted to signed values in certain situations; this behaviour is different from other programming languages. Integer variables can be assigned using decimal (positive and negative), octal, hexadecimal, and binary notations. Floating point numbers are also stored in a platform-specific range. They can be specified using floating point notation, or two forms of scientific notation. PHP has a native Boolean type that is similar to the native Boolean types in Java and C++. The null data type represents a variable that has no value; NULL is the only allowed value for this data type 1.5.4 FUNCTIONS PHP defines a large array of functions in the core language and many are also available in various extensions; these functions are well documented in the online PHP documentation. However, the built-in library has a wide variety of naming conventions and associated inconsistencies. In lieu of function pointers, functions in PHP can be referenced by a string containing their name. In this manner, normal PHP functions can be used, for example, as callbacks or within function tables. User-defined functions may be created at any time without being prototyped. Functions may
  • 26. be defined inside code blocks, permitting a run-time decision as to whether or not a function should be defined. There is a function_exists function that determines whether a function with a given name has already been defined. Function calls must use parentheses, with the exception of zero- argument class constructor functions called with the PHP operator new, in which case parentheses are optional. 1.5.5 PHP OBJECTS Basic object-oriented programming functionality was added in PHP 3 and improved in PHP 4. This allowed for PHP to gain further abstraction, making creative tasks easier for programmers using the language. Object handling was completely rewritten for PHP 5, expanding the feature set and enhancing performance. In previous versions of PHP, objects were handled like value types. The drawback of this method was that code had to make heavy use of PHP's "reference" variables if it wanted to modify an object it was passed rather than creating a copy of it. In the new approach, objects are referenced by handle, and not by value. 1.5.6 SECURITY IN PHP PHP is a powerful language and the interpreter, whether included in a web server as a module or executed as a separate CGI binary, is able to access files, execute commands and open network connections on the server. These properties make anything run on a web server insecure by default. PHP is designed specifically to be a more secure language for writing CGI programs than Perl or C, and with correct selection of compile-time and runtime configuration options, and proper coding practices, it can give you exactly the combination of freedom and security you need. As there are many different ways of utilizing PHP, there are many configuration options controlling its behaviour. A large selection of options guarantees you can use PHP for a lot of purposes, but it also means there are combinations of these options and server configurations that result in an insecure setup. The configuration flexibility of PHP is equally rivalled by the code flexibility. PHP can be used to build complete server applications, with all the power of a shell user, or it can be used for simple server-side includes with little risk in a tightly controlled environment. How you build that environment, and how secure it is, is largely up to the PHP developer. 1.5.7 WAMP
  • 27. Figure 1.7: WampServer Logo Stands for "Windows, Apache, MySQL, and PHP." WAMP is a variation of LAMP for Windows systems and is often installed as a software bundle (Apache, MySQL, and PHP). It is often used for web development and internal testing, but may also be used to serve live websites. The most important part of the WAMP package is Apache (or "Apache HTTP Server") which is used run the web server within Windows. By running a local Apache web server on a Windows machine, a web developer can test WebPages in a web browser without publishing them live on the Internet. WAMP also includes MySQL and PHP, which are two of the most common technologies used for creating dynamic websites. MySQL is a high-speed database, while PHP is a scripting language that can be used to access data from the database. By installing these two components locally, a developer can build and test a dynamic website before publishing it to a public web server. While Apache, MySQL, and PHP are open source components that can be installed individually, they are usually installed together. One popular package is called "WampServer," which provides a user-friendly way to install and configure the "AMP" components on Windows.
  • 29. 2.1 REQUIREMENTS ANALYSIS There are a number of requirements for this project design. The main requirements are;  The system should be as easy to use as possible and should allow the user to access all functionality via a web-based interface.  The system should be designed in a modular fashion. A modular system allows for easier implementation and well as easier modification at a later stage. 2.2 FEATURES OF A HOME AUTOMATION SYSTEM  THE ABILITY TO CONTROL A DEVICE – This is simply the ability to turn On or Off a device, e.g. a lamp, from the Home Automation interface.   THE ABILITY TO AUTHENTICATE USERS – This authenticates user connections to the Home Automation System to prevent unauthorised access.  THE ABILITY TO ASSIGN DEVICES TO A LOGICAL GROUP – This simply means that a collection of devices are abstracted to logical groups of devices for ease of operation and organisation of devices. These logical groups in this project will be referred to as ‘Rooms’ in the Home Automation System, which can hold any number of devices. 2.3GENERAL AND NON-FUNCTIONAL REQUIREMENTS 2.3.1 SECURITY REQUIREMENTS There are security risks associated with using the Home Automation System as it is designed to operate on a network like the Internet. When accessing the system the user needs to be assured that intruders, such as hacker attempts and third party invasions, cannot have access to the Home Automation System. The user therefore needs to be confident that the Home Automation System is secure. The ability to authenticate user connections to the system is required. To prevent unauthorised access the user has to log on to a website in order to have access to the Home Automation System. A secure system to validate the username and password information is required. The system will accept this information as proof of the identity and allow the user to access the Home Automation System. 2.3.2 PERFORMANCE REQUIREMENTS  Speed of the Internet connection from the remote computer and the speed of the connection to the server will affect performance. The Home Automation System will be designed to be
  • 30. capable of operating even with slow Internet connections e.g. a standard 56K modem dial up connection to the network.  The Home Automation System will be designed to operate on a standard personal computer with a standard web browser installed. Response times to commands should be minimal from the browser.  The size of the website HTML, PHP and jQuery code should be minimized to improve performance on slower connections to the Internet. The means minimising use of graphics and concentrating on a more functional design. This will be addressed in more detail in Section 2.3.3 User Interface Requirements section.  Efficiency of the software code will have an effect on how quickly commands to the system are given. Every effort will be made to design the code with performance in mind.  Hardware connected to the system may suffer from a latency factor between issuing of a command and when that command is carried out. This will be taken into account and may influence how fast the commands are processed within the system. 2.3.3 USER INTERFACE REQUIREMENTS  The user interface of the Home Automation System should be intuitive and easy to use. We plan to provide a web-based interface for users to access the Home Automation System. This will enable users to use the system more easily, since it will be accessible through a common web browser from any computer connected to the Internet. This eliminates the need for installation and configuration of proprietary software.  The user interface will feature the use of meaningful graphics and icons, which will allow the user to easily identify options available. The number and size of these graphics, however, should be kept to a minimum to improve performance on computers with slow connections to the Internet.  As most people are familiar with browsing on the Internet the web based user interface should have a look and feel that is familiar to the user.  The user interface should consist of several windows and buttons to control the different control devices e.g. a lamp.  The user will be able to access the status of all devices that are currently installed and running on the Home Automation System.  The Administrator will be able to add/remove devices to the system. The administrator will also be view all users and their devices. The proposed system will use a web-based Graphical User Interface, which will have the following characteristics:
  • 31.  Website – The user will be able to access the main website from any web browser.  Login screen – This will be the main entrance to the system. This will feature a pop-up screen and have two text boxes for typing the username and password.  Control Panel – Once the user logs in, a navigation menu will allow the user to select all options available from the main menu page. 2.3.4 DATA REQUIREMENTS The data for the Home Automation System will need to be stored and accessed in a reliable and accurate way. A database will store the username and passwords of several users at any one time. The database will also keep track of the number and recorded status of all available automated appliances. Several text files will also be used to store initial start-up configuration details for the Home Automation System. The following table illustrates the data required; Database Tables Register Table Login Table UserKey Table Device Table Figure2.1: Data Requirements 2.3.5 HARDWARE REQUIREMENTS The hardware requirements for the Home Automation System consist of a computer controlled switching mechanism that will control the device to be automated.  Arduino Uno(R3) Figure 2.2
  • 32.  USB Cable Figure 2.3  Arudino W5100 Ethernet Shield Figure 2.4  4 Channel 5-V Relay Board for Arduino Figure 2.5  Male-to-Female Jumper Wires Figure 2.6 2.3.6 SOFTWARE REQUIREMENTS During the stage of research, we use many types of software to integrate our project, this software varies from programming software to designing, to software for circuits, etc, these software’s names discussed before.  Arduino IDE  Notepad++  Wampserver  Microsoft Word  MySQL  Google Chrome
  • 33. 2.4CONSTRAINTS There are several external and internal constraints associated with this project. 2.4.1 EXTERNAL CONSTRAINTS  Power Cuts- One of the external constraints is the possibility of unreliability of electrical power in the home. The system should be capable of operating and functioning correctly even after such an event has occurred.  Damage of devices- This condition will be series condition and there is no way to know the status of the device in this condition. 2.4.2 INTERNAL CONSTRAINTS  Software - The development of this project will be constrained to using the php, and Arduino programming languages and related APIs.  Functionality- The functionally of the Home Automation system will be constrained to operating on only leds that will act as the devices on home because the difficulties of high electricity and components that will cannot treat the high power .
  • 34. CHAPTER-3 PROJECT DESCRIPTION 3.1 PROJECT OVERVIEW Smart Home system uses three loads to demonstrate as house lighting. Our user friendly interface allows a user to easily control these home appliances through the internet. For this system we use an Arduino UNO board as a controller and a 5V relay. This Arduino UNO is interfaced with an Ethernet shield w5100 to get user commands over the internet.5V Relay switch is used to send control signals from the micro-controller (Arduino) to the electronic device used to achieve the switching on and off action. A web portal named Smart Home is designed with a one-factor authentication system (username and password) to check authenticity of the home user. It acts as an input device to control the home appliances and also acts as an output device to read the values of the physical conditions. The mobile application also utilizes this same procedure to act as an input and output device. Hardware Circuit is powered by using USB cable from laptop. After receiving user commands over the internet, Arduino processes these instructions to operate these loads accordingly and display the system. Thus this system allows for efficient home automation over the internet.
  • 35. Figure 3.1: Block diagram of Smart Home System 3.2 DESIGN AND IMPLEMENTATION A low cost and efficient smart home system is presented in our design. This system has two main modules: the hardware interface module and the software communication module. At the heart of this system is the Arduino UNO microcontroller which is also capable of functioning as a micro web server and the interface for all the hardware modules. All communication and controls in this system pass through the microcontroller. As we can see in above figure, the smart home system offers switching functionalities to control lighting and other home appliances connected to the relay system. All features can be controlled from the Android smart phone app or web application.
  • 36. Figure 3.2: SystemArchitecture of Smart Home System 3.3 SOFTWARE MODULE: WEB APPLICATION In this work it is implemented using the Arduino as a micro web server through which we can connect to the hardware modules, receive status updates from them and also send control information to the microcontroller.
  • 37. Figure 3.3: Home Page Figure 3.4: How Smart Home Works explanation Page
  • 38. Figure 3.5: User Login Page Figure 3.6: After logging, User can control devices For our web application, which in this text is a website, we used Notepad++ as our programming environment and we used Hypertext Pre-Processor (PHP) and also jQuery for our programming languages. The website will control the Arduino by passing information to it as codes. In this case, the Arduino micro-controller acts as a client and the PHP will act as a server (Wamp, IIS or Apache servers can be used) because PHP is not a client based programming language. The design of the web pages was chosen to be in a style as it gives user friendliness and also a colourful
  • 39. display of the web items as shown in figure. The web page will display all the variables being read from the Arduino micro-controller and also be able to perform the functions as the mobile application. The Ethernet shield connected with the Arduino board will be the link between the web pages and the Arduino. When connected to the IP address of the Arduino and the PHP will be able to send information over this IP address which in turn is interpreted by the Arduino.
  • 40. CHAPTER-4 CODING 4.1 HOME PAGE <html><div id="header"> <div id="logo"> <img src="../images/logo.png" id="imglogo"> <div id="logotext"><b>SMART HOME</b></div>
  • 41. <div id="div3"> <ul id="head1"> <li><a href="smart_home.php"> What is Smart Home</a> </li> <li><a href="features.php"> Features</a> </li> <li><a href="work.php"> How it work</a></li> </ul> <div id="user_icon_div"> <a href="user_login.php"> <img id="user_img" src="../images/user1.png"> </a> &nbsp; &nbsp; </div> </div> </div> </div> <div id="wowslider-container1"> <div class="ws_images"><ul> <li><img src="data1/images/homeautomation.jpg" alt="Control your Home System from anywhere in the world.........." title="Control your Home System from anywhere in the world.........." id="wows1_0"/><a href="user_login.php"><input id="button_start" type="button" value="Start Here"></a></li> <li><img src="data1/images/a.jpg" alt="Direct your Home from your favourite seat." title="Direct your Home from your favourite seat." id="wows1_1"/></li> <li><img src="data1/images/homeautomation_0.jpg" alt="" title="" id="wows1_2"/></li> <li><img src="data1/images/shome1.jpg" alt="Our primary goal is to make your home systems, safe, elegant, fun and easy to use. " title="Our primary goal is to make your home systems, safe, elegant, fun and easy to use. " id="wows1_3"/></li> </ul></div> <div class="ws_bullets"><div>
  • 42. <a href="#" title="Control your Home System from anywhere in the world.........."><img src="data1/tooltips/homeautomation.jpg" alt="Control your Home System from anywhere in the world.........."/>1</a> <a href="#" title="Direct your Home from your favourite seat."><img src="data1/tooltips/a.jpg" alt="Direct your Home from your favourite seat."/>2</a> <a href="#" title=""><img src="data1/tooltips/homeautomation_0.jpg" alt=""/>3</a> <a href="#" title="Our primary goal is to make your home systems, safe, elegant, fun and easy to use. "><img src="data1/tooltips/shome1.jpg" alt="Our primary goal is to make your home systems, safe, elegant, fun and easy to use. "/>4</a> </div></div> <a class="wsl" href="http://wowslider.com">Photo Slideshow Creator by WOWSlider.com v3.0</a> <div class="ws_shadow"></div> </div> <script type="text/javascript" src="engine1/wowslider.js"></script> <script type="text/javascript" src="engine1/script.js"></script> <div id="footer"><p id="foot_p"> <i> ---> Created by Shobhi Maheshwari & Pratibha Chaudhary</i></p> </div></body></html> 2. USER LOGIN PAGE <html> <body> <div id="div1"> <img src="../images/logo.png" id="imglogo"> <div id="logotext"><b>SMART HOME</b></div> <div id="div2"> <center>
  • 43. <label id="text1"><h3>User login</h3></label><br> <div id="div3"> <form action="user_verify.php" method="POST"> <input id="inputusername" type="text" placeholder=" Username" name="uname">&nbsp;<span id="username_span"><br>Username is required.</span><br><br> <input id="password" type="password" placeholder=" Password" name="pswd">&nbsp;<span id="password_span"><br>Password is required.</span><br> <br><br><br><input id="logbutton" type="submit" value="Login"> </form><br> <span id="regis_span">New User Register Here</span> </div> </center> </div> <div id="register_div"> <div id="register_wrap_div"> <label><h2>New User Register here</h2></label><br> <form action="user_register.php" method="POST"> Name<br> <input id="first" type="text" placeholder="First" name="firstname"> &nbsp; <input id="last" type="text" placeholder="Last" name="lastname"><br> <span id="reg_first">First name is required</span><br> <span id="reg_last">Last name is required</span> <br><br> Choose your Username<br> <input id="reg_inputusername" type="text" name="uname"><br> <span id="reg_username"><br>Username is required.</span><br><br> Create a Password<br> <input id="reg_inputpassword" type="password" placeholder="******" name="pswd"><br> <span id="reg_password"><br>Password is required.</span><br> <br>Confirm Password<br>
  • 44. <input id="reg_inputpasswordc" type="password" placeholder="******" name="pswd_c"><br> <span id="reg_passwordc"><br>Confirm Password is required.</span> <br> <br>E-mail ID<br> <input id="email" type="text" placeholder=" @gmail.com" name="email"><br> <span id="reg_email"><br>Email is required.</span><br> <span id="reg_e"><br>Valid Email is required.</span> <br><br>Gender<br><select id="select_gender" name="gender"> <option>I am</option> <option>Male</option> <option>Female</option> </select><br> <span id="reg_gender"><br>Gender is required.</span> <br><br>Mobile Number <input type="text" maxlength="10" name="mobile" id="mobile"> <br><span id="reg_mobile"><br>Mobile number is required.</span> <br><br>Key<br> <input type="text" maxlength="32" name="key" id="key"> <br><span id="reg_key"><br>enter key</span> <br><br> <input id="regbutton" type="submit" value="Register"> <br><br> </form> </div> </div> <div> </body> </html>
  • 45. 4.3 AUTHENTICATE USER (User_Verify.Php) <?php include "session.php"; $uname=$_POST['uname']; $pswd=$_POST['pswd']; $sql = "SELECT * FROM UserKey WHERE UserName = '$uname'"; $result = mysqli_query($conn,$sql); $row = mysqli_fetch_array($result); $_SESSION['unikey'] = $row['UniKey']; $sql="select * from user where username='$uname'&& password='$pswd' "; $result = mysqli_query($conn,$sql); $row=mysqli_fetch_array($result); if($row['password']==$pswd && $row['username']==$uname) { $_SESSION['username']=$uname; $_SESSION['password']=$pswd; header("location:controlpanel_device.php"); } else { header("location:user_login.php"); } ?> 4.4 Session.php <?php session_start(); $servername = "localhost";
  • 46. $username = "root"; $password = "admin"; $dbname = "home_automation"; // Create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } ?> 4.5 MYSQL TABLES USED
  • 47. Figure 4.1: MySQl Database used
  • 49. 5.1 CONCLUSION: The project in general has been successfully implemented. The software produced for the project is functionally correct, reasonably robust, and usable. The project has met the entire General and Non-Functional Requirements stated in Section 2, and in addition, has been implemented in a modular fashion, which can be easily modified or rewritten at a later stage. The user interface is easy to use, and works in all web browsers. It does not require any propriety interfaces or plug-ins to operate. This means that the Home Automation System is accessible from any web browser and that the system could be usable from anywhere on the Internet and therefore from anywhere on the planet! The software is robust. The design of the software means that most errors are caught in a non-fatal manner, meaning that the software can continue executing even after a bad request.
  • 51. 6.1 Future Scope As the software was being developed, a number of minor shortcomings in the system were found. There are a number of changes to the design that could be considered in future additions to the software;  Due to the nature of the type of Arduino module used in this project, the module did not have the ability to respond to a request for status, so it is not possible to query devices for status when the Home Automation System is first started. Therefore, when the system starts, the status of devices is at first unknown, and so is assumed to be ‘Off’ for each device.  The performance of the software is something that could also be improved by optimising the code if given more time. The performance gains to do this however would only be noticeable on very slow connections to the Internet.  Future scope of this project will include making smart home automation system that could detect the presence of someone in a room, through sensors and manage the appliances accordingly. This will also help towards conservation of energy and increasing the lifetime of the appliances.  Because of the hardware limitations of the Arduino there are only a fixed number of devices that can be attached to the system. Further work will include trying to design hardware that can easily be expanded o accommodate large number of devices The changes mentioned here would not be too complex to implement. The modular design of the system would allow for changes to be made without significant changes to the existing code.
  • 52. 2 REFERENCES 1 Source: Cisco IBSG, 2011. 2 Sources: U.S. Census Bureau, 2010; Forrester Research, 2003. 3 Source: Wikipedia, 2010. 4 Sources: Cisco IBSG, 2010; U.S. Census Bureau, 2010. 5 Source: “The Networked Pill,” Michael Chorost, MIT Technology Review, March 20,2008,http://www.technologyreview.com/biomedicine/20434/?a=f 6 Source: “Researchers Debut One-Cubic-Millimeter Computer, Want to Stick It in Your Eye,” Christopher Trout, Endadget, February 26, 2011,http://www.engadget.com/2011/02/26/researchers-debut-one-cubic- millimetercomputer-want-to-stick-i/ 7 Cisco’s Internet Routing in Space (IRIS) program uses the Cisco Space Router to extend IP access using satellites. The router eliminates the need to send data to and from an extra ground station, which can be expensive and time-consuming. Further, Cisco Space Routers extend IP access to areas not covered by traditional ground networks or 3G networks, delivering consistent and pervasive IP capabilities regardless of geographic location. 8 Source: Fortune at the Bottom of the Pyramid: Eradicating Poverty Through Profits, Dr. C.K. Prahalad. 9 Source: “India Has Its Own Kind of Power Struggle,” The Wall Street Journal, Jackie Range, August 7, 2009. 10 Source: United Nations, 2010. 11 Source: “Smart Dust Sensor Network with Piezoelectric Energy Harvesting,” Yee Win Shwe and Yun 12 Kit Walsh (2016-04-05). "Nest Reminds Customers That Ownership Isn't What It Used to Be". Retrieved 2016-04-07. 13 "The Internet of Things (IoT) and Security Risks". www.symantec.com. Retrieved 2016-04- 20.
  • 53. 3 14 "Home Automation in the Wild: Challenges and Opportunities". Retrieved 2016-04-20 WEB REFERENCES 15 https://learn.sparkfun.com/tutorials/what-is-an-arduino 16 https://www.arduino.cc/en/reference/board 17 http://php.net/manual/en/intro-whatis.php 18 https://en.wikipedia.org/wiki/PHP 19 https://www.sparkfun.com/products/11166 20 http://php.net/manual/en/security.intro.php 21 http://www.webopedia.com/TERM/W/WAMP.html 22 http://techterms.com/definition/wamp 23 C. Liang, ICITA, 2009, http://www.icita.org/papers/34-sg-Liang- 217.pdf 24 http://en.wikipedia.org/wiki/Domotics 25 http://www.electronichouse.com/daily/smart-home/free-special-report-great-ideas-for-home- automation/ 26 http://www.safewise.com/home-security-faq/how-does-home-automation-work