Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Abstract
In this study, a door lock prototype system was designed which can be remotely accessed
by mobile devices through SMS. The aim of this study is to help homeowners monitor
their houses if there is a person at the doorstep and will alert the owner if there is a forced
entry. The prototype system was composed of the Arduino Mega ADK as the
microcontroller, Android phone as the transceiver which sends and receives the SMS
commands, Solenoid lock as the lock and Opto interrupter as the sensor for the intruder.
An Android application was built in which if all the components are integrated, the
system will function according to the commands requested by the homeowner where it
capture images of force entry person then sends it through MMS and notifies the
homeowner of the state of the lock after sending the lock command. The systems
performance is analyzed by accessing the system, first sending commands and triggering
the doorbell and the alarm on the system at different places with different signal strength
in order to test how fast the system will respond. Data will be collected from the success
and failure of attempts by sending commands and receiving SMS and MMS.
Approval Sheet
This Design Project entitled SMS Controlled Door Lock With Image Capture
Using Android Phone, prepared and submitted by Filomeno, Gil Maica Marie V.,
Ledon, Michelle P. and Lenares, Prima Socorro L., in partial fulfillment of the
requirements for the degree of Bachelor of Science in Electronics Engineering has been
examined and is recommended for acceptance for Final Defense.
THESIS PROJECT COMMITTEE
Albert Baacia, MEng.
Chairman
Sheila Mae E. Jungco, ECE
Member
Baltazar Raffian,MEng.
Adviser
March 5, 2014
Date of Project Oral Defense
ACKNOWLEDGEMENT
Thesis Project is one of the most challenging courses of a college student. It needs
team work, faith, trust and dedication in committing this task. This wouldnt have been
made possible without these people who have extended their help in making this project
into a reality. We, therefore, would like to extend our profound gratitude to the following:
OUR BELOVED GOD THE FATHER, who is there guiding us in all the trials,
for the good health, for enlightening our minds and giving us faith to accomplish this
project.
ENGR. BALTAZAR RAFFIAN and ENGR. ADRIAN VILLARIN, our
supportive advisers, who sincerely share to us the knowledge they knew and guiding and
supervise in making this project.
ENGR. ALBERT BAACIA, ENGR. SHEILA MAE JUNGCO, AND ENGR.
JEROME PUZA, our beloved panelists, who is there to critic our design and also share to
us the ideas that may be helpful in obtaining this project.
EE/ECE FACULTY MEMBERS, who teach us the knowledge that is applicable
in this project; they also inspire, encourage and instilled to us a positive attitude.
ANALOG
DEVICES
LABORATORY,
SPECIAL
APPLICATION
LABORATORY AND CBELS, for the accommodation in making this project and
allowing us to borrow and use the materials that is needed in making this project.
MINIONS and FRIENDS, who extend their help in finishing this project and for
the joy and struggles we share.
OUR BELOVED PARENTS, for the financial support, inspiration to accomplish
this project and always there cheering.
Table of Contents
Title Page
Abstract
ii
Approval Sheet
iii
Acknowledgement
iv
Tables of Contents
vi
Chapter 1
1.1
1.2
1.3
1.4
1.5
Chapter 2
2.1
2.2
2.3
2.5
2.6
Chapter 3
3.1
3.2
3.3
3.4
3.5
3.6
Chapter 4
Methodology
Project Flow
Software Implementation
Hardware Tools
Hardware Implementation
Testing
Halfway Deliverables
Results and Discussions
4.1
4.2
4.3
4.4
4.5
Chapter 5
5.1
5.2
Bibliography
Appendices
Appendix A Gantt Chart
Appendix B Bill of Materials
Appendix C Schematic Diagram and Layouts
Appendix D Module Schematics
Appendix E Datasheets
Appendix F Microcontroller Unit Code
Appendix G Default.php Page Code
Appendix H Acceleration.php Page Code
Curriculum Vitae
Name of Figure
Project Flow Chart
System Flow
Intruder Alarm Flow Chart
Command Received Flow Chart
Doorbell Flow Chart
System Block Diagram
Page
Page
Tables
Table No.
Chapter 1
The Problem and Its Settings
1.1 Introduction
The security of every home is a matter of great concern to everybody. Everyone
have a lot of things going on their everyday life. Each of them is busy with their own
life, problem, responsibilities, work, school and so on. Some are even busy that they tend
to forget the security threats that come to their premises. On average, in Manila, the
indices of people worrying about house break-ins and problems with property crimes are
about 69 percent from the year 2012 [1].
Security threats may come at a time when everyone least expect it, especially if
they forget the safety measures done when they leave their homes unattended.
There are solutions to decrease the worries and occurrences of the said crimes.
One method is to remotely monitor the property with the use of 2G technologies. 2G
technologies enable the various mobile phone networks to provide the services such as
text messages and MMS (multimedia messages) [2]. With the use of this technology, it
will help provide real-time communication with the system and the user, where the user
can remotely control the system using SMS and monitor the area by capturing an image
and send it to the users phone using MMS.
This study aims to develop a door lock system that can be remotely accessed from
a mobile device, which can help monitor if there is a person at the door and can alert the
owner if there is a forced entry. The objectives of this study are:
i) To design a door lock that is remotely accessible through SMS.
ii) To design a door lock that will lock, unlock and take pictures using the Android
phones built-in camera if the user commands.
iii) To design a door lock that can alert the owner by means of capturing an image
and sends via MMS when there is an intrusion on the said door lock.
iv) To make use of the Android operated Smartphone as the GSM Module that will
interface with the microcontroller.
monitor the door lock if ever the user wants to know its current state (locked or
unlocked).
This study is limited to one door lock only and to areas that have network
coverage.
Chapter 2
Review of Related Literature
In this chapter, different studies that are related to the proposed study will be
presented. The following are the summary of each different study. It has its advantages,
disadvantages and differences between the different study and the proposed study.
The study is similar to the proposed study since it also deals with security. It
notifies multiple people when there is someone at the property but to those numbers who
are registered in the system only.
The study is similar to the proposed study that can control a device through SMS.
It is a home automation that can control up to 16 electrical devices unlike the proposed
study which will only control the front door. They also differ in the microcontroller used
and can monitor the status of the devices compared to the proposed study wherein
monitoring the status of the lock will not be included.
Chapter 3
Methodology
This study is a design demonstration research of a remotely accessible door lock
system. Project construction consisted of: (1) Hardware design and implementation of a
microcontroller connected to intruder alarm system, doorbell and door lock driver. (2)
Coding of the program the microcontroller unit for triggering the doorbell and the
intruder alarm; and for controlling the state of the solenoid lock. (3) Making an
application on android phone for the command of the user. This chapter will present the
materials and methods that were used in the construction, testing and evaluation of the
system in the study.
Figure 3.1 shows the overview of the entire system of the study where the door lock
system and a users phone can remotely communicate with each other.
The door lock system consists of the MCU, a doorbell, door lock circuit, intruder
alarm circuit, android phone and a users phone. The MCU is wired with the doorbell,
intruder alarm circuit and door lock circuit. A USB connection is needed between the
MCU and the Android phone. The MCU receives a triggering signal from the doorbell to
send an SMS to the user notifying a visitor at the users house. The Android phone serves
as the GSM module, a medium in order for the users phone and the microcontroller to
communicate remotely through SMS. It is also used for taking pictures if the user
commands and when an intrusion is detected. The door lock circuit is composed of a
solenoid lock and a driver circuit for automatic locking and unlocking of the lock and an
opto- interrupter sensor for the intruder alarm circuit.
10
API used was based on the version of the Android Phone we were using, which is API
level 16 since the phone has an OS version of 4.1.2 where it belongs to.
and
USB_HOST_Shield
and
put
it
in
the
11
12
13
the electromagnetic lock unlocked. For the TAKE PICTURE mode, the microcontroller
will send a CAPTURE IMAGE command to the android phone. It will then send
VISITOR command, which will send the captured image to the users phone with a
visitor alert message.
In Figure 3.3.4, the system starts with the initialization of all the components that
composes the system. If the doorbell is activated, the microcontroller will process the
command from the doorbell to the Android phone and then sends an SMS to the user that
there is someone at the door. If the user receives the SMS then he/she will then decide to
take a picture of the person who is at the doorstep or not. If the user decides to take a
picture then the microcontroller will send a command to the Android phone to capture the
image and process the image captured from the Android phone and sends it to the user.
included in the board with the use of the three libraries MAX3421e, Usb and Android
Accessory. The MAX3421e handles the USB Host Chip, the Usb handles the USB
communication and the Android Accessory handles the checking if the device connecting
is one of the available accessory-enabled phones. In order for the microcontroller and the
Android phone to communicate with each other it should be assured that the two passed
back and forth product and Vendor IDs that supports accessory mode which you can see
when you connect the two devices, for the two to communicate the Vendor ID must be
from Google which is 0x18D1 and the Product ID must either be 0x2D00 or 0x2D01 to
established connection to communicate. This microcontroller acts as the USB Host which
controls all the commands of the system.
3.4.2 Android Phone
An Android phone was used as the system transceiver and GSM module
interfaced with the microcontroller. It has an open source Linux-based operating system
in which applications are developed through Java language using the Eclipse IDE and the
Android SDK which provides the API libraries and developer tools necessary to build,
test and debug apps for Android. It is the one responsible for the sending and receiving of
the SMS and MMS to the users phone if ever the commands are executed.
LG Optimus V (E612) with an OS version of 4.1.2 and an API level 16 was used
as the android phone in the system which is connected to the microcontroller through a
USB cable. The phone was used since it is compatible to the microcontroller because of
its Vendor and Product ID that corresponds to the supported IDs which are 0x18D1 and
0x2D01 respectively. The phone gets its power from the microcontroller. This phone acts
as an Accessory to the microcontroller since it is not capable of functioning as a Host.
used to protect the transistor from back emf generated by the relay coil at transient points.
The 2n2222 is a NPN bipolar junction transistor, it suits for small relays. When the input
is 1 the state of the solenoid lock is lock, and when 0 the state of the solenoid is unlock.
The input supply is taken from pin5 (analog input) of the MCU.
3.4.4 Intruder Alarm Circuit
Opto-interrupter was used as the sensor to detect when there is intrusion,
whenever there is an object blocking the sensor, the voltage of collector-emitter is high
and low when there is no object block. An inverter is used to light the led when there is
intrusion and off when it is not trip. Pin6 is connected to the circuit as an input pin from
the MCU and pin5 as the output pin to the MCU. The circuit schematic and layout can be
found at the Appendix C.
3.4.4 Electromagnetic Lock
A lock-style solenoid lock 12VDC was used as the door lock of the system. It
consist an electromagnet and an armature plate. It uses the concept of electromagnetism,
when the lock is applied 12V it instantly opens and locks when power is cut. It has a
driver circuit to control its state. The study belongs to a fail secure type of electric locking
devices. Fail secure locking device remains locked when power is lost.
3.4.5 Power Supply
The power supply that was used is an external power source of 12VDC output of
an AC-DC converter from the 220V AC supply. It was used to drive the solenoid lock and
to power the arduino Mega ADK. The 5V supply is used in triggering the doorbell and for
the intruder circuit will be taken from the output voltage of the Arduino Mega ADK. The
output voltage (5V) of the arduino was used as the input voltage of the driver circuit.
17
Figure 3.5 shows the overview of the entire system of the proposed study where
the door lock system and a users phone can remotely communicate with each other.
The door lock system consists of the MCU, a doorbell, door lock circuit, android
phone and a users phone. The MCU is wired with the doorbell and the door lock circuit.
A USB connection is needed between the MCU and the Android phone. The MCU
receives a triggering signal from the doorbell to send an SMS to the user notifying a
visitor at the users house. The Android phone serves as the GSM module, a medium in
order for the users phone and the microcontroller to communicate remotely. The Android
phone is also used for taking pictures if the user commands and when an intrusion is
detected. The door lock circuit which is composed of an electromagnetic lock and a relay
circuit for automatic locking and unlocking and for the intruder alarm.
18
3.6 Coding of the Arduino Mega ADK and the Android App
The Arduino Mega ADK was programmed for controlling the lock, the intruder
alarm circuit, the doorbell and the Android Phone. It was programmed using Arduino
1.0.4 IDE for the configuration of the commands. First thing to do is to make the
microcontroller and Android Phone recognized each other by connecting them together
through USB connection. For the Arduino coding, some descriptive strings are added that
contains the initialization of an AndroidAccessory object, the important parameters are
Manufacturer, Model and Version these parameters should coincide with the parameters
declared in eclipse for building the app. In the setup routine, an active state of the object
with the powerOn method should be set always since it is in this part that the Arduino
checks if there is an Accessory connected to it. When connection is established, the serial
monitor will print the lines below:
19
Baud Rate
Communication
Configuration
Executes the
commands received
and sent
20
IncomingSms.java
and
the
CameraPreview.java.
The
Main
Activity.java is the class where the code for communicating the Android Phone, the App
and microcontroller were established. The IncomingSms.java is the class responsible for
receiving the incoming and sending the outgoing SMS and the CameraPreview.java is the
21
class responsible for the previewing of the Camera to be displayed on the screen of the
Android phone.
3.7 Testing
Preliminary test on the individual components or parts will be conducted first on
the project. Individual testing on the door lock circuit, the microcontroller with the
Android phone when the user sends commands, if the system will respond after being
triggered by the doorbell and if the Android phone captures an image after receiving a
command from the controller. Preliminary tests will be done before integrating the
system.
After system integration, the prototype of the project will be tested. During the
prototype testing, the proponents will try and access the system by first sending
commands and triggering the doorbell and the alarm on the system at different places,
different places with different signal strength in order to test how fast the system will
respond. Data will be collected from the success and failure of attempts by sending
commands and receiving SMS and MMS.
22
Chapter 4
Results and Discussions
This study aimed to developed a remotely door lock system where users can
remotely access the door and monitor the state of the door. The system was tested
according to its performance, reliability and based on different factors. This chapter
presents the different findings and our analysis based on the outcome of different trials.
Table of the results are shown and observed trends are discussed.
23
Chapter 5
Conclusions and Recommendations
5.1 Conclusions
An SMS controlled Door Lock with image capture using Android Phone was
designed to monitor the front door of the house when homeowners are not around. The
researchers were able to build a prototype system which is composed of an Arduino Mega
ADK microcontroller, Solenoid Lock and its driver circuit, an intruder alarm circuit with
an Opto Interrupter as the sensor and the Android Application from an Android Phone
which acts as the transceiver of the system that receives the commands from the
homeowner.
The researchers were able to design and build the circuits used in the system and
the Android Application. The intruder alarm circuit operates when the Opto- interrupter is
triggered through the homeowners command of the system to activate the intruder circuit
that allows it to take picture instantly and stores it in the memory card of the phone.
All in all, the researchers were able to monitor and control wirelessly the front
doorlock of the house through SMS. Out from the tests that were made, the delay, failure
and success of the sending and receiving of SMS vary according to the signal strength of
the Android Phone. The Door Lock Prototype was implemented and able to accomplish
the objectives stated in this project except for sending the captured image through MMS
because of the fact that Google did not include MMS API support for android 4.0 and
above.
5.2 Recommendations
After a thorough analysis of the data, the following recommendations have been
made:
The system should have a back-up power supply to prevent outrage of power
when sudden power failure occurs.
The Solenoid Lock should be replaced with an electromagnetic lock that can be
accessed by a key so that the homeowner can use the key when there is outage of
power.
24
The App made must be developed more so that it can be accessed through
registered numbers only specified in the App and can reply to the registered
numbers when commands are executed not just to the number who sent the
commands.
Bibliography
25
[1]
[ONLINE] http://www.numbeo.com/crime/city_result.jsp?country=Philippines&c
ity=Manila
[2]
[ONLINE] https://en.wikipedia.org/wiki/2G
[3]
Scott Velivis, Rob Lee-Own, Max Sobell, Vincent Lin Remote Door Lock
Project, Stevens Institute of Technology, May 2010.
[4]
Mohd Helmi Alysyukran Bin Abd Malik Automatic Door Lock System,
Universiti Teknologi Malaysia, April 2008.
[5]
[6]
[8]
[9]
[ONLINE] http://arduino.cc/en/Main/ArduinoBoardADK
26
APPENDICES
Appendix A
Gantt Chart
27
Appendix B
Bill of Materials
28
Items
Arduino Mega ADK
Android Phone
Solenoid Lock
Pre-synthesized PCB
Power Splitter Adapter
Cable
Printing
Load
Skid Protector
Screw
1N4001
2N2222
RESISTOR
OPTO-INTERRUPTER
MTP2955
Shipping & Delivery
Price
(Php)
3500
Quantity
100
80
----59.75
1.5
1
8
.50
45
95
Miscellane
ous
Total Amount:
Appendix C
29
Total Cost
1
1
1
1
1
3500
----1
10
4
1
10
1
1
104
59.75
15
4
8
100
80
45
95
50
30
31
Curriculum Vitae
Name
Nickname
gil, maica
Lapu-Lapu City, Cebu,
Address
Philippines
09339681059
Contact
Number
Email Address
gil.filomeno@yahoo.com
My love for you is like a concave up function because it is
Pick-up Lines
always increasing.
Personal Background
Date of Birth
Gender
Female
Nationality
Filipino
Educational Background
College Education
University of San Carlos Talamban Campus, Batch 2014
Bachelor of Science in Electronics Engineer
Secondary Education
Saint Alphonsus Catholic School, Batch 2009
Primary Education
Lapu-Lapu City Central Elementary School, Batch 2005
32
Curriculum Vitae
Name
Michelle P. Ledon
Nickname
mich, michelle
Mahayahay, Lapu-Lapu City,
Address
Philippines
09327812230
Contact
Number
Curriculum Vitae
Let's primz,
convert
our potential energy to kinetic energy.
prima,
prim2x
Address
Poblacion, Dalaguete,
Cebu,
Personal
Background
Philippines
Date of Birth
Nationality
Filipino
Primalenares_14@yahoo.com
Contact
Number
Gender
Email Address
Pick-up Lines
Educational
You're hotter than a Background
Bunsen burner set to full power!
College Education
Personal Background
Educational
Primary Education
Background
College Education
Asian learning Center, Batch 2005
University of San Carlos Talamban Campus, Batch 2014
Bachelor of Science in Electronics Engineer
Secondary Education
St. Marys Academy of Dalaguete, Batch 2009
Primary Education
33