You are on page 1of 39

Cell phone based device control system/2005

ACKNOWLEDGMENT

First of all, we are most grateful to Almighty GOD for blessing me with good health and ideas
for completing this project successfully. We would like to show my highest gratitude to our
advisor, Estifanos Yohannis for his invaluable support, patient, assistance and especially his
encouragement to this project. We truly have learnt a lot and all this would not be without his
guidance. W also would like to thank all our fellow friends for their contribution in giving me a
moral support throughout our project development period. Last but not lease, to the Department
of Electrical and Computer Engineering, because giving me chance to study and complete our
project as part of the Bachelor program in University of Hawassa (HU).

HAWASSA UNIVERSITY PAGE 1


Cell phone based device control system/2005

List of Figures and Tables pages

Fig.2.1 System Diagram

Fig .2.2 SMS System Architecture

Fig .2.3 Microcontroller Layout

Fig .2.4 AT89s51 Microcontroller

Fig .2.5 GSM Modem Block Diagram

Fig .2.6 ULN 2803

Fig .2.7 RS232

Fig .2.8 Relay Operation

Fig .3.1 Pin Layout of Microcontroller

Fig .3.2 Pin Layout of RS23

Fig .3.3 Description of Pin Layout of RS232

HAWASSA UNIVERSITY PAGE 2


Cell phone based device control system/2005

List of Acronyms

SMS Short Message System

GSM Global System of Mobile Communication

LED Light Emitting Diode

TDMA Time Division Multiple Access

HLR Home Location Register

SMSC Short Message System Center

SMPP Short Message Peer –to-Peer

RAM Random Access Method

ROM Read Only Method

PEROM Erasable Read-Only Memory

IC Integrated Circuit

PIC Peripheral Interface Controller

MCU Microcontroller

CMOS Complementary Metal Oxide Semiconductor

TTL Transistor _Transistor logics

DIP Dual in _line Package

DTE Data Terminal Equipment

DCE Data Common Equipment

UART Universal Access Receiver and Transmitter

IDE Integrated Development Environment

HAWASSA UNIVERSITY PAGE 3


Cell phone based device control system/2005

ABSTRACT

This project focuses on how to control electrical switch for home appliances such as lamp,
kitchen light, fans divider etc. automatically by using a mobile phone that connected to a simple
microcontroller circuit. The process starts by sending a simple SMS to recipient; the mobile
phone that has been connected to the microcontroller circuit placed at the corner of your home or
office. Receiver is a mobile phone that can be used to send or receive SMS. If the user sends the
SMS to find out the statues of electrical equipment whether it is ON or OFF, the mobile phone
will respond by telling that there is appliances that has not been closed and where it is installed.
When the status is known, the user can do what he/she wants for example, if the users want
switch room light ON, he/she only need to send SMS with keywords to the receiver, and
immediately the microcontroller will encode the keywords and send the instruction to trigger
microcontroller circuit to switch on the light. Use the same procedure to control other electrical
equipment. This system can be used anywhere, as long as it in the ranges of phone network
provides by the operators.

HAWASSA UNIVERSITY PAGE 4


Cell phone based device control system/2005

CHAPTER ONE

INTRODUCTION
Background
The new age of technology has redefined communication. Most people nowadays have access to
mobile phones and thus the world indeed has become a global village. At any given moment, any
particular individual can be contacted with the mobile phone. But the application of mobile
phone cannot just be restricted to sending SMS or starting conversations. New innovations and
ideas can be generated from it that can further enhance its capabilities. Technologies such as
Infra-red, Bluetooth, etc which has developed in recent years goes to show the very fact that
improvements are in fact possible and these improvements have eased our life and the way we
live. Remote management of several home and office appliances is a subject of growing interest
and in recent years we have seen many systems providing such controls. The use of modern
technologies is to achieve the power conservation not only through the
proper design of respective devices and other parameters in the power system. A major part of
power conservation can be achieved by consumer„s proper usage of the power for home
appliances, for this purpose CELL PHONE BASED DEVICE CONTROL is one of the optimal
way .Which uses Mobile technology that keeps monitoring of the various appliances, and will
control the operation of these appliances with respect to the signal sent by the mobile. For
utilization of appliances the new concept has been thought to manage them remotely by using
mobile, which enables the user to remotely control switching of domestic appliances. Just by
dialing keypad of remote telephone, from where you are calling you can perform ON / OFF
operation of the appliances.

HAWASSA UNIVERSITY PAGE 5


Cell phone based device control system/2005

1.2 Over view of the Project


Nowadays, people‟s expectations in their life quality are increasing as the technology is
improving rapidly. People need an affordable smart system that can make their lives easier, more
comfortable, and offer more safety. Cell phone based device control System is an electrical and
electronic system designed to control home appliances with a mobile phone.

The system provides availability due to development of a low cost system. The home appliances
control system with an affordable cost was thought to be build that should be mobile providing
remote access to the appliances and allowing home security. Though devices connected as home
and office, appliances consume electrical power. These devices should be controlled as well as
turn on/off if required. Now it is a necessity to control devices more effectively and efficiently at
anytime from anywhere.
In this system, we are going to develop a cellular phone based home/office appliance. This
system is designed for controlling arbitrary devices, it includes a cell p hone (not included with
the system kit, end user has to connect his/her cell phone to the system) which is connect to the
system via head set. To active the cellular phone unit on the system a call is to be made and as
GSM modem the call is answered; in response the user would enter a two/three digit password to
access the system to control devices. As the caller press the specific password, it results in
turning ON or OFF specific device

HAWASSA UNIVERSITY PAGE 6


Cell phone based device control system/2005

1.3 Literature Review


There are many projects that had been done using GSM modem related to device controlling
like in [1] developed a Prepaid Water Meter System for prepaid billing of water consumption
through GSM without any human involvement; [2] electrical meter reading using GSM network;
[3] Developed a water meter reading using GSM system that suitable for remote places to
monitor the water meter reading before any billing process. Here was also a work on monitoring
of electrical meter reading using GSM network done by [5]. In [4], this system is used to control
home appliance tenuously and offer security when the owner is away from the place. In [6]
designed and developed a smart home application system. In [7], one more approach using
GSM technology to communicate with the remote devices via SMS is remote metering system,
In [8] [9], this paper projected a Zigbee-GSM based Monitoring and Remote Control System in
[10], developed a highly developed vehicle locking system in the real time situation.
In cell phone based device control system we have got a project that uses a GSM modem and a
microcontroller.
According to that project the person who is trying to use the system should have the GSM
modem number and password number first and that password needs to authorize person in order
to control home appliance.

Limitations

Our project has certain limitations and a list of such is mentioned below;

 The receiver must reside in a location where a signal with sufficient strength can be
received from a cellular phone network.
 Only devices with electrical controlling input ports will be possible targets for control.
 Operation of the controlling unit is only possible through a cell phone with SMS
messaging capabilities.
 The Controlling unit must be able to receive and decode SMS messages.

HAWASSA UNIVERSITY PAGE 7


Cell phone based device control system/2005

1.4 Statement of Problem


Nowadays many people are busy in their daily life then they forgot power without switch off
different electronic equipment. This would result wastage of energy and even device damage due
to overheating. Even if we remember that we have not switch off some device, it may be difficult
for us to come back and switch of them. Because, it take a lot of time to return back and to
switch off. Even the user can open the electronic home appliance ON from long distance as well
as to use cell phone as remote control. Therefore we are initiated to planning and to design cell
phone device control to overcome the above problem.

1.5 OBJECTIVE
1.5.1 General Objective
The main aim of the project was to develop an interface between the GSM and electrical
appliances for the users and also a user to remotely monitoring and control multiple home
appliances or electronic devices using cell phone.

1.5.2 Specific Objective


 To design microcontroller and its application based on our project.
 To resolve the problem of energy wastage that occurs because of Carelessness.
 To provide a system that easily maintained
 To know how we can use SMS as a medium of communication between users with the
system
 To implement cell phone based device control system.

HAWASSA UNIVERSITY PAGE 8


Cell phone based device control system/2005

1.6 METHODOLOGY

We use different methods to do these projects:

 We had to start from the research phase at the beginning and needed to gain knowledge
on all the devices and components that we had intended to use for our project.
 We gathering different information and components by referring different books and
searching web site regarding with our project.
 Arrangements of collecting data
 We had selected electrical components and build circuit diagram according to theory
 We write a code and load on microcontroller and simulated our system.

1.6.1 Material Required


 Microcontroller (AT89C51)
 Relay driver (L293D)
 Crystal oscillator
 Resistors
 Diode
 LED
 Capacitor
 Mobile headset connector
 Push to switch way
 DIP switch

HAWASSA UNIVERSITY PAGE 9


Cell phone based device control system/2005

CHAPTER TWO
2.1 Description of the System

In general, the system is consists of two main parts which are phone to GSM modem
communication and home appliance communication with line of power. The user sending SMS
commands to GSM modem (GSM phone) with his/her cell phone. The GSM modem would
transfer the instruction for microcontroller though serial interfaces. The interfaces device
between GSM modem and microcontroller was said to be RS232 or MAX232.This device
change analogy data into digital data because the microcontroller input is digital one. Then,
microcontroller send the instruction to control electronic home appliance but the microcontroller
output small voltage values compares with device voltages then the system needs amplifier this
values such as unl2803 devices boost coming voltage. After that, according to user message the
home appliance would be controlled. The following diagram shows general structure of the
system.

HAWASSA UNIVERSITY PAGE 10


Cell phone based device control system/2005

AT89C51
MCR
Cell phone GSM RS 232 ULN2803
modem

Lamp Relay

Fan

Divider

Refrigerator

Fig 2.1 system diagram

HAWASSA UNIVERSITY PAGE 11


Cell phone based device control system/2005

2.2 SMS

The SMS service is simply a digital network facility that allows digital phone users to receive
text messages on their digital phones. Each message may be a maximum of 160 characters long.
In this document, we provide an introduction to basic SMS concepts, networks and
specifications, and SMS tools and services.

Short Message Service (SMS) is the transmission of short text messages to and from a mobile
phone, fax machine, and/or IP address. Messages must be no longer than 160 alphanumeric
characters and contain no images or graphics. SMS is a relatively simple messaging system
provided by the mobile phone networks. SMS messages are supported by GSM, TDMA and
CDMA based mobile phone networks currently in use. Although services based on SMS have
been feasible for many years, the recent mobile phone penetration and large scale adoption of the
existing services by users have made the SMS based services even more attractive to service
providers. Once a message is sent, it is received by a Short Message Service Center (SMSC),
which must then direct it to the appropriate mobile device.

To do this, the SMSC sends a SMS Request to the home location register (HLR) to find the
roaming customer. Once the HLR receives the request, it will respond to the SMSC with the
subscriber's status: 1) inactive or active 2) where subscriber is roaming. If the response is
'inactive', then the SMSC will hold onto the message for a period of time. When the subscr iber
accesses his device, the HLR sends a SMS Notification to the SMSC, and the SMSC will attempt
delivery. The SMSC transfers the message in a Short Message Delivery Point-to-Point format to
the serving system. The system pages the device, and if it respo nds, the message gets delivered.
The SMSC receives verification that the message was received by the end user, then categorizes
the message as 'sent' and will not attempt to send again. The basic principle is that there is only
one SMSC (SMS Center) that encodes the messages to be submitted through the GSM network.
The basic difficulty in developing SMS based services is the variety of protocols used in SMS
Centers.

HAWASSA UNIVERSITY PAGE 12


Cell phone based device control system/2005

To use the Short Message Service, users need the relevant subscriptions and hardware,

Specifically:

 A subscription to a mobile telephone network that supports SMS


 A mobile phone that supports SMS.
 The use of SMS must be enabled for the user. (automatic access to the SMS is
given by some mobile network operators; others charge a monthly subscription
and require a specific opt-in to use the service)
 Knowledge of how to send or read a short message using the specific model of
mobile phone.
 A destination to send a short message to, or receive a message from. This is
usually another mobile phone but may be a fax machine, PC or Internet address.

At a minimum, SMS benefits include the following:

 Delivery of notifications and alerts


 Guaranteed message delivery
 Reliable, low-cost communication mechanism for concise information
 Ability to screen messages and return calls in a selective way
 Increased subscriber productivity More sophisticated functionality provides the
following enhanced subscriber benefits:
 Delivery of messages to multiple subscribers at a time
 Ability to receive diverse information
 E-mail generation
 Creation of user groups
 Integration with other data and Internet-based application

HAWASSA UNIVERSITY PAGE 13


Cell phone based device control system/2005

Fig .2.2 SMS system architecture

The figure shows .An aggregator is a business entity that negotiates agreements with network
providers to act as a middle man providing access to a cellular network for messaging services to
third parties who have no direct relationship with the cellular network. The message aggregator
uses the SMPP to maintain connections with carrier networks. Aggregators typically provide
access to their servers either through SMPP or using custom APIs written in Java, PHP, Perl, and
so on.

HAWASSA UNIVERSITY PAGE 14


Cell phone based device control system/2005

2.3 Microcontroller

A microcontroller (MCU) is a basic part of computer on a single integrated circuit (IC) that
contents a processor core, programmable input/output peripherals, and memory (RAM). For our
project we use at89c51 with typical microcontroller with latest version of 89s51/52 that has been
used in this time. It is a low-power, high-performance, 8-bit microcontroller with 4kB of flash
programmable and erasable read-only memory (PEROM) used as on-chip program memory, 128
bytes of RAM used as internal data memory.
Microcontrollers are usually found in automatically controlled devices such as appliances, toys,
remote controls, radios, television, and many similar areas. It is preferred due to its speed, small
size, internal time, interrupt control, and re-programmable flash memory properties. Among the
choices, PIC (Peripheral Interface Controller) is the most popular and common used MCU.

Fig 2.3 basic layout of microcontroller

HAWASSA UNIVERSITY PAGE 15


Cell phone based device control system/2005

AT89S52 important specification:

 Compatible with the previous family of microcontrollers MCS51


 8 K Bytes In the system Programmable (ISP) flash memory with a capacity of 1000 times
read / write
 working voltage 4 - 5.0V
 Working with a range of 0 - 33MHz
 256x8 bit internal RAM
 32 point I / 0 can be programmed
 3 16 bit Timer / Counter
 8 sources Interrupt
 Watchdog timer
 dual data pointer
 SP (stack pointer) programming mode flexible (Byte and Page Mode)

HAWASSA UNIVERSITY PAGE 16


Cell phone based device control system/2005

Fig2.4 microcontroller at89s52

At89s52 microcontroller has the following feature and quantity

ROM (read only memory) 4K bytes

RAM (random access memory) 128 bytes

32 programmable Input/output pins

Two 16 bits Timers/counter

Serial port 1

Interrupt sources 6

HAWASSA UNIVERSITY PAGE 17


Cell phone based device control system/2005

2.4 GSM MODULE

GSM has been the backbone of the phenomenal success in mobile telecom over the last decade.
Now, at the dawn of the era of true broadband services, GSM continues to evolve to meet new
demands. GSM is an open, non- proprietary system that is constantly evolving. One of its great
strengths is the international roaming capability. This gives consumers seamless and same
standardized same number contact ability in more than 212 countries. This has been a vital driver
in growth, with around 300 million GSM subscribers currently in Europe and Asia. In the
Americas, today's 7 million subscribers are set to grow rapidly, with market potential of 500
million in population, due to the introduction of GSM 800, which allows operators using the 800
MHz band to have access to GSM technology too. GSM satellite roaming has extended service
access to areas where terrestrial coverage is not available.GSM differs from first generation
wireless systems in that it uses digital technology and time division multiple access transmiss ion
methods. Voice is digitally encoded via a unique encoder, which emulates the characteristics
of human speech. This method of transmission permits a very efficient data rate/information
content ratio. Cellular mobile communication is based on the concept of frequency reuse. That
is, the limited spectrum allocated to the service is partitioned into, for example, N non-
overlapping channel sets, which are then
assigned inaregular repeated pattern to a hexagonal cell grid. The hexagon is just convenient idealization
that approximates the shape of a circle (the constant signal level contour from an Omni directional
antenna placed at the center) but forms a grid with no gaps or overlaps. The choice of N is dependent on
many tradeoffs involving the local propagation environment, traffic distribution, and costs. The
propagation environment determines the interference received from neighboring co-channel cells, which
in turn governs the reuse distance, that is, the distance allowed between co-channel cells (cells using the
same set of frequency channels).The cell size determination is usually based on the local traffic
distribution and demand. The more the concentration of traffic demand in the area, the smaller the cell has
to be sized in order to avail the frequency set to a smaller number of roaming subscribers and thus limit
the call blocking probability within the cell. On the other hand, the smaller the cell is sized, the
more equipment will be needed in the

HAWASSA UNIVERSITY PAGE 18


Cell phone based device control system/2005

System as each cell requires the necessary transceiver and switching equipment, known as the
base station subsystem (BSS), through which the mobile users access the network over radio
links. The degree to which the allocated frequency spectrum is reused over the cellular service
area, however, determines the spectrum efficiency in cellular systems. That means the smaller
the cell size, and the smaller the number of cells in there uses geometry, the higher will be the
spectrum usage efficiency. Since digital modulation systems can operate with a smaller signal to
noise (i.e., signal to interference) ratio for the same service quality, they, in one respect, would
allow smaller reuse distance and thus provide higher spectrum efficiency. Thesis one advantage
the digital cellular provides over the older analogue cellular radio communication systems. It is
worth mentioning that the digital systems have commonly used sectored cells with 120-degree or
smaller directional antennas to further lower the effective reuse distance. This allows a
smaller number of cells in the reuse pattern and makes a larger fraction of the total frequency
spectrum available within each cell. Currently, research is being done on implementing other
enhancements such as the use of dynamic channel assignment strategies for raising the spectrum
efficiency in certain cases, such as high uneven traffic distribution over cells

GSM SPECIFICATION

Device Name: Wave com


ROM (flash): 16 Mb
RAM : 2Mb
Operating voltage: 3.1-4.5V
Receiving Frequency: 925-960MHz
Tr a ns mitt ing F r e q ue nc y: 8 8 0 – 9 1 5 M Hz

HAWASSA UNIVERSITY PAGE 19


Cell phone based device control system/2005

GSM BLOCK DIAGRAM

Fig2.5GSM modem block diagram

HAWASSA UNIVERSITY PAGE 20


Cell phone based device control system/2005

2.5 ULN2803

The ULN2801A-ULN2805A each contains eight Darlington transistor switch common emitters
and integral suppression diodes for inductive loads. Each Darlington features a peak load current
rating of 600mA (500mA continuous) and can withstand at least50V in the off state. Outputs
maybe paralleled for higher current capability.

Five versions are available to simplify interfacing to standard logic families. The ULN2801Ais
designed for general-purpose applications with a current limit resistor. TheULN2802Ahas a
10.5kW input resistor and zener for 14-25VPMOS; theULN2803Ahas a 2.7kW input resistor for
5V TTL and CMOS. The ULN2804A has a 10.5kW input resistor for 6-15VCMOS and the
ULN2805A is designed to sink a minimum of 350mA for standard and Scotty TTL where higher
output current is required.

All types are supplied in an 18-lead plastic DIP with a copper lead from and feature the
convenient input opposite- output Pin out to simplify board layout. The eight NPN Darlington
connected transistors in this family of arrays are ideally suited for interfacing between low logic
level digital circuitry (such as TTL, CMOS or PMOS/NMOS) and the higher current/voltage
requirements of lamps, relays, printer hammers or other similar loads for a broad range
of Computer, industrial, and consumer applications.

All devices feature open-collector outputs and freewheeling clamp diodes for transient
suppression. TheULN2803 is designed to be compatible with standard TTL families while
theULN2804 is optimized for 6 to 15volt high-level CMOS or PMOS.

HAWASSA UNIVERSITY PAGE 21


Cell phone based device control system/2005

Fig.2.6 ULN 2803

2.5.1 OPERATON OF ULN 2803


The output of the ULN2803 is "inverted". This means that a HIGH at the input becomes a LOW
at the corresponding output line. e.g. If the printer port line connected to pin 1 goes HIGH, pin
18 on the ULN2803 will go LOW (switch off).

To operate the ULN2803 board an external power supply (not exceeding maximum ratings)
needs to be connected to the +VIN connection terminal and the positive terminal for the lamp.
The negative terminal connects to the channel. When the I/O 24 module the connection to the
lamp activates the channel will go low causing the lamp to turn on. The circuit can be modified
to activate relays, solenoids etc.

2.5.2. APPLICATIONS:
 Power Switching
 On/Off Control
 Home Automation
 Relays, Motor
 Solenoids, Solenoid valves
 Lamps etc

HAWASSA UNIVERSITY PAGE 22


Cell phone based device control system/2005

2.6 RS232

A serial interface published by the EIA for asynchronous data communication over distances up
to a few hundred feet. Characterized by a single-ended (not differential) physical layer, it uses
one signal wire for transmission, another for reception, and a common wire (ground), plus some
timing and control signals. Its specifications are rooted in electromechanical equipment
signaling. The standard specifies that voltages of at least 3 V in amplitude will always be
recognized correctly at the receiver according to their polarity, so that appreciable attenuation
along the line can be tolerated. The transfer rate is rated > 20 kbps and a distance of < 15m.
Greater distance and data rates are possible with good design, but it is reasonable to assume that
these limits apply in practice as well as in theory.

The signal transmission is bipolar; requiring two voltages, from 5 to 25 volts, of opposite
polarity. That means the device sending logical „0‟ for voltage values ranges between +5 to +25
and sending a signal logical „1‟ for voltage values ranges between -5 to -25.

RS-232 is the traditional name for a series of standards for serial binary single-
ended data and control signals connecting between DTE (data terminal equipment)
and DCE (Data Communication Equipment) Data Communications Equipment is devices such
as your modem, TA adapter, plotter etc while Data Terminal Equipment is your Computer or
Terminal. In general and according to the standard, terminals and computers have male
connectors with DTE pin functions, and modems have female connectors with DCE pin function
send a digital signal is used on all interchange circuits.

HAWASSA UNIVERSITY PAGE 23


Cell phone based device control system/2005

2.6.1 Operation of RS 232

The baud rate generator is an oscillator. It provides a frequency signal which is used to control
the timing on the serial interface. Since different line speeds need a different timing, the baud
rate generation needs to be flexible. There are two general ways to achieve a flexible baud rate
generation. Either the baud rate generator itself is programmable and can produce the necessary
different frequencies, or the UART has a programmable divider or multiplier, which converts the
frequency from the baud rate generator into the required frequencies. Observers might have
noticed that there are fixed relation between typical baud rates (300bps, 600bps, 1200bps,
2400bps, 9600bps (4 x 2400bps), etc.). This simplifies the usage of frequency dividers or
multipliers to generate the necessary timing.

Depending on the actual UART, the baud rate generator either needs to become external
component, or it is directly integrated into the UART chip. From the outside, the programmatic
change of the baud rate generation is the means to control the speed of the serial connection.
Often when programming the baud rate one doesn't provide the desired baud rate in 'clear text',
but needs to provide some divider or factor. Providing the right divider or factor requires
knowing the basic frequency of the used baud rate generator

HAWASSA UNIVERSITY PAGE 24


Cell phone based device control system/2005

Fig.2.7 RS232

The RS-232-C standard specifies that the maximum length of cable between the transmitter and
receiver should not exceed 100 feet, although in practice many systems are used in which the
distance between transmitter and receiver exceeds this rather low figure. The limited range of the
RS-232C standard is one of its major shortcomings compared with other standards which offer
greater ranges within their specifications. One reason why the range of the RS-232C standard is
limited is the need to charge and discharge the capacitance of the cable connecting the
transmitter and receiver.

The connector for the RS-232-C is a 25 pin connector with a specific arrangement of wires.
In theory, a 25 wire cable could be used to connect the Data Terminal Equipment (DTE) to the
Data Communication Equipment (DCE). The DTE is a device that is acting as a data source, data
sink, or both, e.g. a terminal, peripheral or computer. The DCE is a device that provides the
functions required to establish, maintain, and terminate a data-transmission connecting, as well
as the signal conversion, and coding required for communication between data terminal
equipment and data circuit; e.g. a modem.

HAWASSA UNIVERSITY PAGE 25


Cell phone based device control system/2005

2.7 RELAYS

We know that most of the high end industrial application devices have relays for their effective
working. An electrical device, typically incorporating an electromagnet, which is activated by a
current or signal in one circuit to open or close another circuit.

Relays are simple switches which are operated both electrically and mechanically. Relays consist
of an electromagnet and also a set of contacts. The switching mechanism is carried out with the
help of the electromagnet. There are also other operating principles for its working. But they
differ according to their applications. Most of the devices have the application of relays.

A relay is an electromechanical switch. More importantly, relays are used in virtually every type
of electronic device to switch voltages and electronic signals. The most common
electromechanical switch is a simple wall switch used to control the lights in your home. The
difference with this type of switch is that wall switches require a human to perform the
“switching” between on and off. Relays operate differently. Relays require no human interaction
in order for the switching to occur. In fact, electronic pulses actually perform the switching.
Relays are very powerful devices in the fact they can be used in virtually every industry: your
automobile, telephone systems, medical devices, and yes - car stereo systems.

A relay operates based on the principals of electromagnetic. Inside a relay is an inductor (a wire
coil) that, when energized with an electric pulse, will generate a magnetic field. The second part
of a relay is a system of metallic arms which make up the physical contacts of the switch. When
the relay is off, or no electric pulse is given to the relay, the arms of the switch are in one
position. When the relay is on, or an electric pulse is sent to the relay, the swing or switching arm
of the switch moves to another contact of the switch. The arm moves as the generated magnetic
field pulls the swinging arm toward the ind uctor (or wire coil). There are many different
configurations of relays but this is the simplest form of the internal switching. Relays can have as
few as 1 moving arm up to many inside of a single relay box.

HAWASSA UNIVERSITY PAGE 26


Cell phone based device control system/2005

2.7.1 Operation of relays

Fig 2.8 relay operation

A relay which is used as a switch has moving contacts mechanically linked to an armature which
when a low current is supplied to the coil, the resulting magnetic field attracts the armature,
which closes (or opens) the circuit(s). When the coil is switched off the armature is returned by a
force .Approximately half as strong as magnetic force to its relaxed position, breaking the circuit.
Relays can have several isolated sets of switches operated by the one armature, thus several
circuits can be switched at the same time. There are many types or relays - some are intended as
"signal relays" and are used to direct audio or instrumentation signals, others as power relays,
switch high currents or voltages. A special version of a power relay, known as a contractor.

HAWASSA UNIVERSITY PAGE 27


Cell phone based device control system/2005

CHAPTER THREE

3.1 Software Description of the System


3.2 Microcontroller

General at89s51 microcontroller has 40 pins their description as follow

The pin of at89s51 or 8051 are classified into four major ports these are

 Port 0 includes pin 0 up to pin7


 Port 1 includes pin 10 up to pin1
 Port 2 includes pin 21 up to pin 28
 Port 3 includes pin31 up to pin 37

HAWASSA UNIVERSITY PAGE 28


Cell phone based device control system/2005

Fig.3.1 Pin out lay of AT89s51

HAWASSA UNIVERSITY PAGE 29


Cell phone based device control system/2005

Port 0:
Port 0 is an 8-bit open drain bidirectional port. As an open drain output port, it can sink eight LS
TTL loads. Port 0 pins that have 1s written to them float, and in that state will function as high
impedance inputs. Port 0 is also the multiplexed low-order address and data bus during accesses
to external memory. In this application it uses strong internal pull- ups when emitting 1s.Port 0
emits code bytes during program verification. In this application, external pull-ups are required.

Port 1:

Port 1 is an 8-bit bidirectional I/O port with internal pull- ups. Port1 pins that have 1s written to
them are pulled high by the internal pull- ups, and in that state can be used as inputs. As inputs,
port 1 pins that are externally being pulled low will source current because of the internal pull-
ups.

Port 2:

Port 2 is an 8-bit bidirectional I/O port with internal pull- ups. Port2 emits the high-order address byte
during accesses to external memory that use16-bit addresses. In this application, it uses the strong internal pull-ups
when emitting 1‟s.
Port3:
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. It also serves the functions of various special features
of the 80C51 Family as

P3.0 RXD (serial input port)

P3.1 TXD (serial output port)

P3.2 INT0 (external interrupt 0)

P3.3 INT1 (external interrupt 1)

P3.4 T0 (Timer 0 external interrupt)

P3.5 T1 (Timer 1 external interrupt)

P3.6 WR (external data memory write strobe)

P3.7 RD (external data memory read strobe )

HAWASSA UNIVERSITY PAGE 30


Cell phone based device control system/2005

Another signal operation pin is

VCC pin 40

 It is provides supply voltages to the chip.


 The voltage source is +5v

GND (pin 20): ground

XTAL1and XTAL2 (pin 18 and pin19):

These 2 pins provide external clock.

 Way 1: using a quartz crystal oscillator


 Way 2: using a TTL oscillator
PSEN (out): program store enable, the read signal for external program memory (active
low).
ALE (out): address latch enable, to latch address output at port 0 and port 2.
EA (in): External accesses enable active lo w to access external program memory location
0 to 4K.
RXD, TXD: UART pins for serial I/O on port 3.

HAWASSA UNIVERSITY PAGE 31


Cell phone based device control system/2005

3.2 Pin Descriptions of RS 232

RS-232 (also called serial, COM port) is a common interface and most of PC nowadays are still
equipped with one or two serial interface (RS232C) connectors. This PC serial port interface is
single ended (connects only two devices with each other), the data rate is less than 20 kbps. It's a
voltage loop serial interface with full-duplex communication represented by voltage levels with
respect to system ground. A common ground between the PC and the associated device is
necessary. There are different types of RS 232 device one of that DB9 commonly used rs232
device then, for our project we are used it. There pin descriptions as follow;

Fig.3.2RS232 pin lay out

HAWASSA UNIVERSITY PAGE 32


Cell phone based device control system/2005

Function Pin symbol 9 pin number

Received data (serial data input) RD 3

Transmit data (serial data output) TD 2

Request to send RTS 7

Clear to send CTS 8

Data ready state DSR 6

Signal ground SG 5

Data carrier detect(this line is active when DCD 1


modem detect carrier)

Data terminal ready DTR 4

Ring indicator RI 9

Fig .3.3 description of pin layout of RS232

HAWASSA UNIVERSITY PAGE 33


Cell phone based device control system/2005

CHAPTER FOUR
4.1 TEST AND RESULT DISCUSSION

The desire output or result of our project was controlling multiple home appliances by using cell
phone properly. To simulate our system we were building circuit diagram on protues software
and we write a codes in Kiel micro version. Kiel micro version is an integrated development
environment used to create software to be run on embedded systems like a microcontroller. It
allows for such software to be written either in assembly or C programming languages and for
that software to be simulated on a computer before being loaded onto the microcontroller. The
software used is c programmingμVision3 is an IDE (Integrated Development Environment) that
helps write, compile, and debug embedded programs. The system we have designed was SMS
based device monitoring and control. Then the user was only interacting with him/her cell phone
to control home appliance over long distance. Only one thing waited from the user that was send
a message according to their wants to control devices for instance, if they want to control the
lamp, they send message 1 to lamp ON and sending message 0 to lamp OFF. The system
diagram which developed on protues software is as followed:

HAWASSA UNIVERSITY PAGE 34


Cell phone based device control system/2005

Fig 4.1 circuit diagram

HAWASSA UNIVERSITY PAGE 35


Cell phone based device control system/2005

CHAPTER FIVE
CONCLUSION AND RECOMMENDATION

5.1 CONCLUSION

In general, engineering design should decrease cost and bring comfort for human beings. In this
work, the possibility of minimizing the stress of wanting to be physically present at home while
one is at work or elsewhere before being able to control and monitor what is going on in the
home appliance was enabled or disabled. A system is designed that allows one to send message
remotely and get the instructions carried out.
The approach discussed in the paper has achieved the target to control home appliances remotely
using the SMS-based system satisfying user needs and requirements. The extensive capabilities
of this system are what make it so interesting. From the convenience of a simple cell phone, a
user is able to control and monitor virtually any electrical device in a household. By connecting
all the appliances with the system through power line communication or wireless to the system,
all electrical household appliances can be controlled by sending a message from a mobile
handset. The system was validated through testing and found to be almost working perfectly
well. Therefore, our project would be:
 Cost effective because the material cost was relatively cheap.
 Easy to use because the user only sending SMS.
 No time or energy wastage.

HAWASSA UNIVERSITY PAGE 36


Cell phone based device control system/2005

5.2 RECOMMENDATIONS

Along the course of project completion we encountered various problems and obstacles. Not

everything that we had planned went smoothly during the project development span. Also we

had a limited amount of time for its completion so we were under certain amount of pressure as

well. In doing this project we have faced absence of components; especially there was no GSM

module so that we couldn‟t do any hardware implementation. We were not familiar with C

language programming.

Especial recommendation for who wants to develop/upgrading this project it is possible to


increase amount of the device and it was better doing in hard ware because the above problem
should been simplified easily. Even the system can control induction motor and high voltage
/current devices.
We shall recommend for department: it should give enough time for student to do the project in
better way. And also continuously giving advice and enforcing to come up with their progressive
presentation was making the student give the great attention for the project.
The department should support by giving the material as well as funding money to overcome
related problem with bought material.

HAWASSA UNIVERSITY PAGE 37


Cell phone based device control system/2005

REFERENCE

[1] The 8051 Microcontroller and Embedded Systems by Muhammad Ali Mazidi.
[2] Principles and Applications of GSM by Vijay Garg.
[3] Theodore s.Rapport, wireless communication, 2nd edition, PHI New Delhi
[4] Rifat Shahriyar, Enamul Hoque, S.M. Sohan, Iftekhar Naim; RemoteControlling of Home
Appliances using Mobile Telephony, InternationalJournal of Smart Home,Vol. 2, No. 3, July,
2008
[5] About AT89s8251 from www.atmel.com and www.triindia.co.in.
[6] Hardware and user manuals of the modem from MOTOROLA
C168http://developer.motorola.com/getDocument.do?docId=65054
[7] GSM SYSTEM SURVEY, Student text, EN/LZT 1233321, R5B revised upgrade
edition‟s P. 192.

HAWASSA UNIVERSITY PAGE 38


Cell phone based device control system/2005

Appendix

HAWASSA UNIVERSITY PAGE 39

You might also like