You are on page 1of 33

Wi-Fi Based Home Automation System

CHAPTER 1

INTRODUCTION
1.1 Introduction

A home automation system is a means that allows users to control electric


appliances of various kind. Home automation is also known as domestics, a
contraction of the words“ domestic robotics”. When home automation
principles are applied to buildings not falling in the “home” category, building
automation system is a commonly used term. The most common usage scenario
of a home automation system is lighting control, which is fairly easy to both
explain and set up.

 Automation

It is the most frequently spelled term in the field of electronics. The hunger
for automation brought many revolutions in the existing technologies. These
had greater importance than any other technologies due to its user-friendly
nature. These can be used as a replacement of the existing switches in home
which produces sparks and also results in fire accidents in few situations.
Considering the advantages of Wi-Fi an advanced automation system was
developed to control the appliances in the house.

 Wi-Fi ( Wireless Fidelity)

It is a wireless technology that uses radio frequency to transmit data through


the air. Wi-Fi has initial speeds of 1mbps to 2mbps.Wi-Fi transmits data in the
frequency band of 2.4 GHz. It implements the concept of frequency division
multiplexing technology. Range of Wi-Fi technology is 40-100 Meters. The
controlling device for the automation in the project is a Microcontroller. The
data sent from Mobile over Wi-Fi will be received by Wi-Fi module connected
to Microcontroller. Microcontroller reads the data and decides the switching
action of electrical devices connected to it through Relays and Triac switches.
The Microcontroller is programmed used embedded „C‟ language.

Department of Electronics Engineering Page 1


Wi-Fi Based Home Automation System

 Home Automation System

It is a technique to use computer/smart phone and information technology in


controlling home appliances and home features is called HOME
AUTOMATION SYSTEM

1.2 Necessity

Now a days home and building automation systems are used more and more.
On the one hand, they provide increased comfort especially when employed in a
private Home. On the other hand, automation systems installed in commercial
buildings do not only increase comfort, but also allow centralized control of
heating, ventilation, air condition and lighting. Hence, they contribute to an
overall cost reduction and also to energy saving which is certainly a main issue
today. Existing, well-established systems are based on wired communication.
Examples include backed, Lon works and KNX. Employing a traditional wired
automation system does not pose a problem as long as the system is planned
before and installed during the physical construction of the building. If,
however, already existing buildings should be augmented with automation
systems, this requires much effort and mush cost since cabling is necessary.
Obviously, wireless systems can come to help here. In the past few years,
wireless technologies reached their breakthrough. Wireless based systems, used
every day and everywhere, ranges from wireless home networks and mobile
phones to garage door openers. As of today, little comparative research of
wireless automation standards has been done, although such knowledge would
provide valuable information to everyone looking for the most suitable system
for given requirements.

1.3 Objectives

• Wireless control of devices.


• To reduce the human work.
• Easy controlling of devices.
• Overall cost reduction.

Department of Electronics Engineering Page 2


Wi-Fi Based Home Automation System

CHAPTER 2

LITERATURE SURVEY

R.A Ramlee, M.A. Othman, M.H. Leoung, M.M. Ismail, S.S.S. Ranjit
has implemented the HAS using Wireless Bluetooth Technology. The work from
the paper has extended the system by keeping the physical switches where the 5V
switches replaced the conventional switches, which guarantees that electric shocks
don’t take place. This is to ensure that safety must be of the prime concern at
home. The system is implemented with the help of Bluetooth module, which is of
the measure of frequency 2400 Hz and is able to provide connectivity up to 100
meters at the speed of 3 MBPS. Moreover, a group of devices not exceeding than 7
can be interfaced in a Picante.

Deepali Javale, Mohammad Mohsin, Shreerang Nandanwar and Mayur


Shingate has designed a standalone embedded system board Android ADK
(Accessory Development Kit) at home. Home appliances, which are to be
automated, are interfaced to the ADK and then data is communicated between
Android device and ADK. Appliances are connected to the I/O ports of the
embedded System and the status is passed to the ADK. The embedded System
used here is Arduino Embedded System.

Shaiju Paul, Ashlin Antony, Aswathi B implements this project via


Android devices using Wi-Fi as communication protocol and a Raspberry Pi as
Server system. The above said server is connected with a relay circuit, which
controls the devices at home. Raspberry Pi board is considered to be the mini-
processor which ensures that it has a setting up of and selecting raspbian OS from
noobs package.

The Home automation system that uses Wi-Fi technology . System


consists of three main components; web server, which presents system core that
controls, and monitors users’ home and hardware interface module(Arduino PCB
(ready-made), Wi-Fi shield PCB, 3 input alarms PCB, and 3 output actuators
PCB.), which provides appropriate interface to sensors and actuator of home
automation system. The System is better from the scalability and flexibility point
of view than the commercially available home automation systems. The User may
use the same technology to login to the server web based application. .If server is

Department of Electronics Engineering Page 3


Wi-Fi Based Home Automation System

connected to the internet, so remote users can access server web based application
through the internet using compatible web browser.

The application has been developed based on the android system An


interface card has been developed to assure communication between the remote
user, server, raspberry pi card and the home Appliances. The application has been
installed on an android Smartphone, a web server, and a raspberry pi card to
control the shutter of windows. Android application on a smartphone issue
command to raspberry pi card. An interface card has been realized to update
signals between the actuator sensors and the raspberry pi card. Cloud-based home
appliance monitoring and controlling System. Design and implement a home
gateway to collect metadata from home appliances and send to the cloud-based
data server to store on HDFS (Hadoop Distributed File System), process them
using MapReduce and use to provide a monitoring function to Remote user . It has
been implemented with Raspberry Pi through reading the subject of E-mail and the
algorithm. Raspberry Pi proves to be a powerful, economic and efficient platform
for implementing the smart home automation .Raspberry pi based home
automation is better than other home automation methods is several ways. For
example, in home automation through DTMF (dual tone multi-frequency) , the call
tariff is a huge disadvantage, which is not the case in their proposed method. Also,
in Web server based home automation, the design of web server and the memory
space required is ejected by this method, because it simply uses the already
existing web server service provided by G-mail. LEDs were used to indicate the
switching action. System is interactive, efficient and flexible

Shih-Pang Tseng et al. proposed Smart House Monitor & Manager


(SHMM), based on the ZigBee, all sensors and actuators are connected by a
ZigBee wireless network. They designed a simple smart socket, which can remote
control via ZigBee. PC host is used as a data collector and the motion sensing, all
sensing data are transferred to the VM in the cloud. The user can use the PC or
Android phone to monitor or control through the Internet to power-saving of the
house.

Adriano microcontroller to receive user commands to execute through an


Ethernet shield. Our house network used together both wireless ZigBee and wired
X10 technologies . This system followed smart task scheduling with a heuristic for

Department of Electronics Engineering Page 4


Wi-Fi Based Home Automation System

the Resource-constrained-scheduling problem (RCPSP). The mobile device can be


either wired to the central controller through USB cable or communicates with it
wirelessly, within the scope of the home. Adriano contains the web server
application that communicates through the HTTP protocol with Web-based
Android application. The system is highly flexible and scalable and expandable.

The home network which monitors the appliances and sensors and transmits
data to the cloud-based data server which manages the information and provides
services for users by transmitting data and receiving user commands from mobile
application.The proposed system has good modularity and configurability
characteristics with very low power consumption in cost efficient way.

Application developed using the Android platform controlled and monitored


from a remote location using the smart home app and an Arduino Ethernet based
micro web-server . The sensors and actuators/relays are directly interfaced to the
main controller. Proposed design offers are the control of energy management
systems such as lightings, heating, air conditioning, security, fire detection and
intrusion detection with siren and email notifications.

 Internet Based Monitoring

Internet monitoring is one of the common approaches for remote monitoring.


Many researchers have worked in field of Internet based remote monitoring. (Saito
et al., 2000) developed home gateway system for interconnecting home network
consisting of IEEE 1394 AV network and X10 power line home automation
network with Internet. This provided remote access functions from Internet for
digital AV appliances like Digital Video Camera, Digital VCR connected to IEEE
1394 network and home appliances like TV, desk lamp, electric fan connected to
X10 controller. (Al-Ali and Al-Rousan, 2004) developed Java based home
automation system via World Wide Web. The home appliances were controlled
from ports of embedded system board connected to PC based server at home.
(Alkar and Buhur, 2005) implemented Internet based wireless flexible solution
where home appliances are connected to slave node. The slave nodes communicate
with master node through RF and master node has serial RS232 link with PC
server. The nodes are based on PIC 16F877 µc. PC server is formed of a user
interface component, the database and the web server components. An Internet

Department of Electronics Engineering Page 5


Wi-Fi Based Home Automation System

page has been setup running on a Web server. The user interface and the Internet
front end are connected to a backend data base server. The control of devices is
established and their condition is monitored through the Internet.

(Al-Khateeb et al., 2009) used X10 controller interfaced through serial port
to PC server for control of devices. The Common Gateway Interface (CGI) is used
to interface between the browser and the X10 protocol via http connection. The
server executes CGI programs in order to satisfy a particular request from the
browser, which expresses its request using the http.

(Peng Liu et al., 2007) developed model of web services based email
extension for remote monitoring of embedded systems which integrates web
services into emails. It uses a general purpose email messaging framework to
connect devices and manipulators. This low cost model fits for systems with low
connection bandwidth, small data transportation volume and non realtime control,
e.g., monitoring of home appliances and remote meter-reading.

(Tan and Soy, 2002) developed a system for controlling home electrical
appliances over the Internet by using Bluetooth wireless technology to provide a
link from the appliance to the Internet and Wireless Application Protocol (WAP) to
provide a data link between the Internet and a mobile phone. However, technical
details relating controller are not revealed.

(Nikolova et al., 2002) demonstrated that the control of home appliances can
be extended beyond the home network to wireless mobile networks without any
modification in the network specifications. This was accomplished by developing
and implementing a HAVi (Home Audio Video Interoperability) - WAP UI
gateway that intermediates between a wired home network and a wireless
communication network using HAVi and WAP specifications, respectively. The
gateway use both pull and push technologies, improves the network integration and
provides opportunities for developing applications that combine mobile devices
with home network device

(Yen-Shin Lai et al., 2002) developed an Internet-based monitoring and


control of fuzzy controlled inverter for air conditioning system. The system
consists of client/server, programmable logic controller, D/A modules, inverters,
induction motors and the temperature sensing modules. The client accepts the

Department of Electronics Engineering Page 6


Wi-Fi Based Home Automation System

command from the user and can also access the database created in server, using
Internet Explorer (IE) Browser. The server performs function of fuzzy logic
control, communication interface between server and PLC, and receiving
command from client. Furthermore, the server also creates a database of the sensed
temperature, speed of inverter-controlled motor drives, and reference command.

(Ximin et al., 2005) designed and implemented an Internet home automation


system. The design uses an embedded controller based on C8051F005
microcontroller which is connected to a PCbased home Web server via RS232
serial port. The home appliances are connected to the input/output ports and the
sensors are connected to the analog/digital converter channels of the embedded
controller. The software of the system is based on the combination of Keil C, Java
Server Pages, and JavaBeans, and dynamic DNS service (DDNS) client. Password
protection is used to block the unauthorized user from accessing to the server.

(Colak Ilhami et al., 2008) developed Internet controlled Heating Ventilation


Air Conditioning (HVAC) system. The system can be controlled by three different
units (web based remote control, remote control by hand-held device and keypad
control mounted on AC). The hardware system of AC is controlled by PIC16F877
microcontroller. A DAQ board inserted into PCI bus of web server is used to
control system over web. User is able to access system parameters over web by
logging and setting parameters on forms available on main control page. User
submits forms to web server having CGI program which performs requested tasks
and reports status of system operation. The current operational parameters of the
system are measured by microcontroller and displayed on LCD. Using web camera
focused on LCD, these parameters are monitored online by client PC.

(Chen Chao et al., 2009) developed a remote wireless monitoring system for
off grid Wind turbine based on the GPRS and the Internet. The remote monitoring
system is made up of three parts: controlling terminal, central monitoring computer
and communication network. Controlling terminal consists of microcontroller
ARM7 LM3S1138, data acquisition module and GPRS communication module
WAVECOM Q2406B connected to ARM7 system using serial port. GPRS module
sends parameters relating wind turbine to central monitoring computer. The client
can access central monitoring computer server through Internet and know
parameters of different wind turbines.

Department of Electronics Engineering Page 7


Wi-Fi Based Home Automation System

(Kumari and Malleswaran, 2010) developed real time based equipment


condition monitoring and controlling system using embedded web based
technology which directly connects the equipment to network as a node. The
embedded system consists of ARM7 based LPC 2148 microcontroller board, A/D,
signal conditioning, sensors, and communications interface. The function of web
based system is to collect the real time data information of the on-site equipment
and remotely send the data in the form of user defined data transmission style. The
remote Computer collects the data and running status through the network and
provides the comparison on the historical data. If the parameter value is different
from the original set value, the corrected signal is sent to the control unit. The
embedded remote monitoring system completes the data Collection in the
embedded platform and provides the data to remote host through the TCP/IP
protocol from Web server. It creates condition to realize unattended management
through providing Web-based graphical management interface for the Internet or
LAN users.

(Burger and Frieder, 2007) introduced Key Press Markup Language


(KPML) and SIP Event Package to control devices in the home environment
remotely without the need for specialized hardware in the home devices. KPML
provides an efficient, reliable protocol for the remote control of consumer devices
using plain old telephones with 12-digit keypads using Internet transport
technologies.

(Hongping and Kangling, 2010) proposed the architecture of embedded


remote monitoring system based on Internet. The system adopts embedded web
server as a central monitoring node and results in improvement in stability and
reliability of system. Moreover, utilization of dynamic monitoring web based on
Java Applet improves the response capability and brings convenience for complex
monitoring web design.

(Zhu and Cui, 2007) developed remote intelligent monitoring system based
on embedded Internet technology for device-room monitoring of the campus
network. The Intelligent Monitoring Terminal (IMT) is provided with the functions
of Embedded Internet Node Unit and local MSD (Monitoring System Devices).
IMT can give alarm of theft or fire according to detection analysis of temperature,
sound and smog. And it also can connect to Internet for carrying out remote data

Department of Electronics Engineering Page 8


Wi-Fi Based Home Automation System

communication. The MCU S3C44B0, which utilize 32-bit ARM kernel, is adopted
in intelligent monitoring terminal. μClinux operating system is chosen as the
software core of embedded system. It offers self-contained TCP/IP network
protocol module and provides strong support for embedded Internet technology.

(Liu Zhong-xuan et al., 2010) designed wireless remote monitoring system


based on the GPRS (General Packet Radio Service) and the MCU
(Microprogrammed Control Unit). System is based on 89C58 microcontroller and
PIML GPRS-MODEM as the core, can collect data from eight sensors, control
two-way Data Acquisition, in the local real-time display and support remote
Internet monitoring. The data from sensors are encoded, sent to the WEB server
(fixed IP address or fixed domain name website) through the GPRS channel. The
system also accepts commands from remote monitoring centre.

(Bing Li et al., 2008) developed wireless remote image monitoring system


based on GSM/GPRS and ARM_Linux developing environment. The monitoring
system uses S3C2410 RISC MCU - ARM920Core, USB Web camera, SD Card
and UART GPRS module. ARM Linux operating system is loaded on SD Card.
APIs of Video4Linux kernel are used to realize image acquisition of the system,
through PPP dial-up to access the GPRS, through network programming to realize
the transmission of the image.

(Yang Musheng et al., 2008) developed application on remote monitoring


system of reservoir based on GPRS. GPRS data terminal hardware includes the
intelligent processing module, remote communication module, serial interface
module and display module. Intelligent processing module contains two chips
AT89C55 microcontroller and serial E2 PROM X25045. AT89C55 is used to
transmit data between remote communication module, A/D conversion module and
display module. To ensure that data will not be lost because of power outages,
serial E 2 PROM X25045 device is adopted for data storage. Remote
communication module includes GPRS wireless module, SIM card and serial
module MAX3238. Database mainly stores various parameters of the flood
accommodation procedures for the user and reservoir historical hydrological data,
such as electric power generated, relation curve of water level flows, the water
storage capacity curve, discharge curve, unit's efficiency curve of different
conditions, historical flood data and flood information.

Department of Electronics Engineering Page 9


Wi-Fi Based Home Automation System

(Ciubotaru-Petrescu et al., 2006) developed a system composed of server


which interfaces several video surveillance cameras including several microphones
for audio surveillance. This server captures video and audio streams from the video
cameras and microphones and operates on these streams according to the
configuration of the local control software module. This module can store the
video and audio streams on local hard-disks, index video and audio captures by
time and place, retrieve images and sound based on user specified time intervals
and deliver them to the user via Internet, or deliver (streaming) live images and
sounds from a predefined camera. The system is connected to the building power
supply and can be connected to the Internet via several communication solutions
based on their availability. In case of power grid failure the system is provided
with a secondary power supply based on rechargeable batteries which can keep the
system functional for several hours. The main weaknesses of this system are the
power supply and the Internet connection. To improve the reliability of this
system, an autonomous diagnosis system has been added to the main monitoring
server. The system will detect any change in the functioning state of the main
system, like communication link failure, power grid failure or internal power
source depletion and will report these events by sending a short message (SMS).

(Yuksekkaya et al., 2006) developed wireless home automation system by


merging communication technologies of GSM, Internet and speech recognition.
GSM and Internet methods were used for remote access of devices of house
whereas speech recognition was designed for users inside the house. The
communication between the user and the home is established by the SMS (Short
Message Service) protocol. A GSM modem is connected to the home automation
server. The communication between the home automation server and the GSM
modem is carried out by the AT (Attention) commands. To accomplish Internet
connectivity, a web server is built to take requests from remote clients. The clients
can send requests to the home appliances. The home appliances can send their
statuses to be displayed for the remote client through the server. A web page is
constructed as an interactive interface where commands can be submitted by the
client to change and also monitor the status of the devices. A speech recognition
program is written to control the house by means of human voice. Dynamic Time
Warping (DTW) algorithm is used for speech recognition.

Department of Electronics Engineering Page 10


Wi-Fi Based Home Automation System

(Rasid and Woodward, 2005) developed a system to transmit a patient’s


biomedical signals directly to a hospital for monitoring or diagnosis, using mobile
telephone. The system consists of mobile telemedicine processor, which samples
signals from sensors on the patient. It then transmits digital data over a Bluetooth
link to a mobile telephone that uses the General Packet Radio Service. The mobile
processor consists of signal conditioning module, a peripheral control module,
which incorporates a PLD Altera Flex 10-K, a processor (AMD 186ES
microcontroller) a 256-kB Flash ROM (AMD AM29F200T), a 512-kB Static
RAM (Toshiba TC554 161 AFT), and an RS232 serial communication port along
with Bluetooth communication module (CSR BlueCore2-Flash) that supports
Bluetooth radio transceivers Classes 2 and 3. The mobile telemedicine processor is
first configured with the hospital server IP address and establishes a Bluetooth link
with the mobile telephone at power-up. The mobile telephone is then configured
with a mobile-to-host GPRS connection (GPRS attachment and PDP context
activation). Patient data are recorded and stored in the processor’s memory
module, typically for 10 min. Then the processor transmits an AT-command to the
mobile phone to initiate data transmission via the GPRS network.

Department of Electronics Engineering Page 11


Wi-Fi Based Home Automation System

CHAPTER 3

SYSTEM DESIGN
3.1 DESIGNING OF POWER SUPPLY:-
A) The following information must be available to the designer of the
transformer.

1) power output.
2) operating voltage.
3) Frequency range.
4) Efficiency and regulation.

Size of core is one of the first consideration in regard of weight and


volume of a transformer. This depends on type of core and winding
configuration used. Generally following formula is used to find Area or Size
of the Core.

Ai = √ Wp / 0.87
Where Ai = Area of cross section in square cm.
Wp = Primary Wattage.

For our project we require +5V output, so transformer secondary


winding rating is 9V, 500mA.

So secondary power wattage is,


P2 = 9 * 500mA
= 4.5Watt
So,
Ai = √ 4.5 / 0.87
= 2.43
Generally 10% of area should be added to the core.
So,Ai = 2.673

a) Turns per volt:- Turns per volt of transformer are given by relation.

Turns per volt = 100000 / 4.44 f * Bm * Ai

Department of Electronics Engineering Page 12


Wi-Fi Based Home Automation System

Where,

F = Frequency in Hz.

Bm = Density in Wb / Square meter.

Ai = Net area of the cross section.

Following table gives the value of turns per volt for 50 Hz frequency.

Flux
density
0.83 1.14 1.01 0.91
0.76 Wb
/sq m

Turns per
Volt 55 / Ai 40 / Ai 45 / Ai 50 / Ai
45 / Ai

Generally lower the flux density better the quality of transformer. For our project
we have taken the turns per volt is 0.91 Wb / sq.m from above table.

Turns per volt = 50 / Ai

= 50 / 2.673

= 18.7055

Thus the turns for the primary winding is,

230 * 18.7055 = 4302.265

And for secondary winding,

9 * 18.7055 =168.3495

Department of Electronics Engineering Page 13


Wi-Fi Based Home Automation System

b) wire size :- As stated above the size is depends upon the current to be carried
out by winding which depends upon current density. For our transformer one tie
can safely use current density of 3.1 Amp / sq.mm.

for less copper loss 1.6Amp/sq.mm or 2.4sq.mm may be used generally even
size gauge of wire are used.

R.M.S secondary voltage at secondary to transformer is 9V. so maximum voltage


Vm across secondary is

Vm= Vrms x√2

Vrms=Vm / √2

= 9 * 1.141

= 12.727v

D.C output voltage Vm across secondary is,

Vdc = 2 * Vrms/pi

= 2 * 12.727/3.14

= 8.08 V

P.I.V rating of each diode is

PIV = 2Vdc

= 2 * 8.08

= 16.16 V

Maximum forward current, which flow from each diode is 500 mA. So from above
parameter, we select diode 1N4007 from the diode selection manual.

Department of Electronics Engineering Page 14


Wi-Fi Based Home Automation System

B) Design of filter capacitor:-

Formula for calculating filter capacitor is

C = ¼ √ 3 r * F * R1

Where,

r = ripple present at output of rectifier, which is maximum 0.1 for full wave
rectifier.

F = frequency of AC main.

R1 = input impedance of voltage regulator IC

C = 1/( 4 *( √ 3 * 0.1 * 50 * 28))

= 1030 µf

= 1000 uF

Voltage rating of filter capacitor should be greater than the i/p Vdc i.e. rectifier
output which is 8.08 V so we choose 1000µf / 25V filter capacitor.

C) Specification of voltage regulator IC:-

Parameter Rating

Available output DC voltage. +5V

Line regulation. 0.03

Load regulation. 0.5

Vin maximum. 16.16 V

Ripple rejection. 60-80db

Department of Electronics Engineering Page 15


Wi-Fi Based Home Automation System

RESISTORS
A resistor is a two-terminal electronic component designed to oppose an
electric current by producing a voltage drop between its terminals in proportion to
the current, that is, in accordance with Ohm's law:

V = IR

Resistors are used as part of electrical networks and electronic circuits. They are
extremely commonplace in most electronic equipment. Practical resistors can be
made of various compounds and films, as well as resistance wire (wire made of a
high-resistivity alloy, such as nickel/chrome).

The primary characteristics of resistors are their resistance and the power
they can dissipate. Other characteristics include temperature coefficient, noise, and
inductance. Less well-known is critical resistance, the value below which power
dissipation limits the maximum permitted current flow, and above which the limit
is applied voltage. Critical resistance depends upon the materials constituting the
resistor as well as its physical dimensions; it's determined by design.
Resistors can be integrated into hybrid and printed circuits, as well as
integrated circuits. Size, and position of leads (or terminals) are relevant to
equipment designers; resistors must be physically large enough not to overheat
when dissipating their power.

Department of Electronics Engineering Page 16


Wi-Fi Based Home Automation System

CAPACITORS
A capacitor or condenser is a passive electronic component consisting of
a pair of conductors separated by a dielectric. When a voltage potential difference
exists between the conductors, an electric field is present in the dielectric. This
field stores energy and produces a mechanical force between the plates. The effect
is greatest between wide, flat, parallel, narrowly separated conductors.

An ideal capacitor is characterized by a single constant value, capacitance,


which is measured in farads. This is the ratio of the electric charge on each
conductor to the potential difference between them. In practice, the dielectric
between the plates passes a small amount of leakage current. The conductors and
leads introduce an equivalent series resistance and the dielectric has an electric
field strength limit resulting in a breakdown voltage.

The properties of capacitors in a circuit may determine the resonant


frequency and quality factor of a resonant circuit, power dissipation and operating
frequency in a digital logic circuit, energy capacity in a high-power system, and
many other important aspects.

LM7805 VOLTAGE REGULATOR

The MC78XX/LM78XX/MC78XXA series of three terminal positive


regulators are available in the TO-220/D-PAK package and with several fixed
output voltages, making them useful in a wide range of applications. Each type
employs internal current limiting, thermal shut down and safe operating area
protection, making it essentially indestructible. If adequate heat sinking is
provided, they can deliver over 1A output current. Although designed primarily as
fixed voltage regulators, these devices can be used with external components to
obtain adjustable voltages and currents.

Features

• Output Current up to 1A

• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V

• Thermal Overload Protection.


Department of Electronics Engineering Page 17
Wi-Fi Based Home Automation System

3.2 Block diagram.


LCD
DISPLAY

Power max Wifi


Supply 232
89c52

micro-contoller Buzzer

Series

Relay1 Lamp1

Relay2 Lamp2

Relay3 Lamp3

Relay4 Lamp 4

Power Supply:
A power supply is an electronic device that supplies electric energy to
an electrical load. The primary function of a power supply is to convert one form
of electrical energy to another and, as a result, power supplies are sometimes
referred to as electric power converters. Some power supplies are discrete, stand-
alone devices, whereas others are built into larger devices along with their loads.
Examples of the latter include power supplies found in desktop
computers and consumer electronics devices.
Every power supply must obtain the energy it supplies to its load, as well as any
energy it consumes while performing that task, from an energy source. Depending
on its design, a power supply may obtain energy from various types of energy
sources, including electrical energy transmission systems, energy storage devices
such as a batteries and fuel cells, electromechanical systems such as generators
and alternators, solar power converters, or another power supply.
All power supplies have a power input, which receives energy from the energy
source, and a power output that delivers energy to the load. In most power supplies
the power input and output consist of electrical connectors or hardwired circuit
connections, though some power supplies employ wireless energy transfer in lieu
of galvanic connections for the power input or output. Some power supplies have
Department of Electronics Engineering Page 18
Wi-Fi Based Home Automation System

other types of inputs and outputs as well, for functions such as external monitoring
and control.

LCD

A liquid Crystal display (commonly abbreviated as LCD) is a thin, flat


display device made up of any number or monochrome pixels arrayed in front of
light source or reflector. It uses very small amount of electric power, and is there
for suitable for use in battery power electronic devices.

Department of Electronics Engineering Page 19


Wi-Fi Based Home Automation System

Microcontroller

 Pin configration of 89C52 microcontroller.

Why 89C52?

8051 is an architecture developed by Intel. And the controllers at89c51 & at89c52
are designed by Atmel Corp based on Intel 8051 architecture. The basic difference
between these two controllers is in their RAM memory and flash memory.
The 89S52 has 4 different ports, each one having 8 Input/output lines providing a
total of 32 I/O lines. Those ports can be used to output DATA and orders do other
devices, or to read the state of a sensor, or a switch. Most of the ports of the 89S52
have 'dual function' meaning that they can be used for two different functions.

The first one is to perform input/output operations and the second one is
used to implement special features of the microcontroller like counting external
pulses, interrupting the execution of the program according to external events,
performing serial data transfer or connecting the chip to a computer to update the
software. Each port has 8 pins, and will be treated from the software point of view

Department of Electronics Engineering Page 20


Wi-Fi Based Home Automation System

as an 8-bit variable called 'register', each bit being connected to a different


Input/output pin.
The difference between the features of AT89C51 and AT89C52, they are very
similar in their pin configurations* and operations.
The differences between AT89C51 and AT89C52 have been tabulated below.

AT89C52 AT89C51
RAM 256 Bytes 128 Bytes
Flash 8 KB 4 KB
Number of
3 (16-bit each) 2 (16-bit each)
Timers/Counters
Number of Interrupt
8 6
Sources

*The pin configuration of AT89C52 is exactly similar to that of AT89C51 except that
the first two pins, P1.0 and P1.1 are multiplexed to correspond to Timer2 operations as
given in the following table.

Existing Alternate Function


P1.0 T2 Timer/counter 2 External Count input
P1.1 T2 EX Timer/counter 2 Trigger input

While AT89C51 has two timers (Timer0 & Timer1), AT89C52 also has Timer2.
Corresponding to Timer2, there are extra SFRs (Special Function Registers)
T2CON & T2MOD. Also there are registers RCAP2H & RCAP2L to configure 16
bit Capture & Auto-reload modes of Timer2.

Department of Electronics Engineering Page 21


Wi-Fi Based Home Automation System

Pin Description:
Pin
Function Name
No
External count input to Timer/Counter 2,
1 T2 P1.0
clock-out
Timer/Counter 2 capture/reload trigger and
2 T2 EX P1.1
direction control
3 P1.2
4 P1.3
5 P1.4
8 bit input/output port (P1) pins
6 P1.5
7 P1.6
8 P1.7
9 Reset pin; Active high Reset
Input (receiver) for serial
10 RxD P3.0
communication
Output (transmitter) for
11 TxD P3.1
serial communication
12 External interrupt 1 Int0 P3.2
8 bit
13 External interrupt 2 Int1 P3.3
input/output
14 Timer1 external input T0 P3.4
port (P3) pins
15 Timer2 external input T1 P3.5
Write to external data
16 Write P3.6
memory
Read from external data
17 Read P3.7
memory
18 Crystal 2
Quartz crystal oscillator (up to 24 MHz)
19 Crystal 1
20 Ground (0V) Ground
21 8 bit input/output port (P2) pins P2.0/ A8
22 / P2.1/ A9
23 High-order address bits when interfacing with external P2.2/ A10
24 memory P2.3/ A11

Department of Electronics Engineering Page 22


Wi-Fi Based Home Automation System

25 P2.4/ A12
26 P2.5/ A13
27 P2.6/ A14
28 P2.7/ A15
Program store enable; Read from external program
29 PSEN
memory
Address Latch Enable ALE
30
Program pulse input during Flash programming Prog
External Access Enable; Vcc for internal program
EA
executions
31
Programming enable voltage; 12V (during Flash
Vpp
programming)
32 P0.7/ AD7
33 P0.6/ AD6
8 bit input/output port (P0) pins
34 P0.5/ AD5
35 P0.4/ AD4
Low-order address bits when interfacing with external
36 P0.3/ AD3
memory
37 P0.2/ AD2
38 P0.1/ AD1
39 P0.0/ AD0
40 Supply voltage; 5V (up to 6.6V) Vcc

Relay:
A relay is an electrically operated switch. Many relays use an electromagnet to
mechanically operate a switch, but other operating principles are also used, such
as solid-state relays. Relays are used where it is necessary to control a circuit by a
separate low-power signal, or where several circuits must be controlled by one
signal. The first relays were used in long distance telegraph circuits as amplifiers:
they repeated the signal coming in from one circuit and re-transmitted it on another
circuit. Relays were used extensively in telephone exchanges and early computers
to perform logical operations.
A type of relay that can handle the high power required to directly control an
electric motor or other loads is called a contactor. Solid-state relays control power

Department of Electronics Engineering Page 23


Wi-Fi Based Home Automation System

circuits with no moving parts, instead using a semiconductor device to perform


switching. Relays with calibrated operating characteristics and sometimes multiple
operating coils are used to protect electrical circuits from overload or faults; in
modern electric power systems these functions are performed by digital
instruments still called "protective relays".
Magnetic latching relays require one pulse of coil power to move their
contacts in one direction, and another, redirected pulse to move them back.
Repeated pulses from the same input have no effect. Magnetic latching relays are
useful in applications where interrupted power should not be able to transition the
contacts.
Magnetic latching relays can have either single or dual coils. On a single coil
device, the relay will operate in one direction when power is applied with one
polarity, and will reset when the polarity is reversed. On a dual coil device, when
polarized voltage is applied to the reset coil the contacts will transition. AC
controlled magnetic latch relays have single coils that employ steering diodes to
differentiate between operate and reset commands.
The NO (normally open) and NC (normally closed) terminals should be
connected to another power supply to drive the DC motor. The supply positive is
connected to NO and negative/ground is connected to NC. One wire of the DC
motor is connected to the swing terminal of first relay and other wire is connected
to swing terminal of second relay. Initially the two swing terminals are connected
to NC of the relays (grounded) so DC motor will not rotate because two terminals
are at same potential (ground). Similarly, if two swing terminals are connected to
5V/12V supply in this case also motor will not rotate.
If you want to rotate the DC motor any one of the swing terminals should be
connected to supply (5V/12V) and other should be connected to ground. Consider
a case where the first relay swing terminal is connected to supply and other is
grounded then current will flow from RL1 to RL2 via DC motor so the shaft of DC
motor is rotate in clockwise direction.

If the second relay swing terminal is connected to supply and other is


connected to ground then the current will flow from RL2 to RL1 via DC motor so
the shaft of DC motor is rotate in anti-clockwise direction.

Department of Electronics Engineering Page 24


Wi-Fi Based Home Automation System

The relay swing terminals are controlled with ULN driver. Where ULN
driver input pins are controlled by using 89S52/89C52 microcontroller port P1
pins.

 SPST – Single Pole Single Throw. These have two terminals which can be
connected or disconnected. Including two for the coil, such a relay has four
terminals in total. It is ambiguous whether the pole is normally open or
normally closed. The terminology "SPNO" and "SPNC" is sometimes used to
resolve the ambiguity.
 SPDT – Single Pole Double Throw. A common terminal connects to either of
two others. Including two for the coil, such a relay has five terminals in total.
 DPST – Double Pole Single Throw. These have two pairs of terminals.
Equivalent to two SPST switches or relays actuated by a single coil. Including
two for the coil, such a relay has six terminals in total. The poles may be Form
A or Form B (or one of each).
 DPDT – Double Pole Double Throw. These have two rows of change-over
terminals. Equivalent to two SPDT switches or relays actuated by a single coil.
Such a relay has eight terminals, including the coil.

Department of Electronics Engineering Page 25


Wi-Fi Based Home Automation System

Max 232:

The MAX232 is an integrated circuit first created in 1987 by Maxim


Integrated Products that converts signals from a TIA-232 (RS-232) serial port to
signals suitable for use in TTL-compatible digital logic circuits. The MAX232 is a
dual transmitter / dual receiver that typically is used to convert the RX, TX, CTS,
RTS signals.
The drivers provide TIA-232 voltage level outputs (about ±7.5 volts) from a
single 5-volt supply by on-chip charge pumps and external capacitors. This makes
it useful for implementing TIA-232 in devices that otherwise do not need any other
voltages.
The receivers reduce TIA-232 inputs, which may be as high as ±25 volts, to
standard 5 volt TTL levels. These receivers have a typical threshold of 1.3 volts
and a typical hysteresis of 0.5 volts.
The MAX232 replaced an older pair of chips MC1488 and MC1489 that
performed similar RS-232 translation. The MC1488 quad transmitter chip required
12 volt and -12 volt power, and MC1489 quad receiver chip required 5 volt
power. The main disadvantages of this older solution was the +/- 12 volt power
requirement, only supported 5 volt digital logic, and two chips instead of one.
Pin Diagram:

It is helpful to understand what occurs to the voltage levels. When a


MAX232 IC receives a TTL level to convert, it changes a TTL logic 0 to between

Department of Electronics Engineering Page 26


Wi-Fi Based Home Automation System

+3 and +15 V, and changes TTL logic 1 to between −3 and −15 V, and vice versa
for converting from TIA-232 to TTL. This can be confusing when you realize that
the TIA-232 data transmission voltages at a certain logic state are opposite from
the TIA-232 control line voltages at the same logic state. To clarify the matter, see
the table below. For more information, see RS-232 voltage levels.

TIA-232 line type and logic TIA-232 TTL voltage to/from


level voltage MAX232

Data transmission (Rx/Tx) logic


+3 V to +15 V 0V
0

Data transmission (Rx/Tx) logic


−3 V to −15 V 5V
1

Control signals
−3 V to −15 V 5V
(RTS/CTS/DTR/DSR) logic 0

Control signals
+3 V to +15 V 0V
(RTS/CTS/DTR/DSR) logic 1

Lamp(LOADS):

Lamps or Loads may be in the form of Electronic devices such as television


sets, lamps, fans, etc.

Department of Electronics Engineering Page 27


Wi-Fi Based Home Automation System

3.3 Circuit Diagram:


+5v

2
R5 D5
PHASE
R4 1N4007 K5
10K 1K
5V

3
5V NEUTRAL
2 Q1 D6

1
U1 BC557 LED

1
1
R6
AT89C52
Relay 1

40
LS2 1K 2 5V RELAY SPDT

1
5v RS 39 21 Bank1

VCC
BUZZER P0.0/AD0 P2.0/A8 R8 R7 Q2
1

J1 R/W 38 22 Bank2
P0.1/AD1 P2.1/A9 23 Bank3 1K BC547

3
EN 37 10K
5V 1 36 P0.2/AD2 P2.2/A10 24 Bank4
2 P0.3/AD3 P2.3/A11
2 D4 35 25

2
R1 P0.4/AD4 P2.4/A12
C3 3 RS 10k D5 34 26
10uF/63V 4 D6 33 P0.5/AD5 P2.5/A13 27 +5v
R/W P0.6/AD6 P2.6/A14
5 EN D7 32 28
RST 6 P0.7/AD7 P2.7/A15

2
3

7 1 10 RXD
8 2 P1.0 P3.0/RXD 11 TXD R9 R10 D7
P1.1 P3.1/TXD PHASE
R3 9 3 12 10K 1N4007 K6
P1.2 P3.2/INTO 1K
8K2 10 D4 4 13

3
11 P1.3 P3.3/INT1 R11 BC557
D5 5 14 NEUTRAL
12 P1.4 P3.4/TO 2 Q3 D8

1
D6 6 15
13 7 P1.5 P3.5/T1 16 LED
D7

1
14 P1.6 P3.6/WR 1K
15
2 1
5V
8
P1.7 P3.7/RD
17
2 5V RELAY SPDT Relay 2

1
RESET LCD
16 56E R2 19
18 XTAL1 PSEN
29
R12 Q4
CKT RST 9 XTAL2 R13 1K BC547

3
30
RST ALE/PROG
10K

GND
31
5V EA/VPP

LCD 16x2 +5v

20

2
R14 D9
PHASE
Y1 10K R15 1N4007 K7
C4 11.059Mhz 1K

3
R16
U5 33pf NEUTRAL
5V 2 Q5 D10

1
D1 D2 LM7805 5V
C5 BC557 LED

1
1 3
VIN VOUT 33pf 1K
2 5V RELAY SPDT Relay 3

1
DC1
GND

4007 4007 0.1uf


J2 R17 Q6
D3 D4 DC2 DC3 C10 R18 1K BC547

3
2 0.1uf 0.1uf 10uf
10K
2

1
I/P 4007 4007 C11 MICROCONTROLLER +5v
1000uf /35v

2
POWER SUPPLY R19
R20
D11
K8
PHASE
10K 1N4007
3
1K
R21
NEUTRAL
2 Q7 D12

1
BC557 LED

1
5V
1K
2 5V RELAY SPDT
Relay 4
1

R22 Q8
R23 1K BC547

3
10K
1 C6 C7 U4 MAX232
6 1uf 1uf 1 C8
2 2 C1+ 3
1uf
7 6 V+ C1-
3 V- 4
P1 8 C2+ 5 C9
4 C2-
1uf
9 14 11 TXD
5 7 T1OUT T1IN 10
T2OUT T2IN
13 12 RXD
8 R1IN R1OUT 9
R2IN R2OUT

UART for Wifi (IOT)

Department of Electronics Engineering Page 28


Wi-Fi Based Home Automation System

3.4 Flowchart-

Department of Electronics Engineering Page 29


Wi-Fi Based Home Automation System

3.5 Algorithm:

1) Start.
2) Initialize the Wi-Fi, timer, relay.
3) Wait for Wi-Fi command from android mobile.
4) If ‘a’ command is received, relay 1 ON, send feedback to Wi-Fi device 1
ON.
5) If ‘a’ command is not received then go to step 3.
6) If ‘b’ command received then relay 1 OFF.
7) If command not received then go to step 3.
8) Send feedback message 1 to Wi-Fi device 1 OFF.
9) Stop.

Department of Electronics Engineering Page 30


Wi-Fi Based Home Automation System

CHAPTER 4

4.1 Simulation Results.

 Power supply simulation result.

Department of Electronics Engineering Page 31


Wi-Fi Based Home Automation System

CHAPTER 5

CONCLUSION

5.1 Conclusions

This project increases our ability to work as a group and it helps us in


future life. But we face several problems because of unavailability of quality
goods, technical support and inexperience. Despite that we enjoyed our work
very much and successfully finished that work in perfection. In this dynamic
world motor is the most convenient and useful tool in industry. Large rated
motor required flexible control and protection. We hope our project can bring
dynamic change in our industrial level motor controlling system.

The project we have undertaken has helped us gain a better perspective


on various aspects related to our course of study as well as practical knowledge
of electronic equipment’s and communication. We became familiar with
software analysis, designing ,implementation, testing and maintenance
concerned with our project

5.2 Applications

• Wireless control of devices.

• Easy controlling of devices.

• Control the devices through the mobile phone.

5.3 Advantages
 Energy Savings -Through user tracking both in- and outdoors, a home
automation system would potentially be able to make sure that, for
example, no unnecessary light or heat is turned on in individual
rooms.
 Convenience-Through Web based access to the home automation
system a forgetful user will potentially no longer have to worry about
if the coffee machine was left on when he left for work. Simply go to
a Webpage, check it, and turn it off if necessary.

Department of Electronics Engineering Page 32


Wi-Fi Based Home Automation System

References.

[1] Christian Reinisch ,"Wireless Communication in Home and Building


Automation", Master thesis, Viennia university of technology, Feb 2007.

[2] Ahmed EIShafee, “Design And Implementation of a Wi-Fi Based Home


Automation System”, Ahram Canadian University, Oct 2012.

[3] A.J. Bernheim Brush, Bongshin Lee, Ratul Mahajan, Sharad Agarwal,
Stefan Saroiu, and Colin Dixon, "Home Automation in the Wild: Challenges and
Opportunities", CHI 2011, May 7-12, 2011, Vancouver, BC, Canada

[4] N. Sriskanthan, F. Tan, A. Karande," Bluetooth based home automation


system", Microprocessors and Microsystems journal, issue 26 (2002) pages 281-
289, Elsevier Science B.V., 2002

Department of Electronics Engineering Page 33

You might also like