Professional Documents
Culture Documents
Automatic Door Lock System PDF
Automatic Door Lock System PDF
A report submitted in fulfillment of the requirements for the award of the degree of
Bachelor of Electrical Engineering (Control and Instrumentation)
APRIL 2008
iii
ACKNOWLEDGEMENT
First of all I would like to thank a lot to my supervisor Prof. Dr. Ruzairi b Hj
Abd Rahim for his guidance and his kindness to me in order to do this project for PSM 1
and PSM 2.
Next I would like to thanks to my family members especially mom and dad
for giving me a good advice, support and idea throughout this project. Also to my
friends that helps a lot to finish this project.
iv
ABSTRACT
Nowadays people are not very concern about safety of their premises. For an
example the lecture room in the universities is not safety enough because no safety
procedures taken and the intruder easy to stole the valuable thing in the lecture room.
The project that was built consists of hardware and software development. The project
will have locking system that will activate by sending the right SMS (Short Messaging
System) to the system. The users in this case are the lecturers who will have their
priority to open the lecture room before start their lecture. Besides, this project will use
the microcontroller in order to interface or communicate between the input signal and
door lock circuit.
TABLE OF CONTENT
CHAPTER
TITLE
PAGE
Supervisor Certification
Declaration
ii
Acknowledgement
iii
Abstract
iv
Table of Content
List of Tables
vii
List of Figures
viii
INTRODUCTION
1.1
Communication
1.2 Mobile Phone
1.6 Objectives
1.7.1 Software
1.7.2 Hardware
II
2.0
LITERATURE REVIEW
vi
2.0.1 PARADOX Security System
10
11
12
2.1
13
2.2
14
2.3 Microcontroller
2.4
III
IV
16
16
17
METHODOLOGY
3.1 Project methodology
20
20
21
23
24
25
25
27
3.9 THRSim11
28
3.10 HCLOAD
32
34
37
39
3.14 AT-Commands
43
44
45
45
46
47
vii
4.0.4 Relay Circuit
48
49
50
4.1 Discussion
4.1.0 Obstacles Encountered
50
51
52
53
References
54
Appendices
55
viii
LIST OF TABLES
TABLE NO.
TITLE
PAGE
15
List of Components
28
RS-232 Specification
48
ix
LIST OF FIGURES
FIGURE NO.
TITLE
PAGE
2.0
10
2.1
11
2.2
SUPA System
12
2.3
13
2.4
14
2.5
PIC16F84A Microcontroller
16
2.6
17
3.0
21
3.1
22
3.2
23
3.3
23
3.4
24
3.5
25
3.6
Project Overview
26
3.7
Front View
26
3.8
Left view
27
3.9
Top View
27
3.10
THRSim11 Simulator
29
3.11
29
3.12
Serial Transmitter
30
3.13
31
3.14
32
3.15
HCLOAD
33
3.16
34
3.17
35
3.18
35
3.19
36
3.20
38
3.21
38
4.0
46
4.1
Microcontroller Circuit
46
4.2
Relay circuit
49
4.3
Project Prototype
49
CHAPTER I
INTRODUCTION
1.0
INTRODUCTION
Second generation cellular phone next were introduced in the early 1990.This
generation use the digital modulation and have an improvement on spectral efficiency
as well as voice quality. However this second generation still uses the same features as
first generation technologies.
Years after years, voice communication using the mobile phone was not very
economical because of the rate of the time taken to finish the conversation between two
people. New technologies coming where it only use low cost for the user when using
this technology. The technology is known short messaging system (SMS).This
technology not only provide user to communicate wit each other but short messaging
system can be implemented by many ways. One of the uses of the short messaging is to
on or locks devices using this technologies.
This project will use an SMS or text messaging to open the lecture room door.
The lecturers can open the lecture room door by sending a text messages to the system.
The system will identify and check it for the safety purposes. The system receiver will
act as a SMS receiver. Hand phone model Sony Ericsson K700i was used for the
receiver. After that, the microcontroller will read the signal and verify the signal
whether it is the right person or not to open the door. If the right person sends the SMS,
then it will activate the door lock circuit. If the SMS is not from authorized person then
it will not open the door.
The door lock circuit is design based on the electromagnetic principle. It will
have the magnetic core and change to a magnet when power supply is feed to it. This
magnet will act as a locking part of the door. Besides the safety measures is take into
account. The door will always lock at all time. It will automatic open if anyone send the
right SMS to the system. The door will open for a certain delay and the user must close
the door within this time.
Sony Ericsson
(K700i)
MICROCONTROLLER
1.1
Wireless means that the electrical and electronic operation which done without
the use of hard wired connection. Wireless communication is the transfer of information
over a distance without the use of electrical conductors or "wires". [1] (source: Wireless
communication wikipedia).Wireless communication is a part of the telecommunication.
There are many types of wireless communication such as GSM, GPRS, and EDGE, IS95, UMTS, IMT2000, DECT, IEEE 802.11, Bluetooth and several multiple access
techniques such as MC-CDMA, W-CDMA and OFDM.
1.2
Mobile Phone
The very first mobile telephony service was in Sweden. It was a form of radio
telephony tested by the Swedish police for used in police cruisers. This form of radio
telephone is a two-way radio which is still widely used in taxi and police cruisers. The
first commercial mobile phone system (also known as network system or system
operator) was launched in Japan in 1979. The second mobile phone system was
established in 1981 later in United States. In the late 1980s, along with the
commercialized mobile phone system, the mobile phone industry started to develop
rapidly and attracting more users to use mobile phones.
1.3
SMS Definition
SMS stands for Short Messaging Service often called text messaging that is a
service for sending messages of up to 160 characters from and to mobile phones that
have the Global System of Mobile (GSM).GSM and SMS service are available in US,
Europe and Asia as well. This system is similar to paging system. The difference is
person who want to send their messages do not worry about the range and where is the
receiver is. They just send their messages through their mobile and wait for the other
person to receive the messages. The person who is received the messages can received
the message sending by the sender when he or she open the mobile phone. In other
words we do not have to activate our mobile phone and be at certain range to receive a
message. The messages will receive automatically if we activate our mobile phone.
1.4
History of SMS
In 1980, the idea to enhance the usage of mobile phone was suggest by the
expertise from several of those communities in the discussion which the GSM service
should be. Early in February 1985 after discussed with the subgroup of GSM, Chairman
J. Audestad state that SMS was considered in the main GSM group of a possible service
for the new digital cellular system. Also from the discussion concluded in the
recommendation GSM 02.03 TeleService supported by a GSM PLMN there are
several things that have been concluded that are Short Messaging System Terminated
(SMS-MT) is the ability of a network to transmit a short message to a mobile phone.
The message can be sent by phone or software application. Next Short Message
Originated (SMS-O) is the ability of a network to transmit a short message sent by a
mobile phone. The message also can be sent to a mobile phone and software
application.
1.5
Problem Statement
The safety in the lecture room is quite crucial because lack of safety awareness
among the student and the staff. Besides the traditional method door that used a key can
be easily open by not authorized person or burglar if they have the right key. This will
allows them to steal the entire valuable thing in the lecture room. Besides that,
sometimes students cannot enter the lecture room when they have the lecture because
the door is not open. The students also cannot open the door because they do not have
the key. They need to wait for the technician to come for opening the door. So the major
reason to build this project is to reduce usage of the key when opening the door.
1.6
Objectives
The project that was built has several objectives. These objectives describe
bellow are mainly to improve the skill of learning and it will consist of skill of hardware
and programming skills. The objectives of this project were as follows:
1.3.1
mobile phone
1.3.2
1.3.3
1.7
This project will concentrate at the short messaging system (SMS) in order to
open the door. The SMS signal coming from the mobile hand phone need to be identify
in order to connect with the controller. The project will, have software and hardware
work implementation.
1.7.1 Software
In order to work with this project, first the right of software implementation
needs to be identified. The preliminary works for software searching are:
i.
Learn the usage of the assembly language and it criteria based on the project
objectives.
ii.
Identified the memory usage require by the program that will be built whether it
suite with the microcontroller or not.
iii.
Identified the software that will be used to load the program to the chip using
boot loader techniques.
iv.
Check and explore the entire menu in the software used in order to achieve the
project objectives.
1.7.2
Hardware
For the hardware part, there are several works that has been done before proceed
to the project requirements.
i.
ii.
Searching for material that will be use such as wood, nail and magnetic lock.
iii.
Built the prototype according to the design and the project requirements.
1.8
This thesis consists of five chapters that discussed and described about the details
of the project that have been done. For chapter 1, it was the introduction part mobile
phone, short messaging system (SMS) and the history behind the technology was
clearly defines. Besides, in this chapter also the problem statement, objectives and the
scope of the project was stated on this chapter.
For chapter two it is about the literature review. This chapter discussed all the
references and material that have been studied in order to work with this project. All the
security system available in the market nowadays was surveyed and the idea for develop
this project was taken from this kind of references. Next is the details of all component
that might be used in this project will discussed in this chapter.
In chapter three, it will discuss about the methodology of how to work with this
project and all kind of measure that was taken as well as the details of the entire
component used. Basically in this chapter have two areas which are software part and
hardware part. For chapter four it will discuss about the result that was obtain and the
discussion on the obstacles when doing this project. Lastly on chapter five, the
conclusion and the recommendation that was obtain from the final result of the project
will be discuss and some references and also the appendices.
CHAPTER II
LITERATURE REVIEW
There are lots of security systems in the market nowadays. These systems are
studied in order to obtain some idea for the project that was built. Although the system
in the market nowadays is suite with new technology and more advanced the idea must
still need to be obtain through the literature review.
The literature review works help to expose and generate skills of searching for
information from a various sources. These skills are very important in order to solve the
problems that encountered or will face in the future.
10
This security system is from the Paradox Company. The system has many kinds
of modules. One of them is wireless expansion module that act as receiver from the
wireless sources such as mobile phone. This gives the idea for this project by using a
mobile telephone. It is quite complex system because have many ways to activate the
control panel. For this project, the idea of using a wireless communication is adapted to
build the system.
11
2.0.2
MICROENGINE System
This door lock security system is from the Micro engine manufacturer. It
consists of the input part, controller part and the output part. The input is using the
smart card that use to activate the door. Next for the controller it uses the XP-M1000X
as a controller. Then for the output it haves push button, emergency break glass and the
door lock circuit. The door lock circuit is using the electromagnetic principle .So for the
project that will be builds; the concept of the electromagnetic principle will be use in the
project.
12
2.0.3
SUPA System
This security system is from the SUPA manufacturer. It has the GSM cellular
transmission. This act as the control panel switches to GSM Module for alarm report
transmission in case of the phone line cut. Besides it also have the voice module that act
as activation of electrical appliances using with the voice confirmation. This system
have some codes that consumer can set their selves. This gives the idea for the project
that will be built using some kind of codes to activate the system.
13
For the Nokia 3310 it has the connection port on the back of its cover. The port
can be seen under the battery. It has 4 pin that can enabled the connection to PC. Pin 1
was the MBUS pin. This pin is one pin bidirectional bus for both transmitting and
receiving data from the phone. It is slow (9600bps) and only half-duplex. Only two pins
on the phone are used that are ground and data. M-Bus runs at 9600bps, 8 data bits, odd
parity, and one stop bit. The data terminal ready (DTR) pin must be cleared with the
request to send (RTS).
F-Bus is the later high-speed full-duplex bus. It uses one pin for transmitting data
and one pin for receiving data plus the ground pin. Very much like a standard serial
port. It is fast 115,200bps, 8 data bits, no parity, one stop bit. For F-Bus the data
terminal ready (DTR) pin must be set and the request to send (RTS) pin cleared. The FBus is bi-directional serial type bus running at 115,200bps, 8 data bits. The serial cable
contains electronics for level conversion and therefore requires power. The first thing to
do is supply power to the cable electronics and this is done by setting the DTR (Data
Terminal Ready) pin and clearing the RTS (Request to Send) pin. To synchronize the
UART in the phone with your PC or microcontroller send a string of 0x55 or 'U' 128
times. Then the bus is ready to use.
14
2.2
Another phone that was survey for this project was Sony Ericsson K700i.This
phone was manufactured by Sony and it is from Japan technology. This phone has
special features which it can accept the AT Commands. This command is a special
command that used to communicate between the phone and the computer.
This phone has a port which enables user to connect the data cable. This data
cable act as the connection between the phones to other sources such as computer. For
this project, it is need to study the useful port in order to connect the phone to the
microcontroller chip. The table below shows the meaning and the purpose each of the
port of the phone.
15
NAME
DESCRIPTION
ATMS
Audio to mobile
AFMS/RTS
CTS/ONREQ
DATA IN
DATA OUT
ACC IN
ACC OUT
AGND
FLASH
10
DGND
Digital ground
11
VCC
16
17
The electronic data communication can be divided into two categories that are
single ended and differential.RS-22 is categorize into single ended that was introduced
in 1962 and until now it is widely use in the industry. Independent channels are
established for two-way (full-duplex) communications. The RS232 signals are
represented by voltage levels with respect to a system common (power / logic ground).
The "idle" state (MARK) has the signal level negative with respect to common, and the
"active" state (SPACE) has the signal level positive with respect to common. RS232 has
numerous handshaking lines (primarily used with modems), and also specifies a
communications protocol.
The data of RS-22 is bi-polar and the range is between +3V to +12V.This
voltage indicate for ON or O (SPACE) state condition. The voltage between -3V to
-12V indicates of an OFF or 1 state (MARK) condition. Nowadays modern computer
equipments ignore the negative voltage levels and accept zero voltage as a OFF state.
Also the ON state can be operating with the lesser positive voltage. This means that
+5V can capable to driving this RS-232 interfacing. The output signal level usually
18
swings between +12V and -12V. The "dead area" between +3v and -3v is designed to
absorb line noise. In the various RS-232-like definitions this dead area may vary. For
instance, the definition for V.10 has a dead area from +0.3v to -0.3v. Many receivers
designed for RS-232 are sensitive to differentials of 1v or less. This can cause problems
when using pin powered widgets - line drivers, converters, modems etc. These types of
units need enough voltage & current to power them self's up. Typical URART (the RS232 I/O chip) allows up to 50ma per output pin - so if the device needs 70ma to run we
would need to use at least 2 pins for power. Some devices are very efficient and only
require one pin (some times the Transmit or DTR pin) to be high - in the "SPACE" state
while idle. An RS-232 port can supply only limited power to another device. The
number of output lines, the type of interface driver IC, and the state of the output lines
are important considerations.
The types of driver ICs used in serial ports can be divided into three general categories:
Drivers which require plus (+) and minus (-) voltage power supplies such as the
1488 series of interface integrated circuits. (Most desktop and tower PCs use
this type of driver.)
Low power drivers which require one +5 volt power supply. This type of driver
has an internal charge pump for voltage conversion. (Many industrial
microprocessor controls use this type of driver.)
Low voltage (3.3 v) and low power drivers which meet the EIA-562 Standard.
(Used on notebooks and laptops.)
Data is transmitted and received on pins 2 and 3 respectively. Data Set Ready
(DSR) is an indication from the Data Set (i.e., the modem or DSU/CSU) that it is on.
Similarly, DTR indicates to the Data Set that the DTE is on. Data Carrier Detect (DCD)
19
indicates that a good carrier is being received from the remote modem. Pins 4 RTS
(Request to Send - from the transmitting computer) and 5 CTS
(Clear To Send - from the Data set) are used to control. In most Asynchronous
situations, RTS and CTS are constantly on throughout the communication session.
However where the DTE is connected to a multipoint line, RTS is used to turn carrier
on the modem on and off. On a multipoint line, it's imperative that only one station is
transmitting at a time (because they share the return phone pair). When a station wants
to transmit, it raises RTS. The modem turns on carrier, typically waits a few
milliseconds for carrier to stabilize, and then raises CTS. The DTE transmits when it
sees CTS up. When the station has finished its transmission, it drops RTS and the
modem drops CTS and carrier together. Clock signals (pins 15, 17, & 24) are only used
for synchronous communications. The modem or DSU extracts the clock from the data
stream and provides a steady clock signal to the DTE. Note that transmit and receive
clock signals do not have to be the same, or even at the same baud rate.
Besides that the RS-232 has several limitations for its connection. The
limitations are listed as follows:
CHAPTER III
METHODOLOGY
3.1
Project Methodology
Automatic door lock systems have 3 main blocks of systems which is receiver,
controller and door lock circuit. Receiver for this system is the mobile phone Sony
Ericsson K500i. This mobile phone acts as the signal receiver and received the short
messaging system (SMS) from the user and sends the data to the microcontroller.
The electromagnetic lock is used as the door lock. This electromagnetic lock is
using the electromagnetic principle which will act as an electromagnet when there is
power supply feed to it.
21
A Sony Ericsson K700i phone was used in this project. This phone was chosen
because of it compatibility that support the AT-Commands. The short messaging system
(SMS) can be read by using the hyper terminal from the Microsoft Software if the right
AT-Commands sends to the phone.
A MC68HC11A1 circuit was build and the main components for the main
circuit for this microcontroller are crystal, capacitor, regulator and max-232 for serial
interfacing purposes. These components are required in order to operate the
microcontroller. Below is the circuit of the microcontroller.
22
23
3.4
Voltage regulator circuit that was built is mainly use to supply the fixed 5V
voltage to the microcontroller circuit. This regulator circuit consists of LM7805 which
is the positive 5V chip regulator. This chip is not stand by itself but there are two
capacitors were used for this circuit. One capacitor was connected at the first and
second pin of the regulator chip and the other was connected at the second and third of
the regulator. These two capacitors act as a voltage stabilizer for the input and the
output for this regulator. So the 5V voltage was supply correctly without any dissipation
of voltage.
24
3.5
One of the most important circuits regarding this project is the serial interfacing
circuit. This circuit was built in order to make the communication between the
microcontroller and the computer. The major purpose of this circuit is to load the
program that has been written to the microcontroller chip. This serial interfacing circuit
also is the medium to see the program through the hyper terminal which in the
Microsoft software.
This circuit consists of the major component that is MAX232 chip. This chip can
convert between 5 Volt logic and RS232.Many microcontroller have asynchronous
serial port but their input and output use 5Volt logic rather than rs232 voltages.
Interfacing 5Volt logic to an RS232 port requires converting to and from RS232 levels..
25
3.6 Output Circuit
The final circuit for this project was the relay circuit. This relay circuit was
implemented in order to switch the contact to open circuit if the true signal (SMS) was
send by the user. At the initial condition, the relay is normally closed. This means that
the door is at lock condition at the initial state. When there is true message send by the
user then only the microcontroller trigger the relay to the open circuit state. Figure
below shows the relay circuit:
After completing the circuit implementation, next is to develop the prototype for
the door lock output. For this purposes several material had been prepared such as two
play wood, magnetic lock, nail, screw driver and steel. Before start built the door
prototype, a design for this was sketch in order to give some idea and for the
improvement for next time reference.
26
The door was built from two pieces of wood and from this wood, a measure
was taken and the installation works are done in the lab. Some of the works are cutting
the wood, make a hole to the steel, put and hold the magnetic lock to the steel in order
to attach it to the door lid. This works contribute to the creative thinking and problem
solving technique to finished .Below are some view of the prototype,
27
3.8
Component Used
For this project, all components that were used were list together to help the work
become smooth. The component was plan according to the need of the project. List
bellows
28
3.9
THRSim11
This automatic door lock project will use not only the hardware implementation
but the software implementation as well. In order to program the microcontroller chip, a
simulator program that called THRSIM11 from the Motorola was being used. This
software was used because it is suite to the chip.
THRSIM simulator was user friendly software because the simulation can be
implemented through the software after the program written by the user. It has features
such as led, switch, traffic light, serial communication receiver and transmitter and so
on. This features can be used according to the program that suite to the objectives that
user want.
29
THRSim11 simulator has a menu display on top of the windows. This menu provides
the user a task that they want to use. The task are view, edit, execute, label, breakpoint,
30
connect and so on. This helps the user while programming the project. For this project,
the signal from the phone must be read by the microcontroller and then verified it and
lastly on the output if the right messaging was send by the user. Figure below shows
the transmitter for this simulator. This transmitter will shows that the data that will send
by the phone to the microcontroller.
The data was send by the phone and then is transmitting to the receiver port of the
microcontroller. The data was send serially and one by one from the left side to the right
side. When the data was send by the phone it simultaneously stored in the memory of
the microcontroller as shown below
31
The data stored in the memory was in the hexadecimal type. The data from the phone
was in the ASCII code. The microcontroller will convert this type of data to
hexadecimal type to store it in the first memory located at $0000 and so on. hen
microcontroller verified the data and found 6F37 which means on, t then on the led
as shown. his led was shown to represent the output trigger for the relay to switch at the
normally open condition.
32
After the output has been triggered, it holds for a certain delay in order user to
close the door manually from inside the room. For user to open the door inside the door
they need to push the switch inside the room to release the magnet for the lock.
3.10 HCLOAD
Another software that used in completing this project were HCLOAD. This
software also develops by the Motorola Company in order to load the program that has
been written by the programmer to the microcontroller chip. Using this software enables
to load the program using the boot loader techniques. Boot loader techniques means that
the microcontroller chip can be program directly using the computer through the serial
port. The only need is the serial port and the serial interfacing circuit that was
implementing before.
Besides that this software enable to check and deleting the EEPROM for the
microcontroller.
33
The microcontroller board (MC68HC11A1) that has been finish built was check
whether it is function or not. The serial ports which are transmit (TX) and received
(RD) port was connected to the serial port interfacing circuit and from this circuit the
DB9 connector was connected to the serial port of the computer. After the voltage
supply was feed, the reset button at the microcontroller circuit was press. The green
light from the HCload was display and this means that the microcontroller board was
properly and can be used to implement this project.
For this demo version of THRSim11 and HCload program there are limited source
such as the memory to load the program only limited at EEPROM which the starting
address is $B600.Although this was the constraints it still not effect because the
program written is not exceed the memory that was allocated by this software.
34
For setting the connection from the phone to the hyper terminal, a menu which
shows the phone connection at left side corner of the windows was select. This means
that a connection between the phone and the computer was made.
35
After the connection was selected, then the com port that being used for
connection between phone and microcontroller was choose that is com 4.This is to
make sure the correct port that the phone and the computer is connected together.
36
Next is to select the baud rate for the connection. Baud rate means the speed of transfer
rate for the data from the phone to the computer. For this connection 9600bps
connection was used because this connection was suitable for the phone.
The code for this project is created with the easy code which in this case is on.
This on signal coming from the phone was then detect by the hyper terminal by
sending special command in order to communicate the phone with the computer. First
the code AT was sends through the hyper terminal. Then the phone replied the response
which in this case is ok. This means that the phone support this type of command. The
command known as AT-Commands. AT means attention. After that, then the command
to read the message from the first memory of the phone was send. Then the phone
replied with the string of data which
07910621000010F5040B910671677925F9000080306000849223026F37.
37
Consider that the exact message sending by the user was on. And the response from
the hyper terminal was shown before. Note that the coding for the exact message was
located at the last of the string of data which are 6F37.This data are represent the on
which send by the user.
07910621000010F5040B910671677925F9000080306000849223026F37.
6F37
Let be informed that the data from the phone was shown above. It is the string type
of data. The coding for the actual message was 6F37.To convert this data in order to
identify the actual data is firstly the data is divided in two section which every section
include two character. After that, convert the two separated section to its binary value.
Second, the zero from the MSB for data 6F is put on the right side of data 37 which
have been converted to the binary just now. Now by referring to the ASCII chart shown
below, the actual message was identified which for the first character was o and the
second character was n. So the message send by user was on.
6F = 0110 1111
37 = 0011 0111
38
0110
1111
0011
01110 (Zero from the MSB for 6F is put at the LSB of 37)
39
3.13
Assembly Language
DFTRIO
EQU $1000
BAUD
EQU $2B
SCCR1
EQU $2C
SCCR2
EQU $2D
SCSR
EQU $2E
SCDR
EQU $2F
PORTB
EQU $04
PORTE
EQU $0
ORG
$FF00
LDX
#DFTRIO
LDY
#MSG
LDAA
#$30
STAA
BAUD,X
CLR
SCCR1,X
LDAA
#%00000100
STAA
SCCR2,X
40
RCV BRCLR
SCSR,X #%00100000
LDAA
SCDR,X
CMPA
#'6'
BEQ
LAGI
STAA
0,Y
RCV
INY
BRA
RCV
LAGI NOP
RC
BRCLR
SCSR,X #%00100000
LDAA
SCDR,X
CMPA
#'F'
BEQ
LAG
STAA
0,Y
RC
INY
BRA
RC
LAG NOP
R
BRCLR
SCSR,X #%00100000
LDAA
SCDR,X
CMPA
#'3'
BEQ
LA
STAA
0,Y
INY
BRA
41
LA
TERIMA
ONRELAY
DELAY
NOP
BRCLR
SCSR,X #%00100000
LDAA
SCDR,X
CMPA
#'7'
BEQ
ONRELAY
BRA
RCV
LDAB
#%11111111
STAB
PORTB,X
BRA
DELAY
LDAB
#240
LDY
#$8B7E
TERIMA
;DELAY30S UNTUK
;PENGGUNA
;TUTUP PINTU BALIK
ULANG
DEY
BNE
ULANG
DECB
BNE
DELAY
LDAB
#%00000000
STAB
PORTB,X
LDAA
PORTE,X
CMPA
#%11111111
;OFF RELAY
42
BEQ
ONDALAM
BRA
ONDALAM LDAB
RCV
#%11111111
;NAK
BUKAK
PINTU
STAB
PORTB,X
LDY
#$6F96
GO
DEY
BNE
GO
BRA
RCV
ORG
$0000
MSG RMB
32
DARI
43
3.14
AT-Commands
Note that every command has + prefix after the AT prefix. This sign is
compulsory in order to use the commands. Some of the AT Commands that was used in
this project are:
AT
the
phone
support
this
command
or
not.
AT+CPMS=ME
AT+CMGR=1
AT+CMGD=1
44
3.15 System Flow Chart
START
DELETE
MESSAGE
COMPARE
on
YES
SWITCH THE RELAY
TO NORMALLY OPEN
DELAY 30s
NO
CHAPTER IV
4.0 Result
After the project has been finished work with, all of the circuit that was built was
successfully work. For the voltage regulator circuit, it successfully work which enable
to supply the continuous fixed 5 Volt to the other circuit that used in this project. he
adapter was used for the input voltage of the regulator. Since the regulator was built
from LM7805 chip, he maximum voltage input for this chip is 24V.This chip LM7805
were used because of the capability to supply the positive 5 Volt continuously. The red
led was used as the indicator to indicate that whether there is voltage output from the
regulator or not. If the led is shows the red light, this means that there is output voltage
from the regulator circuit.
46
4.0.2
Next for the controller of the system the microcontroller MC68HC11A1 from
the Motorola manufacturer was successfully built. This microcontroller has been tested
in order to make sure it can receive the program written or not. For this microcontroller
it works with the 5 Volt as a supply to the chip. Attached at this circuit are two button,
red led, output port pins, oscillator, capacitor and resistor.
47
The red led work and red light seen after the 5 Volt are supply to the microcontroller.
Next when the transmit and receive port are connected to the serial interfacing circuit
and checking using HCLoad software, the green light of the software shows at the
monitor screen as the reset button was pressed. This means that the microcontroller
circuit is properly functioning.
4.0.3
The serial interfacing circuits that have been build work properly. This serial
interfacing circuit is used to load the program that has been written to the
microcontroller chip. After done with the programming, the program was load in the
microcontroller chip using the HCLOAD software. Transmit (TX) and receive (RD)
port for the serial interfacing circuit was connected to transmit (TX) and receive (RD)
of port at the microcontroller. The green lights at the HCLOAD software are shown
after the reset button for the microcontroller are pressed.
The serial interfacing circuit is connected to the computer by using the DB9
connector. The specifications of the RS232 connector are:
48
4.0.4
Relay Circuit
For the last circuit for this project, the relay circuit has successfully built. This
circuit was built because of to release the magnetic in order user open the door. The
magnetic lock at initial condition was in the lock condition. In other words the relay
condition the initial state is normally closed. After the right message was send by the
user, the microcontroller will trigger the relay to the normally open. This means that the
magnetic effect was enabled. The concept of putting the transistor to the relay is that
implement the transistor as a switching device.
49
4.0.5
Project Prototype
In completing the project prototype, there are lots of works done to design the
door using the wood. The wood was obtained from recycle shop at Taman Universiti.
The design work has been done first in order to create a good prototype which can be
equal as an exact situation.
50
Design was first sketch on a sheet of paper and the measurement was taken based on the
suitable cases. The door consists of the lid, handle, frame of the door and lastly is the
magnetic lock which is attached to the steel that hold the magnetic lock. The door was
properly design and lastly the result is that a good prototype of door lock was built.
4.0.6
Software Skills
After finished doing this project, what I have learned was the programming
skills using the assembly language. Although there are lot of programming language
such as C, C++, JAVA but assembly language are easy for me to understand the
meaning. Also from this project, searching for information from a various sources skills
also has been learned. To know the characteristics of the microcontroller, the data sheet
is an important reference for this. In the data sheet all the characteristics of the
microcontroller was obtained. Besides, the programming skills require the critical and
creative thinking in order to write the program.
4.1
Discussion
In this project that has been done, all the circuit was successfully worked. There
is on problem encountered which is the microcontroller cannot read the message from
the phone and function as needed in the first objectives. Searching for the problem was
done to detect where the problem is. From the simulation that has been done using the
THRSim11 simulator, it shows that after the microcontroller read the data from the
phone, it will store the data in the memory inside it. But after testing with the real
hardware the situation is not same with the simulation that has been done.
51
4.1.0
Obstacles Encountered
i. Difficulty looking for the suitable phone that suite to the project
objective. There are two different model that are Nokia and Sony Ericsson
model.
ii. Problems on find the suitable data cable in order to connect the phone to
the microcontroller.
Solution: Ask a friend that was doing the project that will use the SMS
concept. Finally the cable was found and can be used in this
project.
Solution: Do the troubleshooting work over and over. Using the multimeter
to check the voltage supply whether it is supplied or not. Finally,
the microcontroller circuit was properly functioning.
CHAPTER V
5.1
Conclusion
Security system nowadays has become an important aspect to human life. As the
need was demanding nowadays, this system was built in order to meet the demand in
the security system. The Automatic Door Lock System was built in order to help user in
opening their door without using the key. This system using short messaging system
(SMS) in order to open the door. This concept gives the additional features in the
security system as well as to help the consumer for more security of their life.
In this project, the objective that learning the SMS technology has be met. This
knowledge can be implemented in more complex system later. Besides, through this
project a lot of skills have been develop not only in the software and hardware skills but
the capabilities of searching for important data also have been learned.
53
5.2
Future Recommendations
This project could be improved for the next future as listed below:
i.
Signals Display
A suitable display for lock and unlock condition could be made in order
to enable user to know the condition of the door whether it is in lock
condition or not.
ii.
Charging Port
A charging port for the phone could be made in future in order to charge the
phone in case of it battery does not have the supply.
iii
Security Features
54
REFERENCES
5. Wikipedia
(2004),
"Mobile
Phone"
retrieved
23
October,
2004,
from
http://en.wikipedia.org/wiki/Mobile_phone.
6. Nurhuda
bt
Zahari
(2006),
Automatic
Fire
Alarm.Universiti
Teknologi
Malaysia:Bachelor.Thesis
7. Sin
Chung
Fei
(2006),
Malaysia:Bachelor.Thesis
Smart
Automatic
Door.
Universiti
Teknologi
55
APPENDICES
TASK
1
Briefing on
PSM
Meeting
with
supervisor
Select
project
Search
information
for the
project
tools,
software,
articles
Submit
proposal
Search &
Design
circuit
Prepared
for
presentation
Presentation
of PSM 1
Reports
preparation
Submit
reports
WEEK
8
9
10
11
12
13
14
15
56
WEEK
1
Submit the
progress of
project
Build
circuit
Submit
summary of
project
Prepare for
presentation
and demo
Presentation
and demo
Thesis
preparation
Submit
thesis draft
Submit
thesis and
CD
10 11 12 13 14 15 16 17