Sunteți pe pagina 1din 8

Friendly Home Automation System Using Cell Phone

and J2ME with Feedback Instant Voice Messages

Mahmoud shaker Nasr Fahtha H. A.salem Azwai


Department of electrical and engineering Abdulminem riadh center training
University of Garyounis General Public Committee for Training and Employment
Benghazi, Libya Benghazi, Libya
e-mail : mahmoud111957@garyounis.edu e-mail: rawaa2006@ garyounis.edu

Abstract - This paper introduces a friendly system to control more and more available, affordable and interesting to the
the home appliances remotely by the use of mobile cell wider public. What once was not far from novelty products,
phones; this system is well known as "Home Automation like the "Clapper" that switches the lights on by the clap of
System" (HAS). your hands, is now becoming an important factors of utility,
The designed system covers the most important required
convenience and usability in modern houses. These factors
factors in home automation system such as flexibility, are added to the already substantial possibilities of
security, easy to use, the ability to feedback information to entertainment and security created by home automation[1].
the client immediately, … etc. Accessibility aspects of home automation also became more
acceptable, considering the current demographical shift in
The presented system uses the J2ME language to program the western world, which will create an increased demand
the client mobile which sends information to the service for accessibility in homes and possibly for related facilities
mobile and this controls the operation of the appliances via a such as remote health monitoring.
PIC microcontroller which connected to it and programmed
The problem of HAS is that, these systems are not always
in such a way that introduces the main characteristics of the
system. Optocoupler and static power switch (TRAIC) are fully accepted by ultimate users, especially the old and
used as the interface devices between the PIC and the home disable, arguable the ones that need it the most. It is the goal
appliances. of researchers to find out how to introduce home automation
into our lives so as to only affect us positively. As an
The proposed HAS in this paper is implemented practically, example, that effort to make system usable and affordable
tested and gave the correct and expected results. by any user helped the user of old, cheap, and simple
technologies like the use of mobile cell phones and the
exploitage of the available mobile network to transfer data
Key words: HAS, Home Automation, DTMF, PIC Microcontroller,
J2ME, Voice Message Feedback.
from anywhere site client in order to remote control the
home appliances at anywhere site all over the world.
I. INTRODUCTION Another example is the use of X-10 protocol to transmit
data to home network. The X-10 technology has also many
The idea of home automation system (HAS) has been advantages to control the home appliances [3].
implemented for some years. It began with the concept of The main parameters by which the HAS can be estimated
domotic which is the combination of computer application and are: interoperability (the capability of devices of different
robot technology. In other words, it is the control of home types and from different manufactures to communicate and
appliances by means of a computer [4]. Then the concept is cooperate), scalability, security, availability, usability,
developed to a modern one, it is talking about the interaction existence of multiple standards, simplicity, the ability to
of technologies and services applied to different buildings feedback information to the client, friendly, and flexibility.
with the purpose of increasing security, comfort, These represent a good reasons which call the attention of
communication, and energy saving. companies to enter quickly this emerging market, also they
Home automation technology, although not yet as widely represent a great research opportunity in creating new fields
adopted in most part of the world as in the US, is becoming

Mahmoud Sh. Nasr is associate professor with the


department of electrical and electronic engineering,
university of garyounis, Benghazi, Libya, (e-mail:
mahmoud111957@ garyounis.edu).

978-1-4244-3806-8/09/$25.00 © 2009 IEEE 531


in engineering, architecture, communication, and control, so 14. Working at convention home power and need no
HASs are becoming popular. specific electrical network.
The presented paper introduces a friendly HAS that complies 15. The system is nonvolatile; that means information of
the mentioned parameters using two mobile cell phones (client appliance status and new password aren’t lost if home
and server). The client cell phone is the master and contains power is off.
the main menu of the HAS which is programmed by J2ME
language. The server cell phone (situated in the home) to
which the controller is connected which controls the operation
of the home appliances. The controller consists of a DTMF III. SYSTEM ARCHITECTURE
(Dual Tone Multiple Frequency) and a PIC microcontroller. The system architecture of the proposed HAS in this paper
The interfacing circuit consists of an optocoupler and a static can be explained according to the block diagram shown in
power switch (TRIAC). figure (1). The system mainly consists of two cell phones
one remote cell phone which called Master cell phone
(client) which controls the operation of the remote home
II. SYSTEM FEATURES appliances, this cell phone contains the main menu which it
The system considered in the present paper introduces the is programmed via J2ME language; and the other home cell
following features: phone which called server phone because it is fixed in home
server controller board.
1. Visual Menu of home appliances the user see all appliances This system allows a user to control and communicate
he want to control and operation instructions on the mobile with home appliances by programming cell phone and built
phone screen by J2ME software. in the mentioned several features.
2. The system allows the user to control (On or off) nine of The home appliances are controlled by the home server
home appliances and can be expanded to 22 without adding phone, which operates according to the user commands
any component (depending on the microcontroller received from the master phone via the server phone. The
programming). control circuit which is connected to the home server phone
3. Controlling a high voltage device. consists mainly : DTMF decoder, microcontroller,
4. Knowing the devices present state (On or off) at any time interface& isolation circuit and voice message feed back
with voice message. circuit.
5. Knowing if the home AC main power is off via voice
message.
6. The system will communicate with user, and gives IV. SYSTEM OPERATION
information about device's state after controlling (on or off) The system operation procedure can be summarized as
with voice message. follows:
7. Any phone number can't access the home server by calling
the server number, only the specify numbers will be Once the user (the commander) (client) dials the server
answered, the specify numbers are of user choice. This phone number, the server phone answers automatically
feature has been added in the presented HAS for security. (open the line automatically), then the user can control the
8. Can add multi users to control this system this feature refer operation state of home appliances according to the
to user choice. following successive steps after the line opened:
9. Server cell phone can be used for normal use without any
effect in the home system, the system give ability of 1. Enter the required password.
changing the server number by an option in the menu of 2. Enter "0" followed by the number of a specific home
master phone. appliance to know the present state of such appliances.
10. Server has a password at least 4 digits long and can be 3. Enter "#" followed by the number of a specific home
increasing by the user. appliance to change the present state from "Off" to
11. The controller will close the line automatically after "On" and vice versa.
entering three wrong passwords. 4. Enter "*" followed by the new password the password
12. The Capability of changing the server password by user will changed.
remotely at any times. 5. All the control states are feedback to the user by means
13. If there is no keypad pressed for more than 30 seconds, of voice messages.
the controller closes the line automatically. This feature for
don’t keep the telephone line busy for unwanted reasons,
this feature save user money

532
Home server controller
GSM
AC
Main

DTMF Micro Power


decoder Controller driver
&isolator

Master Server
Voice message
phone cell phone

Figure 1. Block diagram of over all system design.

optimized for small devices such as mobile phones. Most


V. SYSTEM COMPONENTS phone manufacturers have made a strong commitment to
Referring to figure (1) the system consists of the following Java phone deployment. Tens of millions of Java-enabled
components, namely; phones are already in consumers’ hands with the ability to
a. Master cell phone, which contains the main menu. add capabilities to their phones without having to purchase
b. Server cell phone. new ones. Although J2ME is not the only language
c. Control circuit. deployed on phones, it is an industry standard backed by
many manufacturers and therefore offers a large and
a) The master phone serves as a remote control device through growing installed base. It is a natural choice for mobile
which a user can interact with the home automation system. application development.
User friendly graphical user interface is provided on the
mobile phone through applications developed in Java We used call phone procedure of connection between two
programming language, which carries out the task of cell phones; it allows control and interface better than SMS
operating and checking sequence of home appliances. or WAP in feedback and information about the present state
The required application (menu) is designed using J2ME of each devices before given order.
language since J2ME characterized by the following main
advantages:[2] The software functions are make connection (call phone)
• The portability of Java ensures that applications with home phone and show the home appliances sequence
developed in Java language are portable across and number of each device which is used in the control
different mobiles from different manufacturers. order. Figure (2) shows an example of programming of the
• Since Java has a rich library of application program master cell phone.
interfaces (API) providing functions such as graphical
user interface, sending and receiving SMS messages, b) The server cell phone, this phone resides in the home
and communicating via GPRS, etc, which receive the call from the master phone and to which
the control system is connected.
• Java applications for mobile phones can be easily
c) The control circuit is the heart of the HAS and as we said
developed by using Java development tools commonly
earlier is connected to server cell phone, this home server
known as development environment.[1].
communicates with the mobile phone via GSM network and
• Most mobile phone manufactures provide their
call phone, at this call phone the user will send DTMF tones
respective handset emulators for developers to test their
by pressing the mobile keypad these tones pass through ear
applications on before testing on real phones.
phone to DTMF decoder that decode the DTMF tones in to
binary code.
The software of cell phone in our case is J2ME (Sun’s Java 2
Platform Micro Edition) is a form of the Java language that is

533
The DTMF outputs will be connected to the miicrocontroller to The CM8870/70C’s internal architectture consists of a band
allow action to be taken corresponding to the rreceived DTMF split filter section which separates thee high and low tones of
tone. The DTMF tones will produce vvarying outputs the received pair, followed by a dig gital decode (counting)
depending on the keys pressed by thhe user. The section which verifies both the frequ uency and duration of
microcontroller will use this information to determine and the received tones before passing the resultant 4-bit code to
validate the sequence of keys entered by the usser. the output bus.
The microcontroller programming will executte this sequence In a single-ended configuration, the in nput pins are connected
information as output order to power driver circuit or voice as shown in figure (3). The inteernal clock circuit is
message unit. completed with the addition of a staandard television color
The control system consists of the following coomponents: burst crystal or ceramic resonator having a resonant
frequency of 3.579545 MHz.
1. DTMF Really there are also two important pins of a DTMF,
Dual Tone Multiple Frequency (DTMF) , tthe DTMF is a a. The TOE (pin 10): (Tri-State outtput enable) pin is an
decoder when any key on the cell phone iss pressed a two active low input used to disable/enablle the output latch. The
different frequencies are generated, the DTM MF detects these TOE pin will be connected to ground d in disable the output
frequencies and decode a four digits latchedd output whose with high impedance, it is useful in caase of unwanted output
value depends on the pressed key. For examplee, if bottom "1" code, and connect to VDD in order to o have the output latch
is pressed on the keypad the DTMF decoder output is 0001, if enabled at all times.
bottom "9" is pressed the decoder output is 1001 and so b. The STD signal (pin 15): this signaal goes high during the
on.[5] time any valid key is pressed, if the key
k is released the STD
The presented system uses the CM8870 DTM MF decoder to goes low, this signal is using in the prresented system; to tell
allow the system to decode the DTMF signals sent by the user a microcontroller that the key is pressing and DTMF tone
through server cell phone in to binary code, theese digital codes are transmitting and the output latch h has been updated, at
fed to microcontroller input. The CM88770/70C DTMF this time a microcontroller read the daata.
integrated receiver provides the design engineer with not only
low power consumption its Less than 35mW power 2. PIC Microcontroller
consumption, Uses quartz crystal or ceram mic resonators, The microcontroller is the main unit in presented design, it
Adjustable acquisition and release times, 18-piin DIP ( refer to takes the sequence order code from m DTMF decoder and
figure (3)), Power down mode, Buffered OSC3 output (PLCC translates it as programming to output devices for
package only) and by grounding pins 5 annd 6, but high controlling (on-off) or read the preesent state, check the
performance in a small 18-pin DIP, SOIC, oor 20-pin PLCC password and change it also control the
t voice messages, i.e
package configuration. by PIC microcontroller all the featuress of the presented HAS
are provided. We use pic16f877A whose w pin diagram is
shown in figure (4).

Figure 3. DTMF pin diagram and


a connection.

Figure 2. Shows one stage of programming the masterr cell phone.

534
3. Feedback circuit (voice messages) (ISD2560).
As mention in the features that presented in this paper, the
voice messages will play back to the user at different states.
The circuit which feeds back (or give) the necessary
information to the user is isd2500 series, we used ISD2560
for our design. The feedback information is a voice
messages in Arabic language, of course it is simple to
record the necessary messages in any desired language. The
recorded messages are:
"wrong data entering" if any wrong data is entered, "the
apparatus in on state" if the apparatus is in on-state, "the
apparatus is changed to on state" if the apparatus state is
changed from off to on, "the AC power if off" if there is no
electrical current in the house, "the apparatus in off state" if
the apparatus is in off-state, "the apparatus is changed to off
state" if the apparatus state is changed from on to off.
These voice messages are recorded and then playback a
Figure 4. Shows the pin configuration for the PIC16F887. specific message at the required instant, to do that we must
consider the addressing of ISD2560 to parted 60 sec of ISD
The most important issue when using the PIC is the port in to 6 messages each message 3 second (3/0.1=30) (since
configuration. The port functions are configured by writing the resolution of 2SD260 is 0.1) the address is at 30 but we
data into specific internal registers that called TRIS, in our choose 32 in order to decrease the addressing lines to 3
design we use ports as following: only, the messages addresses are shown in table (1) while
figure (6) shows the pin diagram and connection circuit of
PortC: as an input that connects to DTMF output. ISD2560.[10]
PortD: as an output that connects to power isolation circuit, Then, the voice circuit needs only 3 lines (A5,A6, & A7) for
which interface between microcontroller and home messages addressing and required only 2 lines to control the
appliances. ISD2560 mode of operation (PD and CE ) these lines are
PortB: as an output that connects to voice message circuit
tied from the microcontroller. The procedure of controlling
(ISD2560) divided in to the control order of ISD and message
the play back of the voice messages is as follows:
address.
1. P/R should be always high in play back voice messages,
PortE connects to led to mentoring each part.
we can connect it to Vcc at all the time, in our case this
Figure (5) shows the port construction circuit of
controlled pin don’t need a specific line from
microcontroller in addition to oscillator circuit.
microcontroller.
2. CE pulse low to Playback starts, this pulsed are given
from microcontroller output.
3. The PD pin should be LOW, during the message play
back after that it should active high to Stop/Reset, also
taken from microcontroller output line.

TABLE (1) SHOWS THE MESSAGE ADDRESSING OF ISD2560 OF 6


MESSAGES (3.2SEC) TIME DURATION

Msg. A7 A6 A5 Msg.
No. Addr Duration
(sec)
1 00 0 0 0 0 Æ <3.2
2 32 0 0 1 3.2 Æ 6.4
3 64 0 1 0 6.4Æ <9.6
4 96 0 1 1 9.6Æ <12.8
5 128 1 0 0 12.8Æ < 16
6 160 1 0 1 16 Æ < 16.2

Figure 5. Shows the connection of microcontroller.

535
VI. OVERALL SYSTEM DESIGN
Figure (7) shows the flowchart of the main program of the
HAS presented in this paper.
The PIC will be programmed using the PIC ProBasic
complier The IDE allows the PIC to be programmed using a
high level language. The code is compiled into a compatible
HEX file and then burned to the PIC. The device used to
“burn” the PIC is the winpic programming.

The following procedure of the PIC programming is


realized.
1. Initialize the ports as: (port C) is an input and (port D,
port A, Port E) are output.
2. Initialize the ports as: (port C) is an input and (port D,
port A, Port E) are output.
3. The program waits until the user presses any keypad and
Figure 6. ISD2560 pin diagram and connection circuit.
releases it.
4. At this time the microcontroller will read the input code
from port C, which connect to the DTMF output.
One can refer to ISD2560 data sheet for more details about its 5. The programming will looped around the two last steps,
addressing and operation. until 4 digit codes will input (the password), then
There is another solution for messages recording and playback compared these input codes with the password stored in
is the use of MP3 player instead of ISD2560. EPROM, to check the user.
4. Power Isolation circuit 6. If the 4 entered digits aren’t correct the program will go
Power isolation circuit provides the electrical isolation back to check password this step repeats only three times
between the microcontroller and the power circuit (home after that will disconnect the call phone by send pulse
appliance) in addition to protect the microcontroller from from RA5 in port A to server cell phone.
damage in case of any faulty operation of appliance. 7. If the 4 entered digit are correct the program will go to
Optocoupler is a proper device to realize the required goal; state_action (label in program) and run out the procedure
because it works by photon sense there are no any connection of program (change the state or read the state or change
between high voltage side and low voltage side, in the the password).
presented system 4N25 optocoupler is used.
The control signal which comes from microcontroller to
control the appliances is applied to the photodiode of the
optocoupler which bias the photo transistor to make the
connection of high voltage
After that we need the driving circuit to increase the current
for correct operation of the gate of triac circuit. The transistor
type NPN TIP121 is used.

5. Static power switches


TRIACs are widely used in AC power control applications,
They are able to switch high voltages and high levels of
current, and over both parts of AC waveform [9]. This makes
TRIAC circuits ideal for use in a variety of applications where
power switching is needed. One particular use of a TRIAC
circuits in domestic appliances on/off and control of ac
motors. In addition, in most applications TRIAC overcomes
the main problems of the use of electromagnetic relays and
contactors in spite of it is simple to control its operation
comparing with TRIAC which requires an additional
electronic circuit to control it. TRIAC TIC246D is used in this
Figure 7. Flowchart of the main program of proposed HAS.
system.

536
8. The procedure is as follows: flexibility, security, friendly, in addition to the existence of
• if user presses '0' it means that read the present state, feedback on line messages to inform the master about the
the program will wait until user presses the number of state of the system and the appliances.
device which want to read the state, and the program
will read the (output port state) and check it if the
specify pin of this device is low or high, if its low the VIII. REFERENCES.
program will goes to off present message subroutine [1] [1] Van Der Werff, M. Gui, X. Xu, W.L. Massey Univ.,
which play back the voice message of this case, and it Palmerston North, New Zealand "A Mobile-based home
automation system" IEEE,2006.
is the same in case of high state the voice message of
ON present state will be playback. These message is [2] [2] Julio Sanchez, Maria P. Canton, "JAVA Programming for
Engineers", CRC Press LLC, Printed in the United States of
controlled by send the specific order from portA to America, © 2002
ISD2560. [3] [3] Jason Chiang-"Cell Phone Security System", Cornell
• If user presses '#' it means that change the present state. University-May 2006
the program will wait until user presses the number of [4] Computer Automation Technology, Inc. "Discussion about
device which want to change its state, after that the DTMF decoding"; Fort Lauderdale, Florida.
program change a specific pin's state, At this time the [5] [5] David P. Marchetti, Eric White, Aaron Sanford "DTMF
Automated Door System", School of Electrical Engineering and
On_done message and Off_done message will be play Computer Science, University of Central Florida, Orlando,
back by send specify order from port A to ISD2560. Florida ; May 2007
• If user presses '*' it means that change the password, [6] [6] Sid Katzen, The Quintessential PIC Microcontroller,
the program will stored the four entered digit after Engineering – Monograph (English), 2000, Springer-Verlag,
the"*" in EEPROM in specific location of password. [7] [7] Microcontroller Programming The Micro-chip PIC, Julio
Sanchez, Maria P. Canton, CRC Press, Boca Raton London New
9. After each step from a preview step the program will back York, 2007.
to state-action label and wait next entered. [8] [8] PIC micro MCU C® An introduction to programming
10. During call, the program is waiting until any key is The Microchip PIC in C By Nigel Gardner, Copyright® Bluebird
pressed, the counter will count the time if it exceeding 30 Electronics 2002, USA.
second the system will disconnect the call phone by send [9] [9 ] Issa Batarseh, " Power Electronic Circuits", Jone Wiley and
pulse from RA5 in port A to server cell phone. Sons, Inc © 2004.
[10] [10] Winbond electronic corp. " Single-chip, multi messages
voice record/playback device IDS-60,75,90, & 120 seconds
Figure (8) shows the detail of overall circuit of the proposed duration, may 2003, USA.
HAS.

VII. CONCLUSIONS
The presented HAS in this paper is realized practically, tested
for multi modes of operation and gave an excellent control of
the home appliances under test. The system presented in this
paper introduced a friendly system to control the home
appliances remotely by the use of mobile cell phones. The
proposed system is characterized by its grand features
required for the modern home automation system such as

537
Figure 8. Overall circuit diagram of the proposed HAS.

538

S-ar putea să vă placă și