automatic door light cntrl.pdf
-
Upload
monika-dua -
Category
Documents
-
view
243 -
download
0
Transcript of automatic door light cntrl.pdf
-
8/10/2019 automatic door light cntrl.pdf
1/70
AUTOMATIC DOOR LOCK SYSTEM
MOHD HELMI ALSYUKRAN BIN ABD MALIK
UNIVERSITI TEKNOLOGI MALAYSIA
-
8/10/2019 automatic door light cntrl.pdf
2/70
-
8/10/2019 automatic door light cntrl.pdf
3/70
-
8/10/2019 automatic door light cntrl.pdf
4/70
AUTOMATIC DOOR LOCK SYSTEM
MOHD HELMI ALSYUKRAN B ABD MALIK
A report submitted in fulfillment of the requirements for the award of the degree of
Bachelor of Electrical Engineering (Control and Instrumentation)
Faculty of Electrical Engineering
Universiti Teknologi Malaysia
APRIL 2008
-
8/10/2019 automatic door light cntrl.pdf
5/70
-
8/10/2019 automatic door light cntrl.pdf
6/70
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.
-
8/10/2019 automatic door light cntrl.pdf
7/70
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.
-
8/10/2019 automatic door light cntrl.pdf
8/70
v
TABLE OF CONTENT
CHAPTER TITLE PAGE
Supervisor Certification i
Declaration ii
Acknowledgement iii
Abstract iv
Table of Content v
List of Tables vii
List of Figures viii
I INTRODUCTION
1.1 Definition of Wireless communication and mobile 1
Communication
1.2 Mobile Phone 2
1.3 SMS Definition 5
1.4 History of SMS 6
1.5 Problem statement 6
1.6 Objectives 7
1.7 Scope of the Project 7
1.7.1 Software 8
1.7.2 Hardware 8
II LITERATURE REVIEW 9
2.0 Other Door locks System Available 9
-
8/10/2019 automatic door light cntrl.pdf
9/70
vi
2.0.1 PARADOX Security System 10
2.0.2 MICROENGINE System 11
2.0.3 SUPA System 12
2.1 Nokia 3310 Connection Port 13
2.2 Sony Ericsson K700i 14
2.3 Microcontroller 16
2.3.0 PIC16F84A Microcontroller 16
2.4 Serial Interfacing RS-232 17
III METHODOLOGY
3.1 Project methodology 20
3.2 Mobile Phone Characteristics 20
3.3 Controller Circuit 21
3.4 Voltage Regulator Circuit 23
3.5 Serial Interfacing Circuit 24
3.6 Output Circuit 25
3.7 Project Prototype 25
3.8 Component Used 27
3.9 THRSim11 28
3.10 HCLOAD 32
3.11 Hyper terminal 34
3.12 How to Know the Actual Message 37
3.13 Assembly Language 39
3.14 AT-Commands 43
3.15 System Flow Chart 44
IV RESULT AND DISCUSSION
4.0 Result 45
4.0.1 Voltage Regulator Circuit 45
4.0.2 Microcontroller MC68HC11A1 Circuit 46
4.0.3 Serial Interfacing Circuit 47
-
8/10/2019 automatic door light cntrl.pdf
10/70
vii
4.0.4 Relay Circuit 48
4.0.5 Project Prototype 49
4.0.6 Software Skills 50
4.1 Discussion 50
4.1.0 Obstacles Encountered 51
V CONCLUSIONS AND RECOMMENDATIONS
5.1 Conclusion 52
5.2 Future Recommendations 53
References 54
Appendices 55
-
8/10/2019 automatic door light cntrl.pdf
11/70
viii
LIST OF TABLES
TABLE NO. TITLE PAGE
1 Sony Ericsson Port Connection with Description 15
2 List of Components 28
3 RS-232 Specification 48
-
8/10/2019 automatic door light cntrl.pdf
12/70
ix
LIST OF FIGURES
FIGURE NO. TITLE PAGE
1 System Block Diagram 2
2.0 Paradox Security System 10
2.1 Micro engine System 11
2.2 SUPA System 12
2.3 Nokia 3310 connection Port 13
2.4 Sony Ericsson k700i 14
2.5 PIC16F84A Microcontroller 16
2.6 RS-232 9 Pin Serial interfacing 17
3.0 Sony Ericsson K700i Phone 21
3.1 MC68HC11 Microcontroller circuit 22
3.2 MC68Hc11A1 Microcontroller Chip 23
3.3 Voltage Regulator Circuit 23
3.4 Serial Interfacing Circuit 24
3.5 Output Circuit (Relay) 25
3.6 Project Overview 26
3.7 Front View 26
3.8 Left view 27
3.9 Top View 27
-
8/10/2019 automatic door light cntrl.pdf
13/70
x
3.10 THRSim11 Simulator 29
3.11 THRSim11 Simulator Windows 29
3.12 Serial Transmitter 30
3.13 Data stored in the Memory Windows 31
3.14 Led output (Represent relay) 32
3.15 HCLOAD 33
3.16 Hyper Terminal Windows 34
3.17 Com Port windows Selector 35
3.18 Baud Rate windows Selector 35
3.19 SMS Signal From the phone 36
3.20 ASCII Chart for o character 38
3.21 ASCII Chart for n Character 38
4.0 Voltage Regulator Circuit 46
4.1 Microcontroller Circuit 46
4.2 Relay circuit 49
4.3 Project Prototype 49
-
8/10/2019 automatic door light cntrl.pdf
14/70
CHAPTER I
INTRODUCTION
1.0
INTRODUCTION
Nowadays the telecommunication technologies become wider and more new
features exist to make human life better. These help people to communicate with each
other easier than before. People can communicate by many ways. For this new era,
people are most using the wireless technology system to communicate with each other.
Wireless technology is known that the communication system is not used the wire. This
technology and services have undergone a huge development since the first cellular and
cordless telephone systems were introduced in 1980s.The first generation of cellular
phone was based on analog FM technology. This generation only has voice service
only.
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.
-
8/10/2019 automatic door light cntrl.pdf
15/70
2
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.
Figure 1: System Block Diagram
Sony Ericsson
(K700i)
MICROCONTROLLER Door Lock Circuit
-
8/10/2019 automatic door light cntrl.pdf
16/70
3
1.1 Definition of Wireless Communication and Mobile Communication
Wireless technology nowadays becomes more advance in terms of their gadget,
way of operation and the technology behind it. There were lots of wireless
communication technologies. The wireless communication technologies are Mobile
Communication System, Bluetooth, Infrared, WirelessLan (WLAN), WiFi and
WiMax. This kind of technology allows us to communicate without using a wire.
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, IS-
95, UMTS, IMT2000, DECT, IEEE 802.11, Bluetooth and several multiple access
techniques such as MC-CDMA, W-CDMA and OFDM.
Mobile communication can be classified by their degree of complexity, the level
of the offered services and their cost. Mobile communication can be list as paging
systems, wireless telephony, trunking systems, cellular telephony, satellite personal
communication systems and system of wireless access to local area networks.
-
8/10/2019 automatic door light cntrl.pdf
17/70
-
8/10/2019 automatic door light cntrl.pdf
18/70
5
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 receivedthe 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.
SMS can be transmitted by using PC or mobile phone itself. As long we have
the coverage the messages can be received. Sending SMS through web site also can be
done if the web sites are equipped with PC Link. The Service Center is a center that acts
as a store and forward for short messages. The short messages are not sent directly from
sender to recipient but through an SMS Center or Service Center. The sender also will
have the message that send by this Service Center mentioned that their message are sent
to recipient or not.
-
8/10/2019 automatic door light cntrl.pdf
19/70
6
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.
-
8/10/2019 automatic door light cntrl.pdf
20/70
7
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 To facilitate lectures to open the lecture room door by sending an SMS
using their mobile phone
1.3.2 To reduce usage of key to open the door
1.3.3 To learn the programming skills and generate the creative
thinking.
1.7 Scope of the Project
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.
-
8/10/2019 automatic door light cntrl.pdf
21/70
8
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.
Design the door with the magnetic lock attached to it.
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.
-
8/10/2019 automatic door light cntrl.pdf
22/70
9
1.8 Organization of this Thesis
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.
-
8/10/2019 automatic door light cntrl.pdf
23/70
CHAPTER II
LITERATURE REVIEW
1.0
Other Door Locks System Available
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.
-
8/10/2019 automatic door light cntrl.pdf
24/70
10
2.0.1 PARADOX Security System
Figure 2.0: Paradox Security System
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.
-
8/10/2019 automatic door light cntrl.pdf
25/70
11
2.0.2 MICROENGINE System
Figure 2.1: Micro engine 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.
-
8/10/2019 automatic door light cntrl.pdf
26/70
-
8/10/2019 automatic door light cntrl.pdf
27/70
-
8/10/2019 automatic door light cntrl.pdf
28/70
14
2.2 Sony Ericsson K700i
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.
Figure 2.4: Sony Ericsson K700i Connection Port
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.
-
8/10/2019 automatic door light cntrl.pdf
29/70
15
Table 1: Sony Ericsson Port Connection with Description
PIN NAME DESCRIPTION
1 ATMS Audio to mobile
2 AFMS/RTS Audio from mobile/RTS
3 CTS/ONREQ CTS/Mobile Station On Request
4 DATA IN Data to mobile (Rx)
5 DATA OUT Data from mobile (Tx)
6 ACC IN Accessory control to mobile. Used as Rx in
some models for flashing.
7 ACC OUT Accessory control from mobile/hands free
sense. Used as Tx in some models for flashing
8 AGND Audio signal ground +0V reference
9 FLASH Flash memory voltage +service(shorted to pin
11 in service cable)
10 DGND Digital ground
11 VCC DC+ for battery charging + external accessory
powering
-
8/10/2019 automatic door light cntrl.pdf
30/70
16
2.3 PIC16F84A Microcontroller
Figure 2.5: PIC16F48A Microcontroller
This microcontroller is from the PIC manufacturer. The PIC16F84A is
categorized on the medium range among this type of microcontroller. The PIC is an 8
bit microcontroller based on Harvard architecture that is internal busses is separate for
memory and data. The throughput rate is therefore increased due to simultaneous access
to both data and program memory. It is conventional controllers tend to have one
internal bus handling both data and program. Besides the instructions fit into a 12 or 14
bit program memory word. For the instruction set are based on registers and each
instruction is executes in one clock cycle.
It has an internal divide by 4 connected between the oscillator and internal
clock bus. This make instruction times easy to calculate. The operation of this
microcontroller is fully static. This means that if the clock stop all the register contents
are maintained. For the drive capability, it has high output drive capability and can
directly drive LED. For the input output pins it can sink 25mA, has an 8 bit port
100mA.The instruction only have 35 instructions.
-
8/10/2019 automatic door light cntrl.pdf
31/70
-
8/10/2019 automatic door light cntrl.pdf
32/70
-
8/10/2019 automatic door light cntrl.pdf
33/70
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:
a) Increased power consumptions.
b) Limit the noise immunity and transmission distance.
c) Limit in speed and compatibility.
d)
The connector is large by current standards.
e) The use of handshaking lines for flow control is not reliable in many
devices.
-
8/10/2019 automatic door light cntrl.pdf
34/70
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.
A microcontroller of MC68HC11A1 is the major controller of the system. This
microcontroller has power supply connected to it which comes from the regulator
circuit that being builds. The firmware for this microcontroller is program in the chip in
order to program the chip using the boot loader techniques.
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.
-
8/10/2019 automatic door light cntrl.pdf
35/70
21
3.2 Mobile Phone Characteristics
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.
Figure 3.0: Sony Ericsson K700i Phone
3.3 Controller Circuit
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.
-
8/10/2019 automatic door light cntrl.pdf
36/70
22
Figure 3.1: MC68HC11 Microcontroller Circuit
This microcontroller manufactured by Motorola is an 8 bit microcontroller and
have two accumulators that are accumulator A and B. These accumulator can be joined
together to become an accumulator D which in this case is 16 bit. It also has 512kb
EEPROM, 256kbRAM and ROM is disable for this type of controller. Besides, it also
has the analog to digital converter built in this microcontroller. This analog to digital
converter is an 8 channels, 8 bit, multiplexed input, and successive-approximationconverter. However this features is not used in this project. Another features that was
used for this project is the serial communications interface (SCI) or called universal
asynchronous receiver transmitter (UART).This features was used in this automatic
door lock system project in order the microcontroller read the short messaging system
(SMS) using the received (RD) and transmit (TX) port available at the microcontroller.
These two ports were connected to the received (RD) and transmit (TX) port at the
phone.
-
8/10/2019 automatic door light cntrl.pdf
37/70
23
Figure 3.2: MC68HC11A1 Microcontroller Chip
3.4 Voltage regulator Circuit
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.
Figure 3.3: Voltage Regulator Circuit
-
8/10/2019 automatic door light cntrl.pdf
38/70
-
8/10/2019 automatic door light cntrl.pdf
39/70
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:
Figure 3.5: Output Circuit (Relay)
3.7Project Prototype
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.
-
8/10/2019 automatic door light cntrl.pdf
40/70
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,
Figure 3.6: Project Overview
Figure 3.7: Front View
-
8/10/2019 automatic door light cntrl.pdf
41/70
27
Figure 3.8: Left View
Figure 3.9: Top view
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
-
8/10/2019 automatic door light cntrl.pdf
42/70
28
Table 2: List of Components
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.
-
8/10/2019 automatic door light cntrl.pdf
43/70
29
Figure 3.10: THRSim11 Simulator
Figure 3.11: THRSim11 Simulator Windows
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,
-
8/10/2019 automatic door light cntrl.pdf
44/70
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.
Figure 3.12: Serial Transmitter
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
-
8/10/2019 automatic door light cntrl.pdf
45/70
31
Figure 3.13: Data Stored in the Memory Windows
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.
-
8/10/2019 automatic door light cntrl.pdf
46/70
-
8/10/2019 automatic door light cntrl.pdf
47/70
33
Figure 3.15: HCload
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.
-
8/10/2019 automatic door light cntrl.pdf
48/70
34
3.11 Hyper terminal
Before starting to write the program through THRSim11, a preliminary works
have been done which is to know the short messaging signal (SMS) from the Sony
Ericsson phone. The method was implemented by using the hyper terminal software
which comes directly with the Microsoft software.
Figure 3.16: Hyper terminal Windows
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.
-
8/10/2019 automatic door light cntrl.pdf
49/70
35
Figure 3.17: Com Port Windows Selector
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.
Figure 3.18: Baud Rate Selector Windows
-
8/10/2019 automatic door light cntrl.pdf
50/70
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.
Figure 3.19: SMS Signal from 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 .
-
8/10/2019 automatic door light cntrl.pdf
51/70
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.
3.12 How to Know the Actual Message
07910621000010F5040B910671677925F9000080306000849223026F37.
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
6F37
-
8/10/2019 automatic door light cntrl.pdf
52/70
38
0110 1111
0011 01110 (Zero from the MSB for 6F is put at the LSB of 37)
Figure 3.20: ASCII Chart for o Character
Figure 3.21: ASCII Chart for n Character
-
8/10/2019 automatic door light cntrl.pdf
53/70
39
3.13 Assembly Language
Assembly language is a language that low level programming language usingthe human readable instructions of the central processing unit. This project was used the
assembly language to develop the program that suite to the objectives. This
programming has been done using the THRSim11 simulator and the program was
shown below:
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
-
8/10/2019 automatic door light cntrl.pdf
54/70
40
RCV BRCLR SCSR,X #%00100000 RCV
LDAA SCDR,X
CMPA #'6'
BEQ LAGI
STAA 0,Y
INY
BRA RCV
LAGI NOP
RC BRCLR SCSR,X #%00100000 RC
LDAA SCDR,X
CMPA #'F'
BEQ LAG
STAA 0,Y
INY
BRA RC
LAG NOP
R BRCLR SCSR,X #%00100000 R
LDAA SCDR,X
CMPA #'3'
BEQ LA
STAA 0,Y
INY
BRA R
-
8/10/2019 automatic door light cntrl.pdf
55/70
41
LA NOP
TERIMA BRCLR SCSR,X #%00100000 TERIMA
LDAA SCDR,X
CMPA #'7'
BEQ ONRELAY
BRA RCV
ONRELAY LDAB #%11111111
STAB PORTB,X
BRA DELAY
LDAB #240
DELAY LDY #$8B7E ;DELAY30S UNTUK
;PENGGUNA
;TUTUP PINTU BALIK
ULANG DEY
BNE ULANG
DECB
BNE DELAY
LDAB #%00000000 ;OFF RELAY
STAB PORTB,X
LDAA PORTE,X
CMPA #%11111111
-
8/10/2019 automatic door light cntrl.pdf
56/70
-
8/10/2019 automatic door light cntrl.pdf
57/70
43
3.14 AT-Commands
Computer use an AT commands to communicate with modems. Most
communication applications have user interface that hide the AT commands from the
user. AT Commands can be relate via a communications application. When the phone
has received an AT command, it respond with message that is displayed on the screen
of the used device which in this case is hyper terminal.
The AT or at prefix must be added to the beginning of each command line.
Several AT commands can be type on the same line and the AT or at need to be
entered only once at the beginning line. There are many ways of AT Commands that
suite to the user need. User can check the phone number, read and send text message,
delete message, check the service center number, select phone memory and many more
through 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 : This command must be entered in order to check
whether the phone support this command or
not.
AT+CPMS=ME : Select the phone memory only (SIM card memory
is disabled)
AT+CMGR=1 : Read the first message in the first memory of the
phone.
AT+CMGD=1 : Delete the first message in the first memory of the
phone.
-
8/10/2019 automatic door light cntrl.pdf
58/70
44
3.15 System Flow Chart
NO
YES
START
READ MESSAGE FROMPHONE
COMPARE
on
SWITCH THE RELAYTO NORMALLY OPEN
DELAY 30s
SWITCH THE RELAYTO NORMALLY
DELETEMESSAGE
-
8/10/2019 automatic door light cntrl.pdf
59/70
CHAPTER IV
RESULT AND DISCUSSION
4.0 Result
4.0.1 Voltage Regulator Circuit
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.
As an additional component to the regulator circuit, two capacitors were
connected each at the input and output of the LM7805 chip. This is to make the voltage
input to the regulator and the output voltage are stabilize without any dissipation.
-
8/10/2019 automatic door light cntrl.pdf
60/70
46
Figure 4.0: Voltage Regulator Circuit
4.0.2 Microcontroller MC68HC11A1 Circuit
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.
Figure 4.1: Microcontroller Circuit
-
8/10/2019 automatic door light cntrl.pdf
61/70
-
8/10/2019 automatic door light cntrl.pdf
62/70
-
8/10/2019 automatic door light cntrl.pdf
63/70
49
Figure 4.2: Relay Circuit
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.
Figure 4.3: Project Prototype
-
8/10/2019 automatic door light cntrl.pdf
64/70
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.
-
8/10/2019 automatic door light cntrl.pdf
65/70
51
4.1.0 Obstacles Encountered
In completing this project, there are several problems encountered. The
problems are:
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.
Solution: Search for information and Sony Ericsson phone support AT
Commands.
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.
iii. Hardware of microcontroller circuit was enable to work properly at first
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.
-
8/10/2019 automatic door light cntrl.pdf
66/70
CHAPTER V
CONCLUSION AND RECOMMENDATIONS
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.
-
8/10/2019 automatic door light cntrl.pdf
67/70
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
A security features such as a device to detect the unusual way of opening
the door others than the originally specified.
-
8/10/2019 automatic door light cntrl.pdf
68/70
54
REFERENCES
1. Daniel J. Black (2001).Technicians guide to the 68HC11
Microcontroller. New York: Delmar Learning a division of Thomson
learning Inc .Pg 1-362.
2. Jan Axelson (2000).Serial Port Complete Chinook: Lakeview Research.
Pg 1- 295.
3. Jonathan W. Valvano. (2000).Embedded Microcomputer Systems.Brooks/Cole
Thomson Learning. Pg 1-743.
4. Motorola Inc (1991).The MC68HC11 reference manual.
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), Smart Automatic Door. Universiti Teknologi
Malaysia:Bachelor.Thesis
-
8/10/2019 automatic door light cntrl.pdf
69/70
-
8/10/2019 automatic door light cntrl.pdf
70/70
56
GANTT CHART for PSM 2
TASK WEEK
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Submit the
progress of
project
Build
circuit
Submit
summary ofproject
Prepare for
presentation
and demo
Presentation
and demo
Thesis
preparation
Submit
thesis draft
Submitthesis and
CD