Está en la página 1de 6

2012 International Conference on System Engineering and Technology

September 11-12, 2012, Bandung, Indonesia

Face Recognition Based on Auto-Switching


Magnetic Door Lock System Using
Microcontroller

Harnani Hassan*1 Raudah Abu Bakar*2 Ahmad Thaqib Fawwaz Mokhtar*3


*Faculty of Electrical Engineering
Universiti Teknologi MARA
40450 Shah Alam, Selangor
EMAIL: harnani_hassan@yahoo.com
EMAIL: raudah14@yahoo.com
EMAIL: ahmadthaqib87@gmail.com

AbstractFace recognition system is widely used for human through communication port to microcontroller[3].
identification due to its capability to measure and subsequently
identifies human identification especially for security purposes. Nowadays, building security has become one of the
This paper presents the development of Graphical User Interface
important issues to deal with [2]. Many identification
(GUI) based on face recognition system and Peripheral Interface
Controller (PIC) as an input/output carrier to switch on/off processes have been introduced to improve security system for
magnetic lock for door lock security system. The development is building access control such as face recognition, iris and
implemented by interfacing GUI built in MATLABR2009a with finger identifications. Compared to others, face recognition is
microcontroller to auto-switching magnetic lock for door lock less intrusive and more secure [4]. Initially a new template
security system. USB serial communication is used to interface will be created based on users face information. The created
between GUI and PIC microcontroller that allows input data
template will be compared with the existed template in the
transmission from GUI to microcontroller. The developed system
shows that the auto-switching mode transmission being database. Access will only be granted if the matching features
implemented via PIC microcontroller and USB serial between both templates are within the set of tolerance.
communication cable. It was also found that GUI can successfully
switch on and off the magnetic lock when an authorized image Many methods can be applied in face recognition system.
from GUI database is identified. One of them is Eigenfaces. This method works when the face
images are projected onto a face space (feature space) which
Keywords Peripheral Interface Controller (PIC);
best defines as the variation of the known test images. The
microcontroller; Graphical User Interface (GUI); MATLAB;
face space is defined by the eigenfaces which are the
eigenvectors of the set of faces. Then the person identification
I. INTRODUCTION is obtained by comparing the projection of new image in
feature space with the available projection of training set
image [4]. The use of GUI can greatly simplify the process. It
The securities currently become a very important issue and
can speed up the users work, so that users no need to look up
this is why a lot of security systems have been purpose using
the command line to run the program or the system. All the
an important process such as recognition especially for
algorithms for GUI and eigenfaces recognition method are
building access controls [1]. Face recognition is one example
build using MATLABR2009a.
of process that improves the security application for building
access control. The advantage of using face recognition
Microcontrollers are used in this project because of its high
instead of other identification process such as iris or
speed performance, low-cost and programming flexibility. As
fingerprint identification is because it least intrusive and more a standard computer, the microcontroller also consists of CPU,
secure [2]. The development of GUI-based face recognition ROM, I/O ports and timer. However, they are designed to
system for door lock control using microcontroller is an execute only single specific task to control a single system.
example of security system for building access control. The Furthermore, PIC16F877A microcontroller has a built in
process start by creating a new template based on user face universal synchronous asynchronous receiver transmitter
information. This template is compared to the template exist in (USART) hardware that allows direct communication with
database, and if the template match within a set tolerance, personal computer [5]. The USART module has two modes of
access to the desire resource is granted the signal being send operations: synchronous (requires a synchronized clock

978-1-4673-2376-5/12/$31.00 2012 IEEE


between the transmitter and receiver) and asynchronous (no III. PIC 16F877A MICROCONTROLLER
synchronization clock required). The USART is most
commonly use in asynchronous mode. The PIC16F877A microcontroller with up to 8k x 14 words
of flash memory is used in this system. It has 368 x 8 bytes of
This paper is divided into several sections. Section 2 briefly Data Memory and 256 x 8 bytes of EEPROM Data memory. It
explains the system development method. Section 3 explains is powered by 5V DC power supply and it also consists of 33
about minimum circuitry used in hardware implementation. I/O pins [4]. The minimum circuitry for PIC16F877A is
Section 4 presents the development of door lock system presented in Figure 2. As shown in Figure 2, Port 1 is the
circuitry using microcontroller. Section 5 describes the Master Clear input which can reset the PIC while 20 MHz
microcontroller programming development. Section 6 explains crystal oscillator and 2 units of 22 pF capacitor are used to
the development of graphical user interface (GUI) using make the IC works.
MATLAB software. Section 7 provides the results and
discussion and finally Section 8 concludes the overall work
done.

II. METHODOLOGY

The developed system is divided into two parts. As shown


in Figure 1 the first part of the system is GUI based face
recognition system and the second part is microcontroller
hardware implementation. The GUI based face recognition
system functions as the master control slave unit for
microcontroller PIC16F877A. In this system, a recognized
image is transformed into 8 bit signal as an ASCII code
through serial communication port to microcontroller circuit.
Then, the serial signal is converted into CMOS level signals
using MAX232. The received signal will be analyzed by the
microcontroller to lock or unlock the magnetic lock.

Figure 2. PIC 16F877A minimum circuitry

MAX232 is a serial RS232 to TTL/CMOS level converter


which converts +/-10 V serial RS232 signal to TTL/CMOS
level 0 to 5V. This connection is important to allow the
communication between laptop and PIC microcontroller [6].
Since most laptop nowadays does not have serial
communication port therefore, USB to DB9 converter is
suitable for the proposed design. Figure 3 below shows the
circuit diagram and connection of USB serial communication
to MAX232 circuit.

Figure 3. USB serial communication to MAX232 circuit

Figure 1. Flow chart of proposed Door Lock System


IV. DOOR LOCK SYSTEM

The magnetic lock unit is controlled by PIC16F877A as


shown in Figure 4. The microcontroller enables various
functions of ports such as digital I/O. Additionally analog
input and USART port for serial communication are regulated
by the microcontroller.

Figure 4. Schematic diagram of door lock system

To fulfill the requirement for this system, a prototype circuit


is developed to control the magnetic lock. The designed circuit
received serial signal from MAX232 circuit at RC6. Then, the
switching transistor 2N2222 is turned ON whenever face is
being identified at output pin RD2. Pin RD1 is set to turn on
the LED whenever image is identified. This system only used
transmitter at pin (RD6) instead of using transmitter and
receiver. This is because the system only received a
transmitted data from GUI. This circuit is designed with 20-
MHz external crystal oscillator for faster execution time.

V. MICROCONTROLLER PROGRAMMING

Figure 5. Flow chart of PIC microcontroller algorithm.


PIC16F877A is a programmable microcontroller, a serial
programming and reprogramming with a flash memory
capability [7]. The whole process of controlling input and VI. GUI DEVELOPMENT
output of the system is developed in C programming
language. The developed programming consists of desired
delay, input original state setting with provided A Graphical User Interface (GUI) is a pictorial interface
interchangeable serial data transmission technique using an to a program. The implementation of GUI is important as it
embedded USART. The developed programming used a allows user to choose what action should be taken and
Mikroelectronika (mikroC) as a compiler. It provides performed by the system. Figure 6 shows the layout of GUI.
supporting tools for testing and debugging with helpful The developed GUI consists of 4 push buttons which are
software libraries [8]. The flow chart of the programming is Training Image, Testing Image, Delete Database and Exit
shown as in Figure 5. buttons. Each button perform different task. The GUI also
comes with two image boxes for image display and two text
boxes for text display.
VII. RESULT & DISCUSSION

Figure 8 shows the Testing image is matched with the


Training image that will turn OFF the magnetic lock at door
and subsequently allows user to enter the room. The
matched picture is the image chosen by user. The input
picture is the image traced by the system. In Figure 9, the
LED turned ON as an indicator the door is opened after
the image is identified by the system.

Figure 6. Layout of Graphical User Interface (GUI).

Figure 7 shows the GUI development flow chart using


MATLABR2009a. In the flow chart, GUI is used as window
platforms for image recognition process.

Figure 8. Training Image and Testing Image are matched.

Figure 7. GUI Development Flowchart

GUI window platform requires four push buttons for Figure 9. LED is turned ON as an indicator the magnetic lock turns OFF.
interfacing process. The platform allows user to select image
in training image folder as a database. Then, the user is Figure 10 shows the cases when the access is denied.
allowed to choose image in testing image folder. The system This is because the Testing image did not match with
will either identify or match both images. After the training image in the database. The magnetic door remains
identification process, the information will be sent to the close or in ON condition until the recognition system
microcontroller to switch the magnetic lock ON/OF. identify a recognize image. The LED turned OFF as an
indicator the door remains close after the image is failed to
be recognized by the system as shown in Figure 11.

Figure 12. Serial signal of ASCII A character transmitter form GUI.

Transmitted data from GUI are transformed into an


asynchronous form. Then, the data are divided into frames in
byte size. The transmitted data from GUI only used 7 bits of
data frame with the 8th bit of data frame referred as the parity
Figure 10. Training Image and Testing Image doesnt match. bit for error checking purpose. Figure 12 shows the serial
signal before it being converted into CMOS level therefore the
voltage level is +/- 6.24V and -6.24V represent logic 1 while
+6.24V represent 0.

Figure 13 shows an overall system where the magnetic lock


automatically turns OFF when it identify an authorized
image from GUI database. Users were given 4seconds to
access the door before the magnetic lock turn ON and lock
the door.

Figure 11. LED is turned OFF as an indicator the magnetic lock remains to Figure 13. Overall system of GUI based face recognition system for door
turn ON. lock control using microcontroller.

VIII. CONCLUSION
Figure 12 shows the ASCII A character transmitted from
GUI to the Microcontroller. Microcontroller turned off the The GUI based face recognition system for door lock
magnetic lock when it received character A from GUI. The control using microcontroller has been developed in this study.
microcontroller compares its reference ASCII code character All related work lead to the completion of the study, including
with the data received from the GUI and switched off the the development of GUI based face recognition system and
switching transistor when the character received matched with auto-switching magnetic lock mechanism with
the character saved in microcontroller. microcontroller.
The performance and functionality of the designed system
showed that the transmission of data from GUI to
microcontroller is successfully done after the image is
recognized. The system can be improved to become fully
automatic face recognition system by adding another feature
that automatically capture image with a sensor when there is
human presence at the entrance area.

REFERENCES

[1] Jawad Nagi, Syed Khaleel Ahmed, A MATLAB based Face


Recognition System using Image Processing and Neural Networks,
4th International Colloquium on Signal Processing and its Application,
March 7-9,2008.
[2] Michal Coras, Perspective Methods of Biometric Human
Identification, Inst. of Telecommun., Univ. of Technol. & Life Sci.,
Bydgoszcz, Poland, 25-27 Sept. 2008.
[3] Robert C. Schultz, Robert W. Ives, Biometric Data Acquisition using
MATLAB GUIs, 35th ASEE/IEEE Frontiers in Education Conference,
Oct 19-22,2005.
[4] Wan Mohd Nor Izudeen bin Wan Ahmad, Face Recognition System
Based on Eigenfaces using Matlab, Thesis, Faculty of Electrical
Engineering, Univertisti Teknologi Mara, 2007.
[5] Mohd Suhaimi B. Sulaiman, GUI Based Remote ON/OFF Control and
Monitoring Single Phase Lamp Using Microcontroller, International
Journal on Computer Science and Engineering, Vol. 02, No. 04, 2010.
[6] MAX232Datasheet,
www.datasheetcatalog.org/datasheet/texasinstruments/max232.pdf,9am,
18Oct2011.
[7] Mikroelectronika development tools and compiler,
http://www.mikroe.com/, time, 2pm, 25 Oct 2011.
[8] Microchip PIC16F87XA Datasheet,
http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=100
2&mid=10&lang=en&pageId=74, 9am, 18 Oct 2011.

También podría gustarte