Chellphone Based Home Automation Project
Chellphone Based Home Automation Project
Chellphone Based Home Automation Project
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.
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.
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
Acronym
CHAPTER ONE
INTRODUCTION
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
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
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.
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.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)
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.
CHAPTER TWO
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
a. Internet based Monitoring using Servers, GPRS modems, etc. with different approaches.
e. Applications have varied widely like Home Automation, Security Systems, Bio-medical
applications, Agriculture, Environment, Reservoir, Bridge health monitoring, etc.
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. 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.
To provide flexibility to use any cell phone model for remote monitoring.
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.
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.
CHAPTER THREE
Cell
phone LCD DISPLAY
Relay LIGHT
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.
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.
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.
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
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".
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.
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:
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
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).
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
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> 𝑑𝑥&)−.∗ ′())∗+,
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.
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.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
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
number of SMS messages processed by a GSM modem per minute is very low -- only six
to ten SMS messages per minute.
start
GSM Initialization
Received
Notify user
CHAPTER IV
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.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
CHAPTER V
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.
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
Appendices
#define ENTER 15
#define CLEAR 13
#define ON 1
#define OFF 0
char msg0[ ]="THIS IS SMS BASED ELECTRONIC DEVICE CONTROL MOBILE PHONE";
char mesg[ ]=" ONE KEY IS ASSAIGN FOR A DEVICE /n"; // wellcome message/
while(*s)
UART1_WRITE(*s++);
UART1_WRITE(0X0D);
while(*s)
UART1_WRITE(*s++);
void send_sms()
send_to_modem1(mesg);
delay_ms(500);
uart1_write(terminator);
delay_ms(500);
void main() {
delay_ms(500);
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);
delay_ms(1000);
send_sms();
START:
Temp_Ref=0;
kp=0;
while(1)
do
while (!kp);
if ( kp == ENTER )break;
goto START; }
if (kp ==14)kp = 0;
Lcd_Chr_Cp(kp + '0');
inTemp=kp;
kp =0;
while(kp!=ENTER)
do
while(!kp);
//Program loop
while(1) {
if (Temp_Ref==1 ) //If Temp Ref is less than actual Temp, Switch ON Heater
LAMP = ON;
uart1_write(terminator);
delay_ms(500);
delay_ms(2000);
send_to_modem(msg1);
delay_ms(500);
uart1_write(terminator);
delay_ms(500);
goto START;
else if (Temp_Ref==2 ) //If Temp Ref is less than actual Temp, Switch ON Heater
LAMP = OFF;
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;
delay_ms(2000);
send_to_modem(msg5);
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;
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;
delay_ms(2000);
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;
delay_ms(2000);
send_to_modem(msg4);
delay_ms(500);
goto START;
else {
delay_ms(2000);
send_to_modem(msg7);
delay_ms(500);
goto START;
Curriculum Vitae