Sie sind auf Seite 1von 58

CHAPTER 1 INTRODUCTION

1.1 Statement of the Problem

Laboratories and homes are one of the major concerns of the

people when it comes to security. As an owner, people are very particular

with the safety of things inside the rooms especially with their valuables.

According to the National Academy of Sciences (2011), The world has

become more security conscious, and that awareness extends to

laboratories. A laboratory security system is put in place to mitigate a

number of risks and is complementary to existing laboratory security

places. In doing this, the personnel who are in charge in a particular room

and laboratory may be able to implement controls and prevention of the

accidents and unexpected happenings like theft.

In FEU Institute of Technology, there are laboratories which

require security because of the high cost of the equipment like networking

laboratory, electronics laboratory, computer laboratory, and

chemistry/physics laboratory. According to Facilities Office (2014), there

are 47 laboratory rooms, 11 dispensing and 2 server rooms all in all in

FEU Institute of Technology. Having many laboratories in FEU Institute

of Technology, the risk of unauthorized access to laboratory rooms is

high. It may also lead to the expensive equipment being stolen and

unauthorized use of any equipment in the laboratory.

1
1.2 Current State of Technology

The most common used security nowadays for laboratories is just

by locking the door and opening it when needed. With this method, there

is a personnel needed to unlock the door and lock it on time. Some room

that has expensive equipment and chemicals uses biometrics like finger

print or an RFID card. Also when checking the attendance of the

professor, there is personnel that will check if there is a professor present,

absent or late.

Face recognition technology is commonly used nowadays

especially by government. This technology is used in law enforcement by

narrowing mug shot searches, in security and counterterrorism by

comparing surveillance camera images to known terrorists, in immigration

by rapid progression through customs and in correctional institutions or

prisons by inmate tracking and employee access.

Principal Component Analysis uses an algorithm which compares

the image captured to the saved face image in the database. Basically it

will be compared pixel by pixel and in many distinct features of the face.

At the end of the process, which Euclidean is used, will quickly identify

the user based on how low the value computed. If the value is high it will

be rejected. Euclidean can be set to any value base on what the user want.

2
1.3 Objectives

1.3.1 General Objective

To develop a Face Recognition Entry with Automation.

1.3.2 Specific Objectives

To integrate the principal component analysis algorithm in the

system for face recognition

To register a face ID for the user

To design a circuit for the lights to turn on and for the

solenoid to unlock after face is recognized

To create a database that allows the scheduled user to access

the system

To create a database for recording the time in and time out of

the user

To attain 95% accuracy and reliability of the performance of

the system

1.3.3 Scope and Limitations

The system will use face recognition for accessing the

laboratory or room. The system will only allow the user to access

the room that is scheduled on that particular time. The lights will

turn on and the door will unlock when the face is recognized

depending on the schedule of the user. The plain white background

3
is needed to capture the exact image for processing. The sensor

will detect the height for the alignment of the camera to the users

face. Any accessories in the face like glasses should be removed

and user should stand still during the face recognition process.

4
CHAPTER 2 RELATED THEORIES

2.1 Introduction

This chapter aims to give an overview in the different modules that

the proponents used in building the system. The idea of knowing the

specifications and uses of the components will help to implements its

work in the prototype.

This includes the software which is used for the in performing the

program that will give the routines to the components in doing the job

attached to them.

2.2 US100 Ultrasonic Sensor

Ultrasonic sensors are defined as electronic devices that emit an

acoustic wave beyond the upper range of human hearing called the audible

range, between 20 hertz and 20 kilohertz and determine the distance

between the sensor and an object based on the time it takes to send the

signal and receive the echo. Ultrasonic sensors have many applications,

including: parking assistance sensors in cars, proximity alarms, medical

ultrasounds, generic distance measurement, and commercial fish finders,

among other applications. Ultrasonic sensors are characterized by

their reliability and outstanding versatility. Ultrasonic sensors can be used

to solve even the most complex tasks involving object detection or level

measurement with millimeter precision, because their measuring method

works reliably under almost all conditions. To generate the ultrasonic

5
wave, ultrasonic sensors use a vibrating device known as a transducer to

emit ultrasonic pulses that travel in a cone-shaped beam. The range of an

ultrasonic sensor is determined by the frequency of vibration of the

transducer. As the frequency increases, the sound waves transmit for

progressively shorter distances. Conversely, as the frequency decreases,

the sound waves transmit for progressively longer distances. Thus, long-

range ultrasonic sensors work best at lower frequencies, and short-range

ultrasonic sensors work best at higher frequencies.

Ultrasonic Sensors are self-contained solid-state devices designed for non-

contact sensing of solid and liquid objects. For many applications, such as

monitoring the level of water in a tank, ultrasonic technology lets a single

device to do a job that would otherwise require multiple sensors. Our

sensors are available in several sensing ranges and styles with either an

analog or discrete output depending on the model.

Their high resolution and small blind zones ensure top precision.

BUS ultrasonic sensors are distinguished by their output signal. Thanks to

a switching and an analogue design, they can reliably detect and count

objects as well as determining distances extremely accurately. This

guarantees a wide range of applications. But there's more: thanks to

various output functions, our ultrasonic sensors can be used as normally

closed or normally open sensors. Some benefits of a ultrasonic sensor are

namely; it is contact-free detection, it is reliable even in critical ambient

conditions with lots of dirt, dust, or mist, it is irrespective of the color,

6
transparency, reflection properties, and surface texture of the object, it is

accurate detection even of small objects and it is cuboid and cylinder

designs for added constructional freedom.

Figure 2-1 US100 Ultrasonic Sensor

2.3 Servo Motor

Servo motors are self-contained electric devices that rotate or push

parts of a machine with great precision. Inside the Servo is a DC motor, is

a potentiometer and a control unit. The servo is attached to a gear that

control the rotation of the will, as the motor rotates, the potentiometers

resistance changes, so the control unit circuit can precisely regulate how

much movement there is in which direction. These motors run on

electricity from a battery and spin at high rotations per minute but put out

very low torque. An arrangement of gears takes the high speed of the

motor and slows it down while at the same time increasing the torque. A

tiny electric motor does not have much torque, but it can spin really fast.

The gear design inside the servo case converts the output to a much slower

rotation speed but with more torque. The amount of actual work is the

same, just more useful. The simplicity of a servo is among the features

that make them so reliable. Gears in an inexpensive servo motor are

7
generally made of plastic to keep it lighter and less costly. On a servo

designed to provide more torque for heavier work, the gears are made of

metal and are harder to damage.

Servo motors have two types namely AC servo motor and DC

servo motor. AC servo motor is a type of electric motor that runs on

alternating current but do not operate well at low speeds ,it is expensive

thats why it is commonly use in industrial machinery because it can

handle higher current surges. DC servo motor is a commonly used in robot

because of its ability to rotate continuously. They feature two ball bearings

on the output shaft for reduced friction and easy access to the rest-point

adjustment potentiometer

Figure 2-2 Servo Motor

2.4 Photo Interrupter

A photo interrupter is transmission-type photo sensor that

integrates optical receiving and transmitting elements in a single package.

Since the method involves light blocking ROHM calls this device a photo

interrupter. A long life GaAs infrared photodiode is utilized for output

8
while a single phototransistor and photo IC are integrated for light

detection.

Figure 2-3 Photo Interrupter

2.5 HD Camera

A camera is an optical instrument for recording images that you

can stored and share it to other people. The images may be individual

still photographs or sequences of images constituting videos or movies.

The word camera comes from camera obscura, which means "dark

chamber" and is the Latin name of the original device for projecting an

image of external reality onto a flat surface. The modern photographic

camera evolved from the camera obscura. The functioning of the camera is

very similar to the functioning of the human eye. A camera may work with

the light of the visible spectrum or with other portions of

the electromagnetic spectrum. A still camera is an optical device which

creates a single image of an object or scene, and records it on an electronic

sensor or photographic film. All cameras use the same basic design: light

enters an enclosed box through a converging lens and an image is recorded

on a light-sensitive medium. A shutter mechanism controls the length of

9
time that light can enter the camera. Most photographic cameras have

functions that allow a person to view the scene to be recorded, allow for a

desired part of the scene to be in focus, and to control the exposure so that

it is not too bright or too dim. A display, often a liquid crystal

display (LCD), permits the user to view scene to be recorded and settings

such as ISO speed, exposure, and shutter speed. Traditional cameras

capture light onto photographic plate or photographic

film. Video and digital cameras use an electronic image sensor, usually

a charge coupled device (CCD) or a CMOS sensor to capture images

which can be transferred or stored in a memory card or other storage

inside the camera for later playback or processing.

Cameras that capture many images in sequence are known

as movie cameras or as cin cameras in Europe; those designed for single

images are still cameras.

However these categories overlap as still cameras are often used to

capture moving images in special effects work and many modern cameras

can quickly switch between still and motion recording modes.

Figure 2-4 HD Camera

10
2.6 Limit Switch

Limit Switch is a switch making the travel of an object in a

mechanism past some predetermined point, and also mechanically

operated by the motion of the object itself. Limit switches automatically

monitor and indicate whether the movement limits of a particular device

have been exceeded. When an object meets the actuator, the limit switch

triggers the contacts to either form or break an electrical connection. Limit

switches are commonly employed in a wide range of applications and

under a variety of operating conditions due to their ease of installation,

relatively straightforward design, ruggedness, and reliability.

Figure 2-5 Limit Switch

2.7 Push Button

Push buttons are used in applications that require people to start,

stop or change a machine as well as wherever workers need to keep track

of what stage the machine is in. it is a switch mechanism for controlling

some aspect of a machine. Push button has a three pins namely the ground,

11
VCC and the trigger. This device is typically made out of hard metal but

sometimes plastics.

Figure 2-6 Push Button

2.8 GizDuino Microcontroller

It is an open source computing platform based on a simple

input/output (I/O) board and the used of standard programming language;

in other words, it is a tool for implementing a program you have designed

GizDuino is programmed using the IDE (Integrated Development

Environment). With Serial RX-TX disable switch. Atmega168P and 328P

ICs are low power but it is also the same functions of Atmega168/328 IC.

Figure 2-7 GizDuino ATMega 328 Microcontroller

12
2.9 Solenoid Lock

Solenoids are basically electromagnets: they are made of a big coil of

copper wire with an armature (a slug of metal) in the middle. When the coil is

energized, the slug is pulled into the center of the coil. This makes the solenoid

able to pull from one end.

This solenoid in particular is nice and strong, and has a slug with a

slanted cut and a good mounting bracket. It's basically an electronic lock,

designed for a basic cabinet or safe or door. Normally the lock is active so you

can't open the door because the solenoid slug is in the way. It does not use any

power in this state. When 9-12VDC is applied, the slug pulls in so it doesn't stick

out anymore and the door can be opened.

The solenoids come with the slanted slug as shown above, but you can

open it with the two Phillips-head screws and turn it around so its rotated 90, 180

or 270 degrees so that it matches the door you want to use it with.

Figure 2-8 Solenoid Lock

13
2.10 Light Emitting Diode (LED)

Light can be produced and/or controlled electronically in a number

of ways. In light emitting diodes (LEDs), light is produced by a solid state

process called electroluminescence. Under specific conditions, solid state

light sources can produce coherent light, as in laser diodes. Other devices

such as liquid crystal devices (LCDs) control externally supplied light to

form display units. Liquid crystal projectors have made a major impact on

public presentation of information, making inroads on the venerable

cathode ray tubes. Other technologies such as the Texas Instruments'

micromirror devices, called "digital light processors" as well as varieties

of plasma displays are beginning to enter the market for displays.

Figure 2-9 Light Emitting Diode (LED)

2.11 MATLAB

MATLAB (Matrix Laboratory) is a multi-paradigm numerical

computing environment and fourth-generation programming language. A

proprietary programming language developed by MathWorks, MATLAB

allows matrix manipulations, plotting of functions and data,

14
implementation of algorithms, creation of user interfaces, and interfacing

with programs written in other languages, including C, C++, Java, Fortran

and Python.

Although MATLAB is intended primarily for numerical

computing, an optional toolbox uses the MuPAD symbolic engine,

allowing access to symbolic computing capabilities. An additional

package, Simulink, adds graphical multi-domain simulation and model-

based design for dynamic and embedded systems.

Figure 2-10 MATLAB Environment

2.12 Arduino IDE

Arduino is an open-source prototyping platform based on a simple

I/O board and a development environment that implements the

Processing/Wiring language. The open-source Arduino Software (IDE)

makes it easy to write code and upload it to the board. It runs on

Windows, MAC OS X and Linux. The environment is written in Java and

based on processing and other open-source software.

15
Figure 2-11 MATLAB Environment

2.13 Microsoft Visual Basic

Visual Basic is a legacy third-generation event-driven programming

language and integrated development environment (IDE) from Microsoft for its

COM programming model first released in 1991. Microsoft intended Visual

Basic to be relatively easy to learn and use. Visual Basic was derived from

BASIC and enables the rapid application development (RAD) of graphical user

interface (GUI) applications, access to databases using Data Access Objects,

Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls

and objects.

16
Figure 2-12 Microsoft Visual Basic Environment

2.14 Microsoft Access

Microsoft Access is a DBMS (also known as Database

Management System) from Microsoft that combines the relational

Microsoft Jet Database Engine with a graphical user interface and

software-development tools. It is a member of the Microsoft Office suite

of applications, included in the Professional and higher editions or sold

separately.

Figure 2-13 Microsoft Access Environment

17
2.15 Summary

The background of the components were enumerated and

explained with their uses in this chapter. The following parts are needed in

making the project complete. There are things that the proponents had

considered in choosing these components. The capabilities of it and how it

will work as part of the project was determined. These components are

used in accordance to the demand of the project itself.

18
CHAPTER 3 FREA: THE PROPOSED SYSTEM

3.1 Introduction

The world had become conscious about the safety of their property. Using

different kinds of locks had been used like RFID, biometrics and other sources of

things in keeping the door close to implement the security the people wanted. In

the previous chapters, chapter 1 in particular, it have been said that there are many

incidents happened involving laboratories which causes injuries which leads to

death.

The project focused on the laboratories of FEU Institute of technology

where accidents and theft are possible to happen anytime. Having a software list

of the people who are entering the room will help the administrator to monitor the

everyday transactions happening at a given time.

In this chapter, the uses of the proposed system will be introduced and

how it may solve the problem in safety and security. The system was develop to

answer the worries of every person in imposing a security system which will

support their demand in keeping their self and their property safe. The project will

use face recognition system for which will make the system a reliable source of

security. This chapter will define the uses of different module according to their

capability.

19
3.2 FREA: The System

3.2.1 The Hardware

3.2.1.1 GizDuino ATMega328

The GizduinoATmega328 serves as the brain of the

whole system. Modules such as Push Button, Servo Motor,

Ultrasonic Sensor, Limit Switch, and Photo Interrupter are

connected to it and it receives the data and controls them.

3.2.1.2 US100 Ultrasonic Sensor

The US100 Ultrasonic Sensor emits a 40 kHz ultrasonic

wave that reflects to any object that it hits so basically Ultrasonic

Sensor serves as a height detector on our system. The Ultrasonic

Sensor will give a value depending on how far the ultrasonic wave

bounces so the lower the value the taller the person is and vice

versa if the value is higher when the person is smaller. After

getting the values the microcontroller will control the servo motor

for auto alignment.

3.2.1.3 Servo Motor SG5010

The Servo Motor SG5010 will only move after the height is

detected and base on the values given it is programmed to align to

the face of the user.

20
3.2.1.4 Photo Interrupter

The Photo Interrupter is composing of Infrared Emitter at

the right side and Infrared Detector on the left side. Basically the

Infrared Detector always detects the infrared if there is no object

blocking it and it is always on high state. The system uses Photo

Interrupter for counting the cycle or revolution of the servo motor

for aligning. It works like if the Height of person X is 5 feet then it

needs 5 cycles or revolution to align the camera to it. The

microcontroller uses the Photo interrupter so it will know when to

stop.

3.2.1.5 HD Camera

HD Camera is directly connected to the computer and is

used for face registration and image capturing.

3.2.1.6 Limit Switch

Limit Switch works in the system by stopping the Servo

Motor in case it goes beyond the given path also preventing the

Servo Motor to be removed on the path it takes.

21
3.2.2 The Software

3.2.2.1 MATLAB

In the system we used matlab for image processing. matlab

also works in our system by using several commands such as

"exist" to check a .txt file that is given by the visual basic on what

will the camera will do such as get a snap shot, image capture,

preview on, preview off and exit. also vid=videoinput to open the

camera and use the camera. there is also a routine on how to

capture images that will be saved and how many will it capture.

function captureImage(numCapture,outstring,vid)
preview(vid);
counter=0
while counter~=numCapture
capcha=getsnapshot(vid);
capcha=ycbcr2rgb(capcha);
capcha=imcrop(capcha,[180,20,280,380]);
imshow(capcha);
fname=sprintf('Captured_%01d.jpg',counter);
imwrite(capcha,fname);
imshow(capcha);

outstringnum=sprintf('%s%d',outstring,counter);
saveFileStr('command.txt',outstringnum)
pause(1.5);
counter=counter+1;
disp(counter);
end
%close fig(by imshow)
try close figure 2;end;
%send command to host
return;
function saveFileStr(filename,outstring)
fileID = fopen(filename,'w');
fprintf(fileID,'Command:%s',outstring);
fclose(fileID);

22
3.2.2.2 Microsoft Visual Basic

Visual basic works in the system by create the .txt files that

will be check by the matlab. this is also where the GUI is that

compose the attendance, register and many others that will be

saved on the database. in loading the pictures captured in

registration and checking the values of the ultrasonic sensor we

uses the getCSV routine.

getCSV routine for checking the comma seperated values

that is used on saving images.

Function getCSV(ByVal x As Integer, char As


String, str As String) 'number = getCSV(0,
",", str) 'FIRST PARAM
Dim b As Integer
b = 1
Do While (x <> 0)
If Mid(str, b, 1) = char Then x = x
- 1
b = b + 1
Loop
Do While ((Mid(str, b, 1) <> char) And
(Len(str) + 1) <> b)
getCSV = getCSV & Mid(str, b, 1)
b = b + 1
Loop
End Function

3.2.2.3 Arduino IDE

In our system, Arduino IDE is the one that will assign the

ports to be given. this is where the values are set like the height

and lower lim for proper alignment. also we used many

debouncing to be sure on what really is the value or if it is high or

low. switch1 and switch2 is also controlled by it.

23
This is the routine for the auto alignment of the servo

motor:

void Move()
{
if((Height - old_distance - LowerLim) >
65)
{
Serial.println("Over Height!!!");
}
else
{
StepsF = Height - old_distance -
LowerLim;
StepsF = StepsF / 0.3;
Steps = StepsF;
// Serial.print(Steps);
// while(1);
//Move
myservo.write(130); //
tell servo to go to position in variable
'pos'
while(Steps)
{
Lap();
Steps--;
}
myservo.write(zeropos);
// tell servo to go to position in variable
'pos'
}
}

This is what the system will do when there is no user it will

go back to its standby mode:

void Home()
{
myservo.write(100);
while(digitalRead(LS))
{
Lap();
}
myservo.write(zeropos
}

24
For getting the accurate signal or value of the ultrasonic:

void Lap()
{
Sensor = analogRead(A2);
while(Sensor < level)
{
Sensor = analogRead(A2);
}
while(Sensor > level)
{
Sensor = analogRead(A2);
}
// Serial.println(Steps);
}

3.3 Theoretical Analysis of the Proposed System

Upon the successful integration of the modules, the system is

expected to:

Detect faces using MATLABs facial recognition feature

Open the camera and activate the servo motor once the

ultrasonic sensor detects an object

Automatically align the camera to the persons face once

it is detected

Open the door and lights once the person is recognized

Enroll professors and their class schedules using facial

recognition

Provide a push button inside and outside of the

classrooms to manually open the door

25
3.4 Summary

To be able to achieve the desired system, the following

components are needed. The hardware part of the project has a total of 6

modules, namely ultrasonic sensor for the detection of the height of the

subject, solenoid lock used to lock and unlock the door, the camera which

is used to detect the face of the subject for face recognition, the servo

motor for moving the camera up and down which is program to auto align

in the subject for face recognition, push button for the solenoid unlock

inside and outside the room and the photo interrupter for counting of

rotation of the servo motor to align the subject. The software part of the

prototype used Arduino IDE for the sensor, servo, solenoid lock, push

buttons and LED lights. MATLAB for the face recognition, visual basic

for the routines of the system.

26
CHAPTER 4 PERFORMANCE ANALYSIS

4.1 Introduction

This chapter will discuss all the experimentation conducted by the

proponents in order to make the system. The objectives, materials,

analysis, and results that are involved in the system will be discussed in

every experiment.

4.2 Experimental

4.2.1 Experiment 1: Testing of Ultrasonic Sonar Module on Arduino

IDE

Objective:

To check if the ultrasonic sensor is ready to use

Materials and Equipment:

Desktop/Laptop

Ultrasonic Sonar Module (US100)

Serial Port to USB

5V Power

GizDuino ATmega 328 Microcontroller

Procedure:

1. Connect the Ultrasonic module to the Microcontroller.

2. Connect the Microcontroller to the PC/Laptop using the Serial

Port.

27
3. Open Arduino IDE

4. Select the correct port and board (Click Tools Board /

Serial Port)

5. Write the program below:

const int trigger=A1;


const int echo=A0;
float distance;
void setup(){
Serial.begin(9600);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
}
void loop(){
digitalWrite(trigger,LOW);
delayMicroseconds(5);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
distance=pulseIn(echo,HIGH);
distance=distance*0.0001657;
Serial.println(distance);
delay(50);
}

6. Click the to upload the program code to the microcontroller.

7. Click the Serial Monitor on the upper right of the Arduio IDE.

Data and Results:

Figure 4-1 Ultrasonic Sonar Module on Arduino IDE

28
The ultrasonic module connected to the computer terminal

with a serial port connector successfully responded with the

Arduino IDE. The ultrasonic show values base on how far the

signal bounces back.

Findings/Analysis:

The proponents were successful in testing the Ultrasonic if

it is ready for use in a way that it can give values base on how far

the signal bounces back by simply blocking the ultrasonic with an

object large enough to be detected.

4.2.2 Experiment 2: Testing of Photo Interrupter on Arduino IDE

Objective:

To check if the Photo Interrupters state will change from

low to high using LED when blocked

Materials and Equipment:

Desktop/Laptop

Photo Interrupter

Serial Port to USB

5V Power

GizDuino ATmega 328 Microcontroller

LED

29
Breadboard

Connecting Wires

Procedure:

1. Connect the Photo Interrupter to the Microcontroller.

2. Connect the Microcontroller to the PC/Laptop using the Serial

Port.

3. Connect LED to pin 1 of MCU.

4. Open Arduino IDE

5. Select the correct port and board (Click Tools Board /

Serial Port)

6. Write the program below:

int Led = 13 ;// define LED Interface


int buttonpin = 3; // define the photo
interrupter sensor interface
int val ;// define numeric variables val
void setup ()
{
pinMode (Led, OUTPUT) ;// define LED as
output interface
pinMode (buttonpin, INPUT) ;// define the
photo interrupter sensor output interface
}
void loop ()
{
val = digitalRead (buttonpin) ;// digital
interface will be assigned a value of 3 to
read val
if (val == HIGH) // When the light sensor
detects a signal is interrupted, LED
flashes
{
digitalWrite (Led, HIGH);
}
else
{
digitalWrite (Led, LOW);

30
}
}

7. Click the to upload the program code to the microcontroller.

Data and Results:

Blocked? Output
Yes Logic 1
No Logic 0
No Logic 0
Yes Logic 1
Table 4-1 Blocking of Photo Interrupter

The photo interrupter module connected to the computer

terminal with a serial port connector successfully responded with

the Arduino IDE. When the IR is being blocked, the output will

change from logic 0 to logic 1.

Findings/Analysis:

The proponents were successful in conducting the testing of

photo interrupter in the MCU. The photo interrupter can detect the

blockings that had been made.

4.2.3 Experiment 3: Interfacing Solenoid, Camera and Light (LED)

Objectives:

To test if the captured image matches in the database

31
To test if the door will unlock and lights will turn on after

the face is recognized

Materials and Equipment:

Desktop/Laptop

LED

Solenoid

Web Camera

Serial Port to USB

5V Power

GizDuino ATmega 328 Microcontroller

Connecting wires

Procedure:

1. Connect the solenoid to the microcontroller.

2. Connect the microcontroller to the PC/Laptop using the Serial

Port.

3. Connect Camera to laptop.

4. Open Arduino IDE

5. Select the correct port and board (Click Tools Board

/ Serial Port)

6. Compile the program code with filename

Face_Recognition_Entry

32
7. Open MATLAB and run the main.m code of the path:

C:\Users\Jennn\Desktop\ClassRoomAll\ClassRoom

8. Open databaseCTRL in Visual Basic 6.0 and compile the

code.

Data and Results:

Capture Recognized? Solenoid Light (LED) Status


Person 1 Yes Open On SUCCESS
Person 2 Yes Open On SUCCESS
Person 3 Yes Open On SUCCESS
Person 4 Yes Open On SUCCESS
Person 5 Yes Open On SUCCESS
Person 6 Yes Open On SUCCESS
Person 7 Yes Open On SUCCESS
Person 8 Yes Open On SUCCESS
Person 9 Yes Open On SUCCESS
Person 10 Yes Open On SUCCESS
Table 4-2 Interfacing Solenoid, Camera and LED

The Solenoid, Camera and LED connected to the computer

terminal with a serial port connector successfully responded with

the Arduino IDE, MATLAB and Visual Basic. When the face is

captured and recognized, the door will open and light will turn on.

33
Legend:

Person (n); n= Number of user perform the

recognition

Success = Granted Recognition of the user

Computation 4-1

Computing for the Reliability of the system:

where:

x = is the reliability status of the system

S = no. of success of the system

P = no. of entry in the system

Findings/Analysis:

The proponents were successful in interfacing the three

components in Arduino IDE, MATLAB and Visual Basic. The

components work after face is recognized.

4.2.4 Experiment 4: Interfacing Ultrasonic, Servo Motor and Photo

Interrupter

Objective:

To test if the program of the alignment of camera to user is

correct

34
Materials and Equipment:

Desktop/Laptop

Ultrasonic

Servo Motor (S5010)

Photo Interrupter

Serial Port to USB

5V Power

GizDuino ATmega 328 Microcontroller

Connecting Wires

Procedure:

1. Connect the Ultrasonic, Servo Motor and Photo Interrupter to

the Microcontroller.

2. Connect the Microcontroller to the PC/Laptop using the Serial

Port.

3. Open Arduino IDE

4. Select the correct port and board (Click Tools Board /

Serial Port)

5. Write the program below:

Get_Distance();
delay(100);

if(Online)
{
Serial.print("WTADIS,");
Serial.print(distance);

35
Serial.print("\r");
if((Height - distance) > LowerLim) {
countL2 = 40;
if(abs(old_distance - distance) <
5)
{
if(countH2 > 0)
countH2--;
else if(!stat2){
Move();
Serial.print("WTAREADY\r");
stat2 = 1;
}
}
else
{
countH2 = reload2;
old_distance = distance;
}
}
else {
countH2 = reload2;
if(countL2 > 0)
countL2--;
else if(stat2){
Home();
// Serial.print("RESET");
stat2 = 0;
}
}
}

if(digitalRead(Switch1)) {
countL = reload;
if(countH > 0)
countH--;
else if(!stat){
Serial.print("WTAOFF1\r");
stat = 1;
}
}
else {
countH = reload;
if(countL > 0)
countL--;
else if(stat){
Serial.print("WTAON1\r");
// while(1);
stat = 0;
}
}

36
if(digitalRead(Switch2)) {
countL3 = reload3;
if(countH3 > 0)
countH3--;
else if(!stat3){
Serial.print("WTAOFF2\r");
stat3 = 1;
}
}
else {
countH3 = reload3;
if(countL3 > 0)
countL3--;
else if(stat3){
Serial.print("WTAON2\r");
stat3 = 0;
}
}

clearString(Data);
count = 0;
DataComplete = false;
}

if((millis() - interval) >= 300){


//ms
interval = millis();
if(BuzzEn)
{
if(stat5)
{
digitalWrite(Buzzer, LOW);
stat5 = 0;
}
else
{
digitalWrite(Buzzer, HIGH);
stat5 = 1;
}
}
else
digitalWrite(Buzzer, LOW);
}
}

void Move()
{
if((Height - LowerLim - LenghtTotal) >
old_distance)
{
Serial.println("Over Height!!!");
}

37
else
{
StepsF = LowerLim + LenghtTotal +
old_distance - Height;
StepsF = StepsF * StepsTotal /
LenghtTotal;
Steps = StepsF;
// Serial.print(Steps);
// while(1);
//Move
myservo.write(130); //
tell servo to go to position in variable
'pos'
while(Steps)
{
Lap();
// Steps--;
}
myservo.write(zeropos);
// tell servo to go to position in variable
'pos'
}
}

The Ultrasonic, Photo Interrupter and Servo Motor

connected to the computer terminal with a serial port connector

successfully responded with the Arduino IDE and proponents

code. The proponents set the distance difference (old-new) to be

5cm before the system can tell that there is an object/person

detected.

Data and Results:

Auto aligning to
TRIAL STATUS
users face?
1 Yes SUCCESS
2 Yes SUCCESS
3 Yes SUCCESS

38
4 Yes SUCCESS
5 Yes SUCCESS

6 Yes SUCCESS

7 Yes SUCCESS
8 Yes SUCCESS

9 Yes SUCCESS

10 Yes SUCCESS
Table 4-3 Auto Alignment to users face

Legend:

Trial (n); n= Number of try

Success = Granted Recognition of the user.

Computation 4-1

Computing for the Accuracy of the system:

where:

x = is the accuracy status of the system

S = no. of success of the system.

P = no. of entry in the system.

Findings/Analysis:

The proponents were successful in interfacing the three

components in Arduino. The servo motor aligned to the users face

after getting a value smaller than 5cm from ultrasonics distance

value.

39
4.2.5 Experiment 5: Testing of Face Detection
Objective:

To test if the program can recognize the face of a single

person 10 times

Materials and Equipment:

Desktop/Laptop

Web Camera

Serial Port to USB

5V Power

Microcontroller

Procedure:

1. Connect the Camera to the PC/Laptop.

2. Connect the Microcontroller to the PC/Laptop using the Serial

Port.

3. Open Arduino IDE

4. Select the correct port and board (Click Tools Board /

Serial Port)

5. Compile the program code with filename

Face_Recognition_Entry

6. Open Matlab and Run the main.m code of the path:

C:\Users\Jennn\Desktop\ClassRoomAll\ClassRoom

40
7. Open databaseCTRL in Visual Basic 6.0 and compile the

code.

Data and Results:

Input Status
1 SUCCESS
2 SUCCESS
3 SUCCESS
4 SUCCESS
5 SUCCESS
6 SUCCESS
7 SUCCESS
8 SUCCESS
9 SUCCESS
10 SUCCESS
Table 4-3 Recognition of a single user

Computation 4-2

Computing for the Reliability of the system:

where:

x = is the reliability of the project

S = no. of success of a single user

I = no. of face input of a single user stored in

database

41
The camera connected to the computer terminal

successfully responded with the Arduino IDE, MATLAB and

Visual Basic. The single persons recognition is all successful.

Findings/Analysis:

The proponents were successful in interfacing the PCA

algorithm in MATLAB to the system. The recognition of face

works.

4.2.6 Experiment 6: Testing of Face Detection with Login and

Logout

Objective:

To test if the program can record the time of entry and exit of the

user

Materials and Equipment:

Desktop/Laptop

Web Camera

Serial Port to USB

5V Power

Microcontroller

42
Procedure:

1. Connect the Camera to the PC/Laptop.

2. Connect the Microcontroller to the PC/Laptop using the Serial

Port.

3. Open Arduino IDE

4. Select the correct port and board (Click Tools Board /

Serial Port)

5. Compile the program code with filename

Face_Recognition_Entry

6. Open Matlab and Run the main.m code of the path:

C:\Users\Jennn\Desktop\ClassRoomAll\ClassRoom

7. Open databaseCTRL in Visual Basic 6.0 and compile the

code.

Recognized? Log in Recognized? Log out

Yes 11:03:03 AM Yes 12:55:00 PM


Yes 11:10:11 AM Yes 12:59:00 PM
Yes 13:00:12 PM Yes 14:02:15 PM

Table 4-4 Logging of user

The camera connected to the computer terminal

successfully responded with the Arduino IDE, MATLAB and

Visual Basic. The log of the user is successfully created after the

user entered and exited the room.

43
Findings/Analysis:

The proponents were successful in making the program

code for the logging of the user. It automatically records the time

in/out after the recognition of the user only in the allowed time.

4.3 Summary

The experiments and testing done on the modules proved the

hardwares efficiency and effectiveness of producing an accurate results

that uses proper programming and/ algorithm.

Most of the modules have done their functions correctly. The

interactions of a module to the other module is flawless and synchronized

as the proponents designed/planned. Based from the results in the

experiment, the proponents can conclude that the system is 100% working

which is mainly the objective of this project design, thus successes were

clearly obtained.

44
CHAPTER 5 CONCLUSION AND RECOMMENDATION

5.1 Conclusion

The journey of the group upon reaching the success of the project

is not just as hard as others thought but is harder than what the proponents

imagine. To be able to implement a good system, there are things that

must be considered in choosing what is best for the system which will help

especially if it is about the reliability and the accuracy of the project.

The system used an algorithm which are suitable to implement the

set of rules and routines of the project. PCA is one of the example, which

is a technique that chooses the best or strong pattern in the data sheet of

the input. Therefore, face recognition system with automation can be

consider as one of the good example of a reliable source of security.

5.2 Recommendations

Upon working on the design and concept of the system, it is a good

start that the proponents are able to apply the idea of face recognition

system in securing the school laboratories. For the innovation of the

project, the group recommend to put a secret pass for the janitors and

administrators that are coming in and out in the laboratory from time to

time. Aside from having lights to automate once the face are detected, the

proponents also suggest to add the air conditioner and computers as part of

the automation. Being able to apply the following suggestions may help

45
FREA to have a better transformation with a high system reliability and

accuracy.

46
APPENDICES

APPENDIX A: USER MANUAL

Registration:

1. Go in front of the camera (under the ultrasonic sensor).

Figure A-1 The user in front of the system

2. When the camera aligns on the users face, click the Add Professor in

the GUI of the database.

Figure A-2 Adding new professor

47
3. A new box will pop up, enter the information needed. Make sure not

to move for the camera not to go to its starting position again.

Figure A-3 Information of the user

4. After fill up, click register and five photos of the user will be captured.

5. Open the Database file and go to subject to add the professor in to a

specific subject and its time with the use of the ID number given in the

registration of the user.

Figure A-4 Locating the database

48
Figure A-5 Scheduling the user to its specific subject and time

Recognition:

1. After registration process, the user should stand in front of the

prototype (under the ultrasonic sensor).

Figure A-6 In front of prototype

49
2. Same in registration, the camera will align to users face. Make sure

that in the recognition, the user has a schedule on that specific time.

Figure A-7 Auto alignment

Figure A-8 Recognized user

50
Looking for information:

1. In finding the professors information., click the Professor

(See figure A-9)

Figure A-9 Professors Information

2. In finding the log system, click Attendance. (See figure A-10)

Figure A-10 Attendance

51
3. In finding the subjects that has a schedule in the specific room, click

Subjects. (See Figure A-11)

Figure A-11 Subjects

52
APPENDIX B: PROJECT CIRCUIT

Figure B-1 Face Recognition Entry with Automation Schematic Diagram

53
APPENDIX C: FLOW CHART

54
Figure C-1 FREA Flowchart during Face Recognition

55
Figure C-2 FREA Flowchart during Registration

56
APPENDIX D: PROJECT COST

Qty Description Unit Price (PhP) Total Price (PhP)


1 GizDuino ATmega 328 662 662
1 US100 Ultrasonic Sonar 325 325
1 SG5010 Servo Motor 850 850
1 Web Camera 580 580
1 Limit Switch 15 15
1 Solenoid 250 250
1 Transistor N4001 5 5
1 7805 Regulator 30 30
1 Photo Interrupter 140 140
2 LED 3 6
1 Buzzer 15 15
2 Sintra board (1.5mm) 400 800
1 Aluminum (4ft) 120 120
1 Aluminum Pipe (11ft) 825 825
2 Push Button 15 30
1 Desktop Computer 4800 4800
10 Connectors 5 50
1 Adaptor 200 200
2 Stand (Steel) 1000 2000
TOTAL 9703

57
APPENDIX E: DATA SHEET

TOWERPRO SG5010 SERVO MOTOR

Basic Information
Modulation Digital
4.8V: 76.4 oz-in (5.50 kg-cm)
Torque
6.0V: 90.3 oz-in (6.50 kg-cm)
4.8V: 0.19 sec/60
Speed
6.0V: 0.15 sec/60
Weight 1.66 oz (47.0 g)
Length:1.60 in (40.6 mm)
Dimensions Width:0.81 in (20.5 mm)
Height:1.50 in (38.0 mm)
Motor Type 3-pole
Gear Type Plastic
Rotation/Support Dual Bearings

58

Das könnte Ihnen auch gefallen