1. 1 | P a g e
SMART HOME AUTOMATION BASED ON
MOBILE NETWORK USING
MICROCONTROLLER
INTERNSHIP PROJECT REPORT
BY
CHINMAYA BHOI
Under the guidance of
Prof.(Dr) AJIT KUMAR PANDA
(Project Guide)
Prof. M. SURESH
(Project Co-Guide)
In the duration of two month (May-July)
SUMMER INTERNSHIP Program
In
NATIONAL INSTITUTE OF SCIENCE AND
TECHNOLOGY
2015
2. 2 | P a g e
BONAFIDE CERTIFICATE
This is to certify that this project report entitled “SMART
HOME AUTOMATION BASED ON MOBILE NETWORK
USING MICROCONTROLLER” submitted to National Institute of
Science and Technology, Berhampur in connection with the NIST-
Summer Research Internships & Fellowship Programme is a bonafide
record of work done by “CHINMAYA BHOI” under my supervision
of “Prof (Dr.) AJIT KUMAR PANDA” and “Prof. M. SURESH”
from “15th
MAY 2015” to “15th
JULY 2015”
Prof. M. SURESH Prof (Dr.) AJIT KUMAR PANDA
(Project Co-Guide) (Project Guide)
Dr. MOTAHAR REEZA
(Internship Coordinator)
Date:
Place: NATIONAL INSTITUTE OF SCIENCE AND
TECHNOLOGY, BERHAMPUR
3. 3 | P a g e
ACKNOWLEDGMENT
The internship opportunity I had in NIST, Berhampur was a great chance
for learning and professional development. Therefore, I consider myself as
a very lucky individual as I was provided with an opportunity to be a part
of it.
I would like to express my heartfelt gratitude to Prof. Sangram Mudali,
Director of NIST and Prof. Geetika Mudali, Placement Director of NIST
for the planning of summer internship programme and providing the
funding of the fellowship and other facilities ( TA, DA etc).
I express my deepest thanks to Prof.(Dr) Ajit Kumar Panda and Prof.
M.Suresh for taking part in useful decisions and giving necessary advices
and guidance during the research work. It is my radiant sentiment to place
on record my best regards, deepest sense of gratitude to Ms. Tapaswini
Sabat and Ms. Padmaja Mishra for their careful and precious guidance
which were extremely valuable for my study both theoretically and
practically.
I perceive as this opportunity as a big milestone in my career development.
I will strive to use gained skills and knowledge in the best possible way,
and I will continue to work on their improvement, in order to attain desired
career objectives. Hope to continue cooperation with all of you in the
future.
At last, I sincere regards to my parents and friends who have directly or
indirectly helped me in the project.
Date:
Chinmaya Bhoi
2nd
yr B.Tech
Electronics and Communication Engineering
Sambalpur University Institute of Information Technology
Jyoti Vihar, Burla
Odisha
4. 4 | P a g e
ABSTRACT
Home automation in essence plays a very vital role in modern era because of
its flexibility in using at different places with high precision which will intern
save money and time by decreasing human hard work. General idea of home
automation shows the quality of human being at house. Prime focus of this
technology is to control the household equipment‟s like light, fan, door, AC etc.
automatically. In hazardous condition, it is useful for old aged and
handicapped persons. In this technology, remote, wireless controlled switches,
PC, Laptop or Smartphone are used for operating. In this project we detailed a
survey on home control automation using Smartphone by considering the
parameters like efficiency of working, controllers used, type of communication,
the apps developed etc. and at last a discussion is given which summarizes the
previous literature work.
5. 5 | P a g e
Contents
Introduction
1. EMBEDDED SYSTEM AND MICROCONTROLLER
1.1 Introduction to Embedded System
1.2 Characteristic of Embedded System
1.3 8051 Evolution
1.4 8051 Architecture
1.5 Microcontroller Overview
1.6 8051 Pin Configuration
2. EMBEDDED C PROGRAMMING
2.1 Introduction
2.2 Why C language is effective?
2.3 C program to control the relay
2.4 Switching Pattern of relay
2.5 Explanation of the Program
3. THE DTMF MODULE, RELAY AND L293D
3.1 Introduction
3.2 DTMF circuit diagram
3.3 Why we choose DTMF module?
3.4 The need of DTMF decoding
3.5 The operation of DTMF method
3.6 Working of DTMF decoder circuit
3.7 History of Relay
3.8 Basic design and operation of relay
3.9 Pole and Through
3.10 Relay selecting factor
3.11 Application of Relay
3.12 Introduction of L293d H-bridge Driver
3.13 Pin configuration of L293d
6. 6 | P a g e
4. GLOWING OF THE BULB
4.1 The automation circuit diagram
4.2 Results
4.3 Advantages and Disadvantages
5. RESULTS
5.1 Conclusion
5.2 Application areas and Future work
5.3 References
7. 7 | P a g e
Introduction
The wireless devices have great market potential and
popularity in today‟s life. The “Mobile Controlled Home
Automation”, the project which we are discussing, can control
home appliances remotely with human instructions. This makes the
life much easier which in turns the main goal of the project.
We can “TURN ON” or “TURN OFF” two home appliances
individually and also simultaneously over anywhere in the world.
For example “TURNING ON” the AC before reaching home,
switching the outdoor light during journey, or even fill the water
tank of home just by making a call, etc. We are also able to break the
“MAIN” supply of the home through our mobile phone. In real
time the damage caused by the short circuit would increase rapidly
so it is necessary to disconnect the MAIN supply instantly and
sometimes it is very difficult to reach the main panel, here this
concept will help in great extent.
In the later chapter we will discuss how it interface in the
real life, the working principle, the component used and their
functions, modes of switching etc.
In the chapter one we will discuss about the characteristics of
the embedded systems, the 8051 architecture, 8051 pin
configuration and details about its port structures.
In chapter two we will discuss the programming in
embedded C and use C code to control the relays.
In chapter three we will discuss about the components used in the
project.
Finally we will discuss the results of the projects.
8. 8 | P a g e
During the project work I took help of the Software like:
Keil : Helps for Writing the program and generation of
Hex file.
Proteus : Helps to simulate the circuitry and checking of
functionality
This projects has the following applications
Enable the user to remotely control any device in the home.
Lift irrigation used in agricultural field.
User can remotely fill the water tank through their mobile
phone.
Emergency door opening or closing.
Can be used to shut up main supply of the home.
Most beneficial for outdoor application and this circuit can
be attached to any systems where wireless automation is
needed.
9. 9 | P a g e
Chapter 1
EMBEDDED SYSTEM AND
MICROCONTROLLER
1.1 Introduction to embedded system:
A combination of hardware and software which together
forms a component of a larger system. An example of an
embedded system is a microprocessor that controls an
automobile engine. An embedded system is designed to run on
its own without human interference, and may be required to
respond to events in real time.
“An embedded system is a system that has embedded
software and computer hardware, which makes it a system
dedicated for an application or specific part of an application or
product or a part of a larger system”.
In general purpose processor like 8086 (x86), these
processor based system are for multipurpose and we can see or
touch the system. But the embedded systems are dedicated for
single task and it can hide inside a system which user cannot
see or touch. By designing an embedded system the designer
can follow some in choosing the microcontroller like
1) Meeting the computing needs of the task at hand efficiently
and cost effectively,
2) Availability of software development tools such compiler,
assembler, and debugger,
3) Wide availability and reliable sources of the microcontroller.
10. 10 | P a g e
1.2 Characteristics of Embedded System:
Application and domain specific
Each embedded system is developed in such a manner to do the
dedicated function only. It should not be replaced with any other
system.
Reactive and Real Time
In reactive and real time system, the system is in continuous
interaction with the outer world through sensors to detect the
instant changes.
Operation in harsh Environment
The environment in which the embedded system deployed
may be a dusty one or a high temperature zone or an area subject to
vibration or shock. The system placed in such area should be
capable to withstand all these adverse operating conditions.
Small Size and Weight
Many embedded system demands small size and low weight
products. These may be an important factor while choosing and
installing a system.
Power consumption
The designed embedded system should consume less power.
The power management is a critical constraint in battery operated
systems
11. 11 | P a g e
1.3. 8051 Evolution:
In 1981, Intel Corporation introduced an 8-bit microcontroller
called the 8051. This microcontroller had 128 bytes of RAM, 4K
bytes of on chip ROM, two timers, one serial port and four input-
output ports each of 8-bit wide, all on a single chip. At the time it
was also referred to as a “system on a chip
The 8051 became widely popular after Intel allowed other
manufacturers to make and market any flavors of the 8051 they
please with the condition that they remain code compatible with the
8051. This has led to many version of the 8051 with different speed
and amount of on chip ROM and RAM. Later two other version of
the 8051 was included. They are 8052 and 8031.
8052 is another member of the 8051 family. The 8052 has all
the standards features of 8051 as well as some extra features like
extra 128 bytes RAM, an extra timer, and an extra 4Kbytes of on
chip ROM. The pin configurations of both are same.
Another member of the 8051 family is the 8031 chip. This chip
is often referred to as a ROM-less 8051 as it has 0Kbytes of on chip
ROM. That is to use this chip you must add an external ROM to it.
The 8051, 8052 and 8031 all has same pin configuration so that
it can easily be replaced with anyone. All the features and
comparison of the three are listed as:
Features 8051 8052 8031 8032
ROM (on chip
program
memory in
bytes)
4K 8K 0K 0K
RAM(on chip
data memory
in bytes)
128 256 128 256
I/O pins 32 32 32 32
12. 12 | P a g e
Total pins
including
Gnd
40 40 40 40
Working
voltage(Vcc)
5V 5V 5V 5V
Timers 2 3 2 3
Serial port 1 1 1 1
Interrupt
sources
6 8 6 8
Programming
language
C/Assembly C/Assembly C/Assembly C/Assembly
1.4. 8051 Architecture:
[Architecture of AT89S51]
1.5 Microcontroller overview:
Read Only Memory (ROM)
Read Only Memory (ROM) is a type of memory used to
permanently save the program being executed. The size of the
program that can be written depends on the size of this memory.
ROM can be built in the microcontroller or added as an external
chip, which depends on the type of the microcontroller.
13. 13 | P a g e
Random Access Memory (RAM)
Random Access Memory (RAM) is a type of memory used for
temporary storing data and intermediate results created and used
during the operation of the microcontrollers. The content of this
memory is cleared once the power supply is off.
Electrically Erasable Programmable ROM (EEPROM)
The EEPROM is a special type of memory not contained in all
microcontrollers. Its contents may be changed during program
execution (similar to RAM), but remains permanently saved even
after the loss of power (similar to ROM). A disadvantage of this
memory is that the process of programming is relatively slow.
Special Function Registers (SFR)
Special function registers are part of RAM memory. Their purpose
is predefined by the manufacturer and cannot be changed therefore.
Since their bits are physically connected to particular circuits within
the microcontroller, such as A/D converter, serial communication
module etc, any change of their state directly affects the operation
of the microcontroller or some of the circuits.
Program Counter
Program Counter is an engine running the program and points to
the memory address containing the next instruction to execute.
After each instruction execution, the value of the counter is
incremented by 1.However the value of the program counter can be
changed at any moment, which causes a “jump” to a new memory
location. This is how subroutines and branch instructions are
executed.
Central Processor Unit (CPU)
As its name suggests, this is a unit which monitors and controls all
processes within the microcontroller and the user cannot affect its
work. It consists of several smaller subunits, of which the most
important are:
14. 14 | P a g e
Instruction decoder is a part of the electronics which
recognizes program instructions and runs other circuits on the
basis of that.
Arithmetical Logical Unit (ALU) performs all mathematical
and logical operations upon data.
Accumulator is an SFR closely related to the operation of
ALU. It is a kind of working desk used for storing all data
upon which some operations should be executed (addition,
shift etc.). It also stores the results ready for use in further
processing.
1.6 Pin description of 8051:
15. 15 | P a g e
• Vcc(pin 40):
– Vcc provides supply voltage to the chip.
– The voltage source is +5V.
• GND(pin 20):Ground
• XTAL1 and XTAL2(pins 19,18):
– These 2 pins provide external clock.
• RST(pin 9):Reset
– It is an input pin and is active high (normally low).
– Upon applying a high pulse to RST, the microcontroller will
reset and all values in registers will be lost.
• EA(pin 31):External access
– There is no on-chip ROM in 8031 and 8032.
– The /EA pin is connected to GND to indicate the code is
stored externally.
• PSEN(pin 29):Program Store Enable
– This is an output pin and is connected to the OE pin of the
ROM.
• ALE(pin 30):Address Latch Enable
– It is an output pin and is active high.
– The ALE pin is used for de-multiplexing the address and
data by connecting to the G pin of the 74LS373 latch.
16. 16 | P a g e
• I/O Port Pins
– The 8051 has four I/O ports
– Port 0 (pins 39-32):P0(P0.0~P0.7)
– Port 1(pins 1-8) :P1(P1.0~P1.7)
– Port 2(pins 21-28):P2(P2.0~P2.7)
– Port 3(pins 10-17):P3(P3.0~P3.7)
– Each port can be used as input or output (bi-direction).
Port 0
– Port 0 is also designated as AD0-AD7 for address and data
use.
– When 8051 is connected to the external memory, P0 provides
both address and data.
– In case of 8051 system with no external memory connection both
P0 and P2 acts as simple I/O port.
– 8051 with external memory connection, P2 along with P0 to
provide 16-bit address for the external memory.
Port 1
– Can be used as Input or Output
Port 2
– Can be used as Input or Output
– Port 2 must be used along with P0 to provide 16bit address to
external memory.
– Port 0 ---A0-A7
– Port 2---- A8-A15
Port 3
• It has some additional functions which provides some
extremely important functions
18. 18 | P a g e
Chapter 2
EMBEDDED C PROGRAMMING
2.1 INTRODUCTION:
Compiler produce hex files that we download into the ROM of
the microcontroller. The size of the hex file produced by the
compiler is one of the main concerns of microcontroller
programmer, for two reasons:
1. Microcontrollers have limited on-chip ROM.
2. The code space for the 8051 is limited to 64K bytes.
2.2 WHY C LANGUAGE IS EFFECTIVE?
The main reason of choosing C as programming language is it
easy to program with little time as compared to the assembly
language which is tedious and time consuming. It is easier to
modify and update.
1. One can use code available in function libraries.
2. C code is portable to other microcontroller with little or no
modification.
19. 19 | P a g e
2.3 C PROGRAM TO CONTROL THE RELAY :
The simple program that is used to control the relays is as follows:
#include<reg52.h>
sbit mybit1 = P1^4;
sbit mybit2 = P1^5;
sbit mybit3 = P1^6;
sbit relay1 = P2^0;
void msdelay(unsigned int);
void main(void){
mybit1=mybit2=mybit3=0;
relay1=0;
while(1){
if(mybit3==0 && mybit2==0 && mybit1==0){
relay1=0;
msdelay(1000);
}
else if(mybit3==0 && mybit2==0 && mybit1==1){
relay1=0;
msdelay(1000);
}
else if(mybit3==0 && mybit2==1 && mybit1==0){
relay1=0;
msdelay(1000);
}
21. 21 | P a g e
void msdelay (unsigned int itime){
unsigned int i,j=0;
for(i=0;i<itime;i++){
for(j=0;j<1275;j++);
}
2.4 SWITCHING PATTERN OF RELAY:
Mybit3
P1.6
Mybit2
P1.5
Mybit1
P1.4
Relay1 Keypad
number
0 0 0 OFF 0
0 0 1 OFF 1
0 1 0 OFF 2
0 1 1 OFF 3
1 0 0 OFF 4
1 0 1 OFF 5
1 1 0 OFF 6
1 1 1 ON 7
When we press „7‟ only relay1 is active. Pressing the number
other than „7‟ will deactivate the relay permanently. In this
technique we able to control many appliance simultaneously and
individually.
22. 22 | P a g e
2.5 EXPLANATION OF THE PROGRAM:
Sbit : The Sbit keyword is widely used 8051 C data type designed
specifically to access single-bit addressable registers. It allows
access to the single bit of the SFR registers.
Time Delay: There are two ways to create a time delay in 8051 C:
1. Using a simple FOR loop.
2. Using the 8051 timers.
In either case, when we write a time delay we must use
the oscilloscope to measure the duration of our time delay.
In creating a time delay using a “FOR loop”, we must be
mindful of three factors that can affect the accuracy of the delay.
1. The 8051 design. Since the original 8051 was designed in 1980,
both the fields of IC technology and microprocessor
architectural design have been seen great advancements. The
number of machine cycles and the number of clock periods per
machine cycle vary among different versions of the 8051/52
microcontroller. The original 8051/52 design used 12 clock
periods per machine cycle, many of the newer generations of the
8051 use fewer clocks per machine cycle.
2. The crystal frequency connected to the X1 and X2 input pins. The
duration of the clock period for the machine cycle is a function
of this crystal frequency.
3. Compiler choice. When we program in assembly language, we
can control the exact instructions and their sequence used in the
delay subroutine.
In the C programs, it is the C compiler that convert the C
statement and functions to Assembly language instructions. As
a result, different compilers produce different code.
23. 23 | P a g e
Chapter 3
THE DTMF MODULE, RELAY AND L293D
3.1 INTRODUCTION:
This DTMF (Dual Tone Multi Frequency) decoder circuit
identifies the dial tone from the telephone line and decodes the key
pressed on the remote telephone. Here for the detection of DTMF
signaling, we are using the IC MT8870DE which is a touch tone
decoder IC. It decodes the input DTMF to 4 digital outputs. The M-
8870 DTMF (Dual Tone Multi Frequency) decoder IC uses a digital
counting technique to determine the frequencies of the limited
tones and to verify that they correspond to standard DTMF
frequencies. The DTMF tone is a form of one way communication
between the dialer and the telephone exchange. The whole
communication consists of the touch tone initiator and the tone
decoder or detector. The decoded bits can be interfaced to a
computer or microcontroller for further application.
3.2 Circuit Diagram:
Components required:
1. DTMF decoder IC (M-8870)
2. Resistors (100kΩ; 70kΩ; 390kΩ)
3. Capacitors (0.1µFx 2)
4. Crystal oscillator (3.579545MHz)
24. 24 | P a g e
3.3 Why we use the DTMF module?
Now days a mobile handset is very powerful tool in Daily
life application. One can check their bank balance, weather report,
and using Wi-Fi one can able to control any appliances remotely
But for outdoor application the DTMF module does the job in great
extent. The DTMF module is the simplest, cheapest and very
efficient circuit for the detection of dual tone frequency
3.4 The Need of DTMF Decoding:
Few decades ago, our telephone systems were operated by
human operators in a telephone exchange room. The caller will pick
up the phone, giving instruction to the operator to connect their line
to the destination. It is a kind of manual switching. As more and
more user entered in the telephone technology as useful
communication gear, manual switching becomes a time consuming
tedious task.
As technology established, pulse or dial tone technique were
invented for telephone communication switching. It employs
electronics and computers to support switching operations. DTMF
is the ultimate technique used in any of the Mobile, Telephone
communication systems.
3.5 The operation of DTMF method:
Caller generates a dial tone consisting of two frequencies.
Telephone exchange consists of a DTMF decoder module,
which decodes the high and low frequencies, detects the key
pressed and generates the equivalent binary code.
These codes are the address of destination subscriber; it is
read and processed by a computer which connects caller to
the destination subscriber.
Ultimately DTMF decoder module performs the automatic
switching efficiently.
25. 25 | P a g e
3.6 Working of DTMF decoder circuit:
DTMF keypads are employed in almost all landline and
mobile handsets (0-9,*, #). Thus this technology is used in the
telephone switching centers to identify the number dialed by
the caller.
The decoder distinguishes the DTMF tones and produces the
binary sequence equivalent to key pressed in a DTMF keypad.
The circuit uses M8870 DTMF decoder IC which decodes tone
generated by the keypad of cell phone.
DTMF signals can be tapped directly from the microphone
pin of cell phone device. 3.5mm audio jack has three
connections one is speaker ground and another two are
speaker left and speaker right, speaker left and/or speaker
right acts as the input to the DTMF decoder module.
The signals from the microphone wire are processed by the
DTMF decoder IC which generates an equivalent binary
sequence as a parallel output like D1, D2, D3, and D4.
Table showing DTMF Low and High frequency tones and
decoded output:
Button Low
DTMF
frequency
(Hz)
High
DTMF
frequency
(Hz)
Binary Output
D4 D3 D2 D1
0 941 1336 1 0 1 0
1 697 1209 0 0 0 1
2 697 1336 0 0 1 0
3 697 1447 0 0 1 1
4 770 1209 0 1 0 0
5 770 1336 0 1 0 1
6 770 1447 0 1 1 0
7 852 1209 0 1 1 1
8 852 1336 1 0 0 0
9 852 1447 1 0 0 1
* 941 1209 1 0 1 1
# 941 1447 1 1 0 0
26. 26 | P a g e
There is an inbuilt Op-amp present inside the M8870 decoder
IC. The electrical signals from microphone pin are fed to
inverting input of the Op-Amp via a series of resistance
(100kΩ) and capacitance (0.1 µF).
The non-inverting input of Op-amp is connected to a
reference voltage (pin4 –Vref). The voltage at Vref pin is Vcc/2.
Pin 3 (GS) is the output of internal Op Amp, the feedback
signal is given by connecting the output pin (pin3- GS) to
inverting input pin (pin2- IN-) through a resistor (270kΩ).
The output of Op Amp is passed through a pre filter, low
group and high group filters (filter networks). These filters
contain switched capacitors to divide DTMF tones into low
and high group signals (High group filters bypass the high
frequencies whereas low group filter pass low frequencies).
Next processing sections inside the IC are frequency detector
and code detector circuits. Filtered frequency passed through
these detectors.
At last the four digit binary code is latched at the output of
M8870 DTMF decoder IC.
Uses of other pins:
The entire process from frequency detection to latching of the
data, is controlled by steering control circuit consisting of
St/GT, Est pins, resistor (390kΩ) and a capacitor (0.1µF).
5th Pin, INH is an active high pin, inhibits detection of A, B,
C, D tones of character.
6th Pin, PWDN is an (active high), inhibits the working of
oscillator thus stops the working of our circuit.
1 2 3 697Hz
4 5 6 770Hz
7 8 9 852Hz
* 0 # 941Hz
1209Hz 1336Hz 1447Hz
27. 27 | P a g e
The 10th pin 10; TOE is the output enable pin which is active
high logic and enables the latching of the data on the data
pins D0, D1, D2, and D3.
15th Pin STD is the Data valid pin, turn out to be high on
detection of valid DTMF tone or else it remains low.
Pins 7 (OS1) and 8 (OS2) are used to connect crystal oscillator.
An oscillator of frequency 3.579545 MHz is used here.
3.7 History of Relay:
A simple electrically controlled device, which is also called as
relay, was included in the original 1840 telegraph patent of Samuel
Morse. The mechanism described acted as a digital amplifier,
repeating the telegraph signal, and thus allowing signals to be
propagated as far as desired. This overcame the problem of limited
range of earlier telegraphy schemes.
A contactor is an electrically controlled switch used for switching
a power circuit, similar to a relay except with higher current ratings
(i.e. 10A to several hundred ampere at 120V to 415V Coil voltage).
A contactor is controlled by a circuit which has a much lower
power consumption rate than the switched circuit.
Contactors are used to control electric motors, lighting, heating,
capacitor banks, thermal evaporators, and other electrical loads
having higher power rating.
3.8 Basic Design and Operation of Relay:
28. 28 | P a g e
A simple electromagnetic relay consists of a coil of wire
wrapped around a soft iron core, an iron yoke which provides a
low reluctance path for magnetic flux, a movable iron armature,
and one or more sets of contacts.
The armature is hinged to the yoke and mechanically linked to
one or more sets of moving contacts.
It is held in place by a spring so that when the relay is de-
energized there is an air gap in the magnetic circuit. In this
condition, one of the two sets of contacts in the relay pictured is
closed, and the other set is open.
When the electric current is passed through the coil it generates a
magnetic field that activates the armature and the consequent
movement of the movable contact either makes or breaks a
connection with a fixed contact.
If the set of contacts was closed when the relay was de-
energized, then the movement opens the contacts and breaks the
connection, and vice versa if the contacts were open.
Most relays are manufactured to operate quickly. In a low-
voltage application this reduces noise; in a high voltage or
current application it reduces arcing.
When the coil is energized with direct current, a diode is often
placed across the coil to dissipate the energy from the collapsing
magnetic field at deactivation, which would otherwise generate
a voltage spike dangerous to semiconductor circuit components.
If the coil is designed to be energized with alternating current
(AC), some method is used to split the flux into two out-of-phase
components which add together, increasing the minimum pull
on the armature during the AC cycle. Typically this is done with
a small copper "shading ring" crimped around a portion of the
core that creates the delayed, out-of-phase component.
29. 29 | P a g e
Latching Relay:
A latching relay (also called "impulse", "keep", or "stay" relays)
maintains either contact position indefinitely without power
applied to the coil. The advantage is that one coil consumes
power only for an instant while the relay is being switched, and
the relay contacts retain this setting across a power outage.
A latching relay allows remote control of building lighting
without the human interaction that may be produced from a
continuously (AC) energized coil.
This type is widely used where control is from simple switches
or single-ended outputs of a control system, and such relays are
found in avionics and numerous industrial applications.
3.9 Pole and Throw:
Since relays are switches, the terminology applied to switches is
also applied to relays; a relay switches one or more poles, each of
whose contacts can be thrown by energizing the coil with
specified voltage.
Normally-open (NO) contacts connect the circuit when the relay
is activated; the circuit is disconnected when the relay is inactive.
Normally-closed (NC) contacts disconnect the circuit when the
relay is activated; the circuit is connected when the relay is
inactive.
Change-over (CO), or double-throw (DT), contacts control two
circuits: one normally-open contact and one normally-closed
contact with a common terminal.
30. 30 | P a g e
[SPDT Relay pin configuration]
The following designations are commonly encountered:
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.
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.
• 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.
3.10 Relay selecting factors:
Number and type of contacts – normally-open(NO), normally-
closed(NC), (double-throw)
31. 31 | P a g e
Contact sequence – "Make before Break" or "Break before Make".
For example, the old style telephone exchanges required Make-
before-break so that the connection didn't get dropped while
dialing the number.
Rating of contacts – small relays switch a few amperes, large
contactors are rated for up to 3000 amperes, alternating (AC) or
direct current (DC).
Operating lifetime, useful life - the number of times the relay
can be expected to operate reliably.
Package/enclosure – open, touch-safe, double-voltage for
isolation between circuits, explosion proof, outdoor, oil and
splash resistant, washable for printed circuit board assembly.
Operating environment - minimum and maximum operating
temperatures and other environmental considerations such as
effects of humidity and salt.
Assembly – Some relays feature a sticker that keeps the
enclosure sealed to allow PCB post soldering cleaning, which is
removed once assembly is complete.
Switching time – where high speed is required.
Coil protection – suppress the surge voltage produced when
switching the coil current.
32. 32 | P a g e
Isolation between coil contacts.
Size - smaller relays often resist mechanical vibration and shock
better than larger relays.
3.11 Application of Relay:
Relays are used wherever it is necessary to control a high power
or high voltage circuit with a low power circuit. High-voltage or
high-current devices can be controlled with small, low voltage
wiring. Low power devices such as microprocessors or
microcontrollers can drive relays to control electrical loads beyond
their direct drive capability.
3.12 Introduction to L293D (H-bridge driver):
The L293 and L293D are quadruple high-current half-H bridge
drivers. Also defined as H-bridge. The L293 is designed to provide
bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36
V. The L293D is designed to provide bidirectional drive currents of
up to 600-mA at voltages from 4.5 V to 36 V.
Both devices are designed to drive inductive loads such as relays,
solenoids, dc and bipolar stepping motors, as well as other high-
current/high-voltage loads in positive-supply applications. Drivers
are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and
drivers 3 and 4 enabled by 3,4EN.When enable input is high, the
associated drivers are enabled, and their outputs are active and in
phase with their inputs. When the enable input is low, those drivers
are disabled, and their outputs are off and in the high-impedance
state. With the proper data inputs, each pair of drivers forms a full-
H (or bridge) reversible drive suitable for solenoid or motor
applications.
33. 33 | P a g e
3.13 Pin Description:
Pin
No
Function Name
1 Enable pin for Motor 1; active high Enable 1,2
2 Input 1 for Motor 1 Input 1
3 Output 1 for Motor 1 Output 1
4 Ground (0V) Ground
5 Ground (0V) Ground
6 Output 2 for Motor 1 Output 2
7 Input 2 for Motor 1 Input 2
8 Supply voltage for Motors; 9-12V (up to 36V) Vcc 2
9 Enable pin for Motor 2; active high Enable 3,4
10 Input 1 for Motor 1 Input 3
11 Output 1 for Motor 1 Output 3
12 Ground (0V) Ground
13 Ground (0V) Ground
14 Output 2 for Motor 1 Output 4
15 Input2 for Motor 1 Input 4
16 Supply voltage; 5V (up to 36V) Vcc 1
34. 34 | P a g e
Chapter 4
GLOWING OF THE BULB
4.1 The automation circuit diagram:
A very simple circuit which can control the operation of a Bulb
or the main power supply of the home or the main supply of the
industry etc. is shown in the figure below. The names of the
different parts are represented in figure.
4.2 Results:
As expected the circuit will switch the relays according to human
instructions. Using that automation circuit we are able run Bulb or
any home appliances.
35. 35 | P a g e
Chapter 5
RESULTS
5.1 Conclusion:
This project work provides an efficient tool to control a
device remotely with the “Mobile Handset.” It has versatility like
it can be installed in any circuit which needed wireless
automation and also reduces the electricity bills.
36. 36 | P a g e
5.2 Advantages and Disadvantages:
ADVANTAGE:
Highly efficient in wireless control.
Required less power (even less than a Watt) for its
operation. This requirement is necessary as the device is
always needed to put in standby mode.
Less noisy.
Cost effective.
Easy to implement and upgrade.
Applicable to higher current rating equipment also.
DISADVANTAGE:
Disclosing the mobile number to anyone leads to fatal
accidents.
Need a protective circuit. The handset attached to the circuit
must keep under the network coverage and is in standby
mode 24*7.
5.2 Application area and the future work:
This project has many application areas like:
1. It can be used to control the electrical device remotely over
anywhere in the world.
2. It can be used to run the water pump in home without using any
extra power circuit.
3. With the help of extra power and protective circuit, it can break
the main supply of the home, industry etc. temporarily.
We expect if this device is assembled with the above mentioned
tool then it will be a very big success in the technology field because
37. 37 | P a g e
it has the capability to shut down power supply of a town
temporarily in panic situation like storm.
5.3 References:
1. The 8051 Microcontroller and Embedded Systems Using
Assembly and C by Muhammad Ali Mazidi, Second Edition,
Pearson Publication.
2. “SMS Based Wireless Home Appliance Control System
(HACS) for Automating Appliances and Security”, Issues in
Informing Science and Information Technology, Volume 6, 2009
3. “A Review on Home Control Automation Using GSM and
Bluetooth”, International Journal of Advanced Research in
Computer Science and Software Engineering, Volume 5, Issue
2, February 2015, ISSN: 2277 128X
4. “Smart Home System-Controlling electrical appliances via
Bluetooth ad hoc network communication on Android
Platform”, Proc. of the Intl. Conf. on Advances in Computing
and Communication – ICACC 2013, ISBN: 978-981-07-6260-5
doi:10.3850/ 978-981-07-6260-5_53