You are on page 1of 45

Electrical and Electronic device automation system using cell phone

Acknowledgement
First and at most we would like to acknowledge for our advisor Mr. Arun for his incredible
support and creation of awareness and motivation for each group member to participate actively
without missing the schedule. Which enable to build ourselves with both the theoretical and
practical knowledge; Secondly we would like to thanks Dr. Kinde instructor of communication
stream. Last but not least, we wish to express our sincere thanks you to all of our friends
for their contribution and ideas during the development of the project.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page i


Electrical and Electronic device automation system using cell phone

ABSTRACT
Practically every aspects of our day-to-day life is affected less or more by some control
systems but unfortunately most of these system require us to be at least at some distance to the
devices. Electrical and Electronic device automation system using cell phone is tasked to enable
the user to control devices (funs and lamps in our case) without being present in the nearby
through cell phones unlike the common way of controlling this items by manual switch. The
system requires essential components like a cell phone to send AT commands, a GSM network
that acts as a center for encoding the instruction, activating the microcontroller and notify the
user, a microcontroller to switch the existing relay state according to the AT command. First the
user sends specially assigned AT commands or instructions that are going to be interpreted by
the GSM network which in return activates the microcontroller to execute the instruction to
output the desired state (weather to make the current state ON/OFF). Finally the GSM will notify
the user about the current state by SMS.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page ii


Electrical and Electronic device automation system using cell phone

Contents
Acknowledgement ........................................................................................................................... i
ABSTRACT .................................................................................................................................... ii
Acronym ......................................................................................................................................... v
CHAPTER I ...................................................................................Error! Bookmark not defined.
INTRODUCTION .........................................................................Error! Bookmark not defined.
1.1background of project............................................................................................................. 1
1.2statement of project ................................................................................................................ 2
1.3 Objectives of the project ....................................................................................................... 2
1.3.1 General objectives .......................................................................................................... 2
1.3.2 Specific objectives .......................................................................................................... 2
1.4 Significances of the project ................................................................................................... 3
1.5 Applications of electrical devices control system ................................................................. 3
1.6 Methodology ......................................................................................................................... 4
1.7 Scope and limitations ............................................................................................................ 4
1.8 Organizations of the Thesis ..................................................Error! Bookmark not defined.
CHAPTER II................................................................................................................................... 4
LITERATURE REVIEW AND RESEARCH OBJECTIVES ....................................................... 5
2.1 Literature Review: ................................................................................................................. 5
2.1.1 Major strengths: .............................................................................................................. 6
2.1. 2 Major Weaknesses: ........................................................................................................ 6
2.2 Research Objectives: ............................................................................................................. 7
CHAPTER III ................................................................................Error! Bookmark not defined.
SYSTEM DESIGN AND ANALYSIS ..........................................Error! Bookmark not defined.
3.1 System block diagram ........................................................................................................... 9
3.2 component of design and system analysis......................................................................... 10
3.2.1Hardware Section .............................................................................................................. 10
3.2.1.1 Microcontroller .......................................................................................................... 10
3.2.1.2 GSM MODEM .......................................................................................................... 12
3.2.1.3 LCD display............................................................................................................... 13
3.2.1.4 Relay .......................................................................................................................... 14

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page iii
Electrical and Electronic device automation system using cell phone

Components of electro mechanical relay? ............................................................................. 14


3.2.1.5 Electrical passive element ......................................................................................... 16
3.3 semantic diagram of overall system .................................................................................... 17
3.5 working principle of system ................................................................................................ 18
3.4.2 Testing and Accessing of GSM Modem ...........................Error! Bookmark not defined.
3.4.2.1 How to access GSM MODEM using Microsoft Hyper Terminal ... Error! Bookmark
not defined.
3.4.2.2 Testing of GSM Modem .............................................Error! Bookmark not defined.
3.4.2.3 How to initialize the microcontroller......................................................................... 19
3.4.3 AT Commands .............................................................................................................. 20
3.8 Power Supply Unit .............................................................................................................. 16
ALGORITM ...............................................................................Error! Bookmark not defined.
Chapter IV ..................................................................................................................................... 22
Result and discution ...................................................................................................................... 23

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page iv


Electrical and Electronic device automation system using cell phone

Acronym

AC: Alternative Current


PIC: Microcontroller type
ADC: Analog to Digital Conversion
AT: Attention command
D: Diode
DC: Direct current
EEPROM: for Electrically Erasable Programmable Read only memory
GSM: Global System for Mobile Communication
I/O: Input/output
IT: Information Technology
LCD: liquid Crystal Display
LED: Light Emitting Diode
RTC: Real Time Clock
SMS: Short Message Service

DTE: Data Terminal Equipment

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page v


Electrical and Electronic device automation system using cell phone

CHAPTER ONE
INTRODUCTION

1.1 background of project


A cell phone based Electrical and Electronic device automation system focuses on
controlling electrical and electronic devices whether you are inside or outside your home.
Electrical and Electronic device automation system gives an individual the ability to remotely or
automatically control things at everywhere. Electrical and Electronic device automation system
is a device or instrument designed to perform a specific function, especially an electrical device,
such as a motors, irrigation system.

Electrical and Electronic device controlling system takes care of a lot of different activities in the
house and at a place where a device is found. In this project, we propose a unique system for
Electrical and Electronic device controlling system utilizing GSM module that is paired with a
wireless module to provide seamless wireless control over many devices in a everywhere.
Conventionally, electrical device in a position are controlled via switches that regulate the
electricity to these devices/ using manual switch system. As the world gets more and more
technologically advanced, we find new technology coming in deeper and deeper into our
personal lives even at everywhere. Electrical and Electronic device controlling system is
becoming more and more popular around the world and is becoming a common practice
Electrical and Electronic device automation system becomes important, because it gives the user
the comfortable and easy access to the every devices. The process of Electrical and Electronic
device automation system works by making everything in the house/home and field device
automatically controlled, using technology to control and do the jobs that we would normally do
manually. We can operate our robot from any distant or remote area. It is a wireless robot but
instead of using a separate wireless module (transmitter and receiver) we are using GSM modem
for this purpose. This Gsm modem has advantages over simple wireless robot as it overcomes the
limitations of wireless like limited range, frequency interference etc

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 1


Electrical and Electronic device automation system using cell phone

1.2statement of problem
Many people are always on the move from place to place due to business demands. Some people
can spend a couple of days away from their home leaving all their household appliances without
any kind of monitoring and control. Some devices are left plugged into power sockets whereas
others are supposed to be plugged into and out of power sockets at different intervals depending
on the time of the day. All this requires an individual to manually attend to each of the devices
independently from time to time. All such monitoring and control can be done without
necessarily being around or inside the home or working area. Some devices if not controlled
properly consume a lot of energy which leads to extra expenditure on electricity. Therefore We
propose to design an electrical and electronic device control system using cell phone which will
enable one to remotely manage his/her electrical and electronic device from anywhere, anytime.
And the following are some statement of problem that we encounter during observation

 Have to be at home or a place to operate electrical devices/equipment which is usually


operate daily/frequently
 Different disable or elder people unable or hard to them to operate devices manually.
 Power waste occur s due to bad maintain of electrical device

1.3 Objectives of the project


1.3.1 General objectives
To design, develop and implement electrical and electronic device controlling system using cell
phone.

1.3.2 Specific objectives


The project “Electrical and Electronic device automation system by pic microcontroller” at the
title suggests is aimed to construct a control system that enables the complete control of the
interface on which it is based.

 Turning off/on electrical device with our cell phone


 Cell phone as the remote control for our electrical device
 System gives message acknowledgement for device status
 Allow users to maintain the relevant electric device in either manual way or remote way
 Minimize power and time wastage.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 2


Electrical and Electronic device automation system using cell phone

 To eliminate the need of being physically present in any location for tasks involving the
operation of appliances within a household/office.
 To co-ordinate devices through cell phone.

1.4 Significances of the project


The aim of this project is to control most considerable or frequently used electrical apparatus
from one place and from anywhere through mobile phone. As the scope, it can control (switch on
or off) electrical device from anywhere where GSM technology is available and obtain a
feedback message to aware about operation status. Electrical device is connecting with controller
in wireless way. The project basically based on three themes as low cost, Easy usage and unique
requirement.

1.5 Applications of electrical devices control system

The project can be used for various applications wherever you require control using cell phone.
There are numerous applications of home devices control system. Some of the important
applications are given below:

1. It can be used for home automation system


2. It can be used for remote locations devices control.
3. Security system for home and industry
4. Solar power automatic irrigation system
5. It can also be used to save energy in countries which are victims of energy short falls and
load shedding.
6. Hotel power management
7. street light management
8. home automation
9. load shedding
10. High voltage grid control
11. Industrial automation.
12. Electro, hydraulic and pneumatic valve control.
13. Robotic control and many more

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 3


Electrical and Electronic device automation system using cell phone

1.6 Methodology
A development method may be regarded as a path or a procedure by which the developer
proceeds from a problem of a certain class to a solution of a certain class. A method, to be
worthy of the name, must at least decompose the development task into a number of
reasonably well-defined steps which the developer can take with some confidence that they
are leading to a satisfactory.
Methodology of Electrical and Electronic device automation system involves the
following steps:
ion)

lementation through simulation

1.7 Scope and limitations


SCOPE

Our project consists two parts such as hard ware design and software implementation.
We design the simulation of hardware and we write the c code for this project with the help of
protest software using PIC18F45K22 microcontroller and Micro c pro to write C code for
respectively.

LIMITATIONS
the proposed system only works in the places of good reception of signal and remote areas
where there is no strong GSM signal, the equipment does not respond always There should be
always continuous power supplied to the equipment so that the microcontroller and phone
connected to it works.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 4


Electrical and Electronic device automation system using cell phone

CHAPTER TWO

LITERATURE REVIEW AND RESEARCH OBJECTIVES

2.1 Literature Review:


GSM implies worldwide framework for versatile correspondence. GSM is a global advanced cell
telecommunication. The GSM standard was proposed by ETSI (European Telecommunications
Standard Institute) in 1989. The primary business administrations’ were launched in 1991 and
after its initial presentation in Europe, the standard went worldwide in 1992. From that point
forward GSM has turned into the most broadly embraced and quickly developing advanced
standard, and it is situated to turn into the world's overwhelming cell standard.
Today's third era GSM systems convey excellent and secure versatile voice and information
administrations with full abilities over the world. GSM is a massively fruitful engineering and as
uncommon story of worldwide accomplishment. Since the first GSM system was industrially
launched, it turned into, the world's heading and fastest developing portable standard. The GSM
Association evaluates that advances characterized in the GSM standard serve 80% of the
worldwide portable business, including more than 5 billion individuals crosswise over more than
212 nations and domains, making GSM the most omnipresent of the numerous guidelines for cell
systems.
Today's GSM stage is living, developing and advancing and as of now offers an extended and
characteristic-rich "family" of voice and empowering administrations. The Global System for
Mobile Communication (GSM) system is cell telecommunication system with an adaptable
structural planning following the ETSI Gsm900/GSM 1800 standard. Seimen's usage is the
advanced cell versatile correspondence framework D900/1800/1900 that uses the precise most
recent innovation to meet each prerequisite of the standard.

The literature related to the research topic has been reviewed for last twenty years in order to
find out work carried out by various researchers.
There are many systems for remote monitoring and control designed as commercial products or
experimental research platforms. It is noticed that most of the research carried out belongs to the
following categories

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 5


Electrical and Electronic device automation system using cell phone

a. Internet based Monitoring using Servers, GPRS modems, etc. with different approaches.

b. GSM-SMS protocols using GSM module individually or in combination with Internet


Technologies.

c. Monitoring using Wireless Sensor Networks.

d. Wireless Monitoring using Bluetooth, Wi-Fi, Zigbee and RF.

e. Applications have varied widely like Home Automation, Security Systems, Bio-medical
applications, Agriculture, Environment, Reservoir, Bridge health monitoring, etc.

2.1.1 Major strengths:


1. Exhaustive research has been carried out on Internet based Monitoring scheme with various
protocols and systems providing detailed description of remote process states to the authorized
users.

2. Many remote monitoring systems have been designed and experimented by using GSM-SMS
which normally involved the use of GSM modem for carrying sensing and control of devices in
the system by users having cellular coverage. It is popular because of its unparallel availability
and modest security at the affordable price.

3. Numerous systems have been developed using Wireless Sensor Networks which consists of
several sensor nodes in proximity and having data transmission and reception capability between
nodes and central base station for wide range of applications. Though initial deployment cost
may be high, the operational cost of data communication within the system is negligible.

2.1. 2 Major Weaknesses:


1. Most of systems based on Internet monitoring require higher operational cost based on
bandwidth / data speed requirements and hence is justified only in industrial or biomedical
applications in developing countries. These systems generally do not have alert facilities against
occurrence of abnormal conditions. User needs to have PC / smart phone / PDA with suitable
software support. Security vulnerability is the most striking alert point of Internet. No malicious
party should ever gain control of system. Web usage requires resources like flawless Internet
connections and hosting servers, which may not always fit to the concept of remote controlling.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 6


Electrical and Electronic device automation system using cell phone

2. The development and deployment cost of wireless sensor networks is very high due to need of
motes, sensors, radio transceivers, etc. spread over a large area.
3. It is difficult to upgrade existing conventional control systems with remote control
capabilities.

4. The GSM modem used in cellular based remote monitoring system increases the cost of the
system.

5. The long term operational cost of Internet and cellular monitoring systems is relatively high
due to usage charges incurred in each message transaction.

2.2 Research Objectives:


At a glance:
To design low cost intelligent embedded system based remote monitoring system using
mobile / cell phone.

To provide flexibility to use any cell phone model for remote monitoring.

To incorporate alternative mechanism for communication when messaging fails.

To implement a simple embedded system as a proof of concept.

In depth:
1. Primarily looking at the existing status of research in remote monitoring, major impetus is
only for development of system applications in industrial automation, home automation, health
care systems and defense.

2. With explosive growth of cellular networks in Ethiopia and sharp reduction in cost of handsets
and call charges with coverage of >70% of area, cell phones offer unique opportunity for remote
control even in rural area.

3. The research work presented in this thesis is aimed to remotely monitor the system using cell
phone by designing and implementing embedded system.

4. It is aimed to provide facility to use even any obsolete mobile model having simple messaging
and calling function to make remote system affordable to all categories of users.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 7


Electrical and Electronic device automation system using cell phone

5. The major aspect of the research had been to work out strategies to keep operational cost of
the system minimum to emphasize its utility to automate simple systems with remote monitoring
capabilities.
6. The implementation part of the research has been carried out using range of cell phone models
including one model having non-working display and few prototype systems were developed to
demonstrate the feasibility of the concept.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 8


Electrical and Electronic device automation system using cell phone

CHAPTER THREE

SYSTEM DESIGN AND ANALYSIS


3.1 System block diagram

Cell
phone LCD DISPLAY

GSM Relay Motor


PIC
MODEM
18F45K22

Relay LIGHT

Fig 3.1 system block diagram

The GSM modem receive a message from the most left side is mobile phone which send
information through shot messaging service i.e. SMS to GSM modem. GSM modem receives
information and transfer this information to microcontroller through serial communication. Serial
communication is type of communication in which data transfer bit by bit to microcontroller.
Unlike parallel communication, which transfer all bits at a time. Microcontroller receives data
and makes decision according to program written inside it and after making decisions
microcontroller energize or de-energize relays through relay driver circuits. In other words, it
turns on or turns off home devices. This is how home devices control system works.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 9


Electrical and Electronic device automation system using cell phone

3.2 component of design and system analysis


This section will discuss the design procedure of the SMS based Remote Controller and how it
was implemented. The section is divided into two basic sections; the hardware section and the
software section.
These are further divided into sub-sections.

3.2.1Hardware Section
This section deals with the physical component that was used in SMS Remote Controller. This
section is divided into five sub-sections; the pic microcontroller, GSM modem module, the LCD
module, the appliance module, the control module and the power supply module.

3.2.1.1 Microcontroller
Microcontroller is a small computer on a single integrated circuit containing a processor core or
CPU, memory (ROM &RAM) and programmable I/O peripherals. The projects have been
carried out PIC18F45K22 microcontroller because of the following importance:
is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes
of in-system programmable Flash memory. The device is manufactured using Atmel is high-
density nonvolatile memory technology and is compatible with the industry standard 80C51
instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed
in-system or by a conventional nonvolatile memory programmer.
combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip,
the PIC18F45K22 is a powerful microcontroller which provides a highly-flexible and cost-
effective solution to many embedded control applications. The PIC18F45K22 provides the
following standard features:8K bytes of Flash,256 bytes of R AM, 32 I/O lines, Watchdog timer,
two data pointers, three16-bit timer/counters, a six-vector two-level interrupt architecture, a full
duplex serial port, on-chip oscillator, and clock circuitry. In addition, the PIC18F45K22is
designed with static logic for operation down to zero frequency and supports two software
selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM,
timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode
saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next
interrupt or hardware reset.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 10


Electrical and Electronic device automation system using cell phone

Features of PIC18F45K22 Microcontroller


Compatible with MCS-51 Products
8K Bytes of In system Programmable (ISP) Flash Memory
Endurance: 1000Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation:0Hz to 33 MHz Features ofPIC18F45K22Microcontroller
Compatible with MCS-51 Products
8K Bytes of In system Programmable (ISP) Flash Memory
Endurance: 1000Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation:0Hz to 33 MHz
Three-level Program Memory Lock
256x8 bit Internal RAM
32 Programmable I/O Lines
Three 16-bit Timer/Counters
Eight Interrupt Sources
Full Duplex UART Serial Channel
Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 11


Electrical and Electronic device automation system using cell phone

Figure 3.2 semantic diagram of pic 18f45k22

3.2.1.2 GSM MODEM


A GSM modem is a specialized type of modem which accepts a SIM card, and operates over a
subscription to a mobile operator, just like a mobile phone. From the mobile operator
perspective, a GSM modem looks just like a mobile phone. These GSM modems are most
frequently used to provide mobile internet connectivity, many of them can also be used for
sending and receiving SMS and MMS messages. We have used SIM300 GSM module. It is an
Advanced Low cost modem for wireless GSM communications which includes sending and
receiving text messages. This GSM Modem can accept any GSM network operator SIM card and
act just like a mobile phone with its own unique phone number.

Applications like SMS Control, data transfer, remote control and logging can be developed
easily. The modem can either be connected to PC serial port directly or to any microcontroller. It
can be used to send and receive SMS or make receive voice calls. It can also be used in GPRS
mode to connect to internet and do many applications for data logging and control. This GSM
modem is a highly flexible plug and play quad band GSM modem for direct and easy integration
to RS232 applications.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 12


Electrical and Electronic device automation system using cell phone

Figure 3.2 GSM modem

3.2.1.3 LCD display


Liquid Crystal Display is an electronic device for displaying text or characters. We are using 14
pin LCD. 16*2 represents 16 characters and 2 line display. LCD’s are economical and easily
programmable and can easily display special and custom characters. Pin Description is as
follows:

LCD1
LM016L
VDD
VSS

VEE

RW
RS

D0
D1
D2
D3
D4
D5
D6
D7
E
1
2
3

4
5
6

7
8
9
10
11
12
13
14

Fig 3.3 Liquid Crystal Display

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 13


Electrical and Electronic device automation system using cell phone

Table 2: LCD pin description

3.2.1.4 Relay
A relay is an electrically operated switch and used where it is necessary to control a circuit by a
low power signal (with complete electrical isolation between control and controlled circuits), or
where several circuits must be controlled by one signal. 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".

Components of electro mechanical relay?

Electrical mechanical relay have three main components:

1. Coil
2. spring
3. contacts

A five volt signal at the coil can turn on relay. When coil is energize with 5 volt signal, current
flows through the coil. When current flows through the coil, a magnetic field are created in the
coil which attract causes the armature (contacts) to attract towards spring. When no current flows
through coil, spring causes the contacts to pull towards normal position.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 14


Electrical and Electronic device automation system using cell phone

TRANSISTOR
While transistors have many uses, one of the less known uses by amateurs is the ability for
bipolar transistors to turn things on and off. While there are limitations as to what we can switch
on and off, transistor switches offer lower cost and substantial reliability over conventional
mechanical relays. In this article, we will review the basic principles for transistor switches using
common bipolar transistors.
The most commonly used transistor switch is the NPN. The secret to making a transistor switch
work properly is to get the transistor in a saturation state. For this to happen we need to know the
maximum load current for the device to be turned on and the minimum HFE of the transistor. For
example, if we have a load that requires 100mA of current and a transistor with a minimum HFE
of 100, we can then calculate the minimum base current required to saturate the transistor as
follows:

Minimum base current = 100 mA / 100Minimum

Base current = 1 mA

In actual practice, it is best to calculate about 30% more current than we will need to guarantee
our transistor switch is always saturated. In this case, we will use 1.3mA. We must also select
our supply voltage, so for this example we will use 220volts.

Q1
B 2N1711

Figure 1 Transistor

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 15


Electrical and Electronic device automation system using cell phone

3.2.1.5 Power Supply Unit


Power supply is a very important part of electronic circuit. This circuit required fixed +5 V
supply so to fix this voltage we needed voltage regulator. In this work used 7805 Voltage
regulator which output fixed +5 volt. A voltage regulator generates a fixed output voltage of a
preset magnitude that remains constant regardless of changes to its input voltage or load
conditions.

3.2.1.6 Other Electrical passive element


Capacitor
A capacitor (originally known as a condenser) is a passive two-terminal electrical component
used to store electrical energy temporarily in an electric field. The forms of practical capacitors
vary widely, but all contain at least two electrical conductors (plates) separated by a dielectric
(i.e. an insulator that can store energy by becoming polarized). The conductors can be thin films,
foils or sintered beads of metal or conductive electrolyte, etc. The non conducting dielectric acts
to increase the capacitor's charge capacity. For an appropriate selection of the capacitor as a
filter, the peak value of the ripple voltage must be known. This can be calculated Vp=Vm – Vdc

Figure 2.Capacitor

Resistor
The electrical resistance of an electrical conductor is a measure of the difficulty to pass an
electric current through that conductor. The inverse quantity is electrical conductance, and is the
ease with which an electric current passes. Electrical resistance shares some conceptual parallels
with the notion of mechanical friction. The SI unit of electrical resistance is the ohm (Ω), while
electrical conductance is measured in Siemens (S).

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 16


Electrical and Electronic device automation system using cell phone

Figure 3.Resistor

CRYSTAL OSCILLATOR
A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a
vibrating crystal of piezoelectric material to create an electrical signal with a very precise
frequency. This frequency is commonly used to keep track of time, to provide a stable clock
signal for digital integrated circuits, and to stabilize frequencies for radio transmitters and
receivers. The most common type of piezoelectric resonator used is the quartz crystal, so
oscillator circuits incorporating them became known as crystal oscillators, but other piezoelectric
materials including polycrystalline ceramics are used in similar circuits. Quartz crystals are
manufactured for frequencies from a few tens of kilohertz to hundreds of megahertz.

X1

CRYSTAL

Fig Crystal Oscillator

3.3 semantic diagram of overall system

3.3.1 Circuit Analysis


The system is designed with integration of components mainly PIC microcontroller, transistor as
indicated blow to promote the desired, in a sense controlling electronic device with in a wireless
means. For instance as a user press digit 1 the lamp ON, press 3 to open the door and press 2 for
both appliance to be activated.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 17


Electrical and Electronic device automation system using cell phone

Figure 3.4 semantic diagram of overall system

3.5 working principle of system


From the circuitry above, the diode is connected across the relay (DC terminals), to prevent the
switching transistor from the charge reversal of the relay inductance. Mathematically the values
for R1 and Q1 are justified as soon below.
1. Transistor maximum collector current must be greater than the load current Ic
Recall that, V=IR
Therefore,
𝑉
I=𝑅
𝑠𝑢𝑝𝑝𝑙𝑦 𝑣𝑜𝑙𝑡𝑎𝑔𝑒
Hence, load current =𝑙𝑜𝑎𝑑 𝑟𝑒𝑠𝑖𝑠𝑡𝑎𝑛𝑐𝑒

Where Load current=?


Supply voltage = Relay voltage rating = 12V
Load resistance = Relay resistance = 400 ohms, therefore
From Equation (2),

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 18


Electrical and Electronic device automation system using cell phone
12
Load current = 400=0.03A

2. The transistor minimum current gain hfe must be greater than five times the load current
divided by maximum output current from the drive voltage.

𝑑𝑦!"#$%& ′())∗+,
Hfe> 𝑑𝑥&)−.∗ ′())∗+,

Where load current = 0.03 A


Drive current = output current of ATmega16 = 40 mA, therefore
From equation (4),
5∗0.03
Hfe= 40𝑚𝐴 = 3.75

From the calculations above, a transistor whose maximum collector current Ic is greater than
0.03A and the minimum current gain hfe is greater than 3.75 can be used for switching a 12V,
400 Ohms relay. One of the NPN transistors that satisfied these conditions is 2N2222. The
2N2222 transistor has a maximum collector
current Ic = 0.8A, and the hfe = 300.
3.From equation (5), the base resistor should be equal to the drive voltage multiplied by hfe,
divided by five times the maximum collector current of the switching transistor.

𝑑𝑟𝑖𝑣𝑒 voltage X current gain


Base resistor=5∗maximum collector current

Where drive voltage = PIC 18F45K22 output voltage = 5V


Maximum collector current = maximum collector current for 2N2222 = 0.8A
Current gain = current gain for 2N2222= 300, therefore

5∗300
Base resistor = 5∗0.8 =375ohms

From the calculation above, a resistor whose resistance is greater than 375 Ohm can be used as
the base resistor.

3.5 How to initialize the microcontroller


For initializing the MODEM with microcontroller we need to use mainly 2 terms named as DTE
and DCE.

DTE-Data Terminal Equipment is a piece of hardware device for communication.


3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 19
Electrical and Electronic device automation system using cell phone

DCE-Data Communication Equipment provides the path for communication.

3.5.1 AT Commands
AT commands are instructions used to control a modem. AT is the abbreviation of Attention.
Every command line starts with "AT" or "at". That's why modem commands are called AT
commands. Many of the commands that are used to control wired dial-up modems, such as ATD
(Dial), ATA (Answer), ATH (Hook control) and ATO (Return to online data state), are also
supported by GSM/GPRS modems and mobile phones. Besides this common AT command set,
GSM/GPRS modems and mobile phones support an AT command set that is specific to the GSM
technology, which includes SMS-related commands like AT+CMGS (Send SMS message),
AT+CMSS (Send SMS message from storage), AT+CMGL (List SMS messages) and
AT+CMGR (Read SMS messages).

Table 1 AT command

Instead of sending commands from the HyperTerminal, AT Command are sent to the
GSM/GPRS module by the microcontroller itself. In this case, the receive (Rx) and transmit (Tx)
pin of the GSM module’s RS232 port are connected to the transmit (Tx) and receive (Rx) pin of
PIC18F45K22s serial port, respectively. This eliminated the role of computer and just the
controller’s circuit provides a complete user interface for the module. To enable a computer / PC
to read SMS messages from a message storage area, the GSM/GPRS modem or mobile phone
has to support either of the AT commands +CMGR (command name in text: Read Messages)
and +CMGL (command name in text: List Messages). The +CMGR AT command is used to
read an SMS message at a certain location of the message storage area, while the +CMGL AT

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 20


Electrical and Electronic device automation system using cell phone

command is used to read SMS messages that have a certain status from the message storage area.
The status can be "received unread", "received read", "stored unsent", "stored sent", etc. The
+CMGL AT command also allows you to retrieve all SMS messages stored in the message
storage area. Following is an example for illustrating the difference between +CMGR and
+CMGL. Suppose you want to use your computer / PC to read a text message from the message
storage area and you know the index at which the SMS text message is located. In this case, you
should use the +CMGR AT command. Here is the command line to be typed (assume the SMS
text message is stored at index 3).

AT+CMGR=3
The GSM/GPRS modem or mobile phone should return something like this:
+CMGR: "REC
READ","+85291234567","07/02/18, 00:12:05+32"
Hello, welcome to sms based home automation.
OK

3.5.2 Operation of GSM


AT commands are used by the computers to control modems. Both the GSM modems and dial-
up modems support a fixed set of standard AT commands. GSM modem can be used like a dial-
up modem. Apart from the standard AT commands, GSM modems also support an extended set
of AT commands. These extended set of AT commands are defined in the GSM standards. With
the extended AT commands, several things are done:

number of SMS messages processed by a GSM modem per minute is very low -- only six
to ten SMS messages per minute.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 21


Electrical and Electronic device automation system using cell phone

3.6 Flow chart

start

GSM Initialization

Get hardware and


software

Pull sms from


mobile phone

yes If new sms

Received

Read and check sms

Control the device based


on status

Notify user

Fig 3.5 flow chart of working system

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 22


Electrical and Electronic device automation system using cell phone

CHAPTER IV

RESULT AND DISCUSSION


4.1 Simulation Result
Proteus software has been used for the simulation of the circuit discussed above. we use the
keypad phone,PIC18F45K22 microcontroller is programmed to use as the DTMF decoder in this
case.

4.1.1 Results
This section describes the output of the implemented system. Several testing has been performed
to ensure it’s execution and produce the intended result. The prototype system is designed to
receive SMS from user mobile phone to the mobile phone connected to the PIC18F45K22 circuit
that acts as a GSM modem. This can be performed by dialing the mobile phone number which
has been set in the PIC18F45K22. For security reason, the system is protected with a user
defined password. The incoming message is deleted by the microcontroller upon completing the
requested process, and the message does not longer exist in the connected mobile phone which
acts as GSM modem. The system then replies a message to user mobile phone reporting the
status of the devices (turned ON or turned OFF). The status message is to remind the user
regarding the current state of the appliances.

4.1.2 Lamp Switch OFF Activated


The lamp was switched ON when the GSM modem receives the message from user mobile
phone that order to switch ON the lamp. The lamp is OFF when the user sends a command 2
keypad to turn OFF the lamp. The system reply back to the user to report the extension current
states is OFF

4.1.2 Fan Switch OFF Activated


The door was switched OFF initially when the GSM modem receives the message from user
mobile phone that order to switch ON the door. The door is closed when the user sends a
command 4 keypad to close the door. The system reply back to the user to report the extension
current states is closed.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 23


Electrical and Electronic device automation system using cell phone

Figure 4.1 Simulation initial Result when run we proteuse

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 24


Electrical and Electronic device automation system using cell phone

4.2 Discussion
The prototype works accordingly to automatically switch ON and OFF the extension and lamp
remotely by using SMS. In order to activate the system, power supply 5Vdc is supplied to the
PIC18f45k22 circuit. When the system is activated, the user mobile phone receives the status
report that the system has been activated. The system switches ON and OFF the extension lamp
and the door open and closed, when the user sends password that matches with the password
created for both device. At the same time the user mobile receives the status report the two
devices active.

Figure 4.2 result when both light and door are on state

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 25


Electrical and Electronic device automation system using cell phone

CHAPTER V

CONCLUSION AND RECOMMENDATION


5.1 Conclusion
The project is aimed to design and implement a GSM based wireless control of house hold
electrical appliances. After doing different tests and programming different codes, eventually the
Obliged outcome is put forward. It is a fast and efficient approach to control the devices. This
equipment works anywhere with a great gathering sign. At last the obliged result is attained with
GSM module Sim900based outline for effective and compelling result.
The prototype was successfully developed and met the three stated objectives. The system can
automatically switch ON and OFF the extension and lamp remotely using SMS. The integration
of software and hardware has performed a good task in producing the SMS system. However,
there are several weaknesses had been identified which can be further improved in the future
such as the system could provide better performance by intelligently send notification upon
power failure, provide a flexible function by supporting both manual and automatic control as
well as provide an option for the user to control the appliance through web-based system. In
addition, the system is very practical when the user is away from home due to it can control the
electrical home appliances remotely as long as the mobile phone gets the coverage.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 26


Electrical and Electronic device automation system using cell phone

5.2 Recommendation
The proposed system only works in the places of good reception of signal and remote areas
where there is no strong GSM signal, the equipment does not respond always .There should
be always continuous power supplied to the equipment so that the microcontroller and phone
connected to it works .within a few modification to this project, we recommend that in the
future time this technology will become a more advanced and accessible by every user to use
the system effectively and efficiently.

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 27


Electrical and Electronic device automation system using cell phone

Reference
[1].Richard. H.Barnett, Sarah Cox, Larry o’ cull, Embedded C Programming and the Atmel
AVR, 2nd Edition,
[2] Ahmed M, Farooqui H, J K Pathan, “3G based automation using GSM communication”,
International Journal of Research in Environment Science and Technology.
[3] Mazidi, Muhammad ali, “The 8051 Microcontroller And Embedded Systems Using
Assembly And C”, Pearson Education, September 2007, Second edition.
[4] C. K. Das, M. Sanaullah, H. M. G. Sarower and M. M. Hassan,
[5]. Siemens, (2011), “AT commands set”, online available at:
www.sms666.net/Download/SIEMENS

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 28


Electrical and Electronic device automation system using cell phone

Appendices

Micro c pro code

// Keypad module connections

char keypadPort at PORTB;

// End Keypad module connections

// LCD module connections

sbit LCD_RS at LATC4_bit;

sbit LCD_EN at LATC5_bit;

sbit LCD_D4 at LATC0_bit;

sbit LCD_D5 at LATC1_bit;

sbit LCD_D6 at LATC2_bit;

sbit LCD_D7 at LATC3_bit;

sbit LCD_RS_Direction at TRISC4_bit;

sbit LCD_EN_Direction at TRISC5_bit;

sbit LCD_D4_Direction at TRISC0_bit;

sbit LCD_D5_Direction at TRISC1_bit;

sbit LCD_D6_Direction at TRISC2_bit;

sbit LCD_D7_Direction at TRISC3_bit;

// End LCD module connections

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 29


Electrical and Electronic device automation system using cell phone

#define LAMP PORTD.RD0

#define DOOR PORTD.RD1

#define ENTER 15

#define CLEAR 13

#define ON 1

#define OFF 0

char msg[ ]="WELL COME TO COMPUTER STREAM MINI PROJECT"; // wellcome


message/

char msg0[ ]="THIS IS SMS BASED ELECTRONIC DEVICE CONTROL MOBILE PHONE";

char AT[ ]="AT"; // To initialize mode/

char noecho[ ]="ATE0"; // To stop echo/

char mode_text[ ]="AT+CMGF=1"; // to set text mode/

char char_mode[ ]="AT+CSCS=\"GSM\""; // to set character mode/

char param[ ]="AT+CSMP=17,167,0,0"; // set the parameter of character/

char mobile_no[ ]="AT+CMGS=\"+251946252952\""; //use to set recseinpent number and


mesg/

char terminator=0x1A; // chartacter form of control + z terminator character/

char mesg[ ]=" ONE KEY IS ASSAIGN FOR A DEVICE /n"; // wellcome message/

char msg1[ ]="light is ON state" ;

char msg2[ ]="light is OFF state" ;

char msg3[ ]="fan is ON state" ;

char msg4[ ]="fan is OFF state" ;

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 30


Electrical and Electronic device automation system using cell phone

char msg5[ ]="fan and light are ON state" ;

char msg6[ ]="fan and light are OFF state" ;

char msg7[ ]="PLEASE ENTER THE CORRECT KEY" ;

void send_to_modem(char *s) //function to write anything serially/

while(*s)

UART1_WRITE(*s++);

UART1_WRITE(0X0D);

void send_to_modem1(char *s)

while(*s)

UART1_WRITE(*s++);

void send_sms()

send_to_modem1(mesg);

delay_ms(500);

uart1_write(terminator);

delay_ms(500);

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 31


Electrical and Electronic device automation system using cell phone

void main() {

unsigned short kp,Txt[14];

unsigned short Temp_Ref ; // Reference Temperature

unsigned char inTemp;

unsigned int temp;

float mV, ActualTemp;

Keypad_Init(); // Initialize Keypad

ANSELC = 0; // Configure PORTC as digital I/O

ANSELB = 0; // Configure PORTB as digital I/O

ANSELD = 0; // Configure PORTD as digital I/O

// TRISA0_bit = 1; //Configure AN0 (RA0) as input

TRISC = 0; //PORTC are outputs (LCD)

TRISD0_bit=0; //RD0 is output lamp

TRISD1_bit=0; //RD1 is output door

Lcd_Init(); // Initialize LCD

Lcd_Cmd(_LCD_CLEAR); // Clear display

Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off

Lcd_Out(1, 4, "GSM based");

Lcd_Out(2, 4, " Electrical ");

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 32


Electrical and Electronic device automation system using cell phone

delay_ms(500);

Lcd_Cmd(_LCD_CLEAR); // Clear display

Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off

Lcd_Out(1, 4, " control");

Lcd_Out(2, 4, "system @ JIT");

delay_ms(500); //2s delay

LAMP = OFF;

DOOR = OFF;

UART1_INIT(9600);

send_to_modem(msg);

delay_ms(1000);

send_to_modem(msg0);

delay_ms(1000);

send_to_modem(AT);

delay_ms(1000);

send_to_modem(noecho);

delay_ms(1000);

send_to_modem(mode_text);

delay_ms(1000);

send_to_modem(mobile_no);

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 33


Electrical and Electronic device automation system using cell phone

delay_ms(1000);

send_sms();

//ON startup, read the Referance Temperature from the Keypad

START:

Lcd_Cmd(_LCD_CLEAR); // Clear display

Lcd_Out(1, 1, "Enter NUMBER");

Temp_Ref=0;

kp=0;

Lcd_Out(2, 1, "value: ");

while(1)

do

kp = Keypad_Key_Click(); // Store key code in kp variable

while (!kp);

if ( kp == ENTER )break;

if (kp > 6 && kp < 8) {kp = kp-1;

Lcd_Cmd(_LCD_CLEAR); // Clear display

Lcd_Out(1, 1, "key U press: ");

goto START; }

if (kp > 8 && kp < 12) kp = kp-2;

if (kp ==14)kp = 0;

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 34


Electrical and Electronic device automation system using cell phone

if ( kp == CLEAR )goto START;

Lcd_Chr_Cp(kp + '0');

Temp_Ref =(10*Temp_Ref) + kp;

Lcd_Cmd(_LCD_CLEAR); // Clear display

Lcd_Out(1, 1, " Press #: ");

intToStr( Temp_Ref,Txt); //Convert to String

inTemp=kp;

Lcd_Out_CP(inTemp); //Display Ref Temp

Lcd_Out(2, 1, " to Confirim.");

//Wait until # is pressed

kp =0;

while(kp!=ENTER)

do

kp = Keypad_Key_Click(); // Store key code in kp variable

while(!kp);

Lcd_Out(1, 1, " key isnot ");

Lcd_Out(2, 1, " confirmed.");

// Lcd_Cmd(_LCD_CLEAR); // Clear display

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 35


Electrical and Electronic device automation system using cell phone

//Lcd_Out(1, 1, "Temp ");

// Display "C" for Celsius

//Program loop

while(1) {

//Display Referance Temperature and Actual Temperature

//Compare ref temp with actual emp

if (Temp_Ref==1 ) //If Temp Ref is less than actual Temp, Switch ON Heater

LAMP = ON;

uart1_write(terminator);

delay_ms(500);

Lcd_Out(1, 1, " The Light is ");

Lcd_Out(2, 1, " On state");

delay_ms(2000);

send_to_modem(msg1);

delay_ms(500);

uart1_write(terminator);

delay_ms(500);

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 36


Electrical and Electronic device automation system using cell phone

goto START;

else if (Temp_Ref==2 ) //If Temp Ref is less than actual Temp, Switch ON Heater

LAMP = OFF;

Lcd_Out(1, 1, " The Light is ");

Lcd_Out(2, 1, " OFF state");

delay_ms(2000);

send_to_modem(msg2);

delay_ms(500);

goto START;

else if (Temp_Ref==8) //If Temp Ref is greater than actual Temp, Switch ON Fan

LAMP = ON;

DOOR = ON;

Lcd_Out(1, 1, " fan and lamp ");

Lcd_Out(2, 1, " are Opened ");

delay_ms(2000);

send_to_modem(msg5);

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 37


Electrical and Electronic device automation system using cell phone

delay_ms(500);

goto START;

else if (Temp_Ref==6) //If Temp Ref is greater than actual Temp, Switch ON Fan

LAMP = OFF;

DOOR = OFF;

Lcd_Out(1, 1, " fan and lamp ");

Lcd_Out(2, 1, " OFF state ");

delay_ms(2000);

send_to_modem(msg6);

delay_ms(500);

goto START;

else if (Temp_Ref==3 ) //If Temp Ref is less than actual Temp, Switch ON Heater

DOOR = ON;

Lcd_Out(1, 1, " The fan is ");

Lcd_Out(2, 1, " Opened ");

delay_ms(2000);

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 38


Electrical and Electronic device automation system using cell phone

send_to_modem(msg3);

delay_ms(500);

goto START;

else if (Temp_Ref==5 ) //If Temp Ref is less than actual Temp, Switch ON Heater

DOOR = OFF;

Lcd_Out(1, 1, " The fan is ");

Lcd_Out(2, 1, " Off ");

delay_ms(2000);

send_to_modem(msg4);

delay_ms(500);

goto START;

else {

Lcd_Out(1, 1, "please Enter ");

Lcd_Out(2, 1, "correct key ");

delay_ms(2000);

send_to_modem(msg7);

delay_ms(500);

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 39


Electrical and Electronic device automation system using cell phone

goto START;

Delay_ms(1000); //Wait 1s then repeat

Curriculum Vitae

3RD Year PROJECT, SHCOOL OF ECE JIT, JU JIMMA ETHIOPA Page 40

You might also like