Professional Documents
Culture Documents
with the safety of things inside the rooms especially with their valuables.
places. In doing this, the personnel who are in charge in a particular room
require security because of the high cost of the equipment like networking
high. It may also lead to the expensive equipment being stolen and
1
1.2 Current State of Technology
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
absent or late.
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
the system
the user
the system
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
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
and user should stand still during the face recognition process.
4
CHAPTER 2 RELATED THEORIES
2.1 Introduction
the proponents used in building the system. The idea of knowing the
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.
acoustic wave beyond the upper range of human hearing called the audible
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,
to solve even the most complex tasks involving object detection or level
5
wave, ultrasonic sensors use a vibrating device known as a transducer to
the sound waves transmit for progressively longer distances. Thus, long-
contact sensing of solid and liquid objects. For many applications, such as
sensors are available in several sensing ranges and styles with either an
Their high resolution and small blind zones ensure top precision.
a switching and an analogue design, they can reliably detect and count
6
transparency, reflection properties, and surface texture of the object, it is
control the rotation of the will, as the motor rotates, the potentiometers
resistance changes, so the control unit circuit can precisely regulate how
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
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
alternating current but do not operate well at low speeds ,it is expensive
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
Since the method involves light blocking ROHM calls this device a photo
8
while a single phototransistor and photo IC are integrated for light
detection.
2.5 HD Camera
can stored and share it to other people. The images may be individual
The word camera comes from camera obscura, which means "dark
chamber" and is the Latin name of the original device for projecting an
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
sensor or photographic film. All cameras use the same basic design: light
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
display (LCD), permits the user to view scene to be recorded and settings
film. Video and digital cameras use an electronic image sensor, usually
capture moving images in special effects work and many modern cameras
10
2.6 Limit Switch
have been exceeded. When an object meets the actuator, the limit switch
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.
ICs are low power but it is also the same functions of Atmega168/328 IC.
12
2.9 Solenoid Lock
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
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
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.
13
2.10 Light Emitting Diode (LED)
light sources can produce coherent light, as in laser diodes. Other devices
form display units. Liquid crystal projectors have made a major impact on
2.11 MATLAB
14
implementation of algorithms, creation of user interfaces, and interfacing
and Python.
15
Figure 2-11 MATLAB Environment
language and integrated development environment (IDE) from Microsoft for its
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
Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls
and objects.
16
Figure 2-12 Microsoft Visual Basic Environment
separately.
17
2.15 Summary
explained with their uses in this chapter. The following parts are needed in
making the project complete. There are things that the proponents had
will work as part of the project was determined. These components are
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
death.
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
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
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
getting the values the microcontroller will control the servo motor
The Servo Motor SG5010 will only move after the height is
20
3.2.1.4 Photo Interrupter
the right side and Infrared Detector on the left side. Basically the
stop.
3.2.1.5 HD Camera
Motor in case it goes beyond the given path also preventing the
21
3.2.2 The Software
3.2.2.1 MATLAB
"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
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
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
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'
}
}
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);
}
expected to:
Open the camera and activate the servo motor once the
it is detected
recognition
25
3.4 Summary
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
26
CHAPTER 4 PERFORMANCE ANALYSIS
4.1 Introduction
analysis, and results that are involved in the system will be discussed in
every experiment.
4.2 Experimental
IDE
Objective:
Desktop/Laptop
5V Power
Procedure:
Port.
27
3. Open Arduino IDE
Serial Port)
7. Click the Serial Monitor on the upper right of the Arduio IDE.
28
The ultrasonic module connected to the computer terminal
Arduino IDE. The ultrasonic show values base on how far the
Findings/Analysis:
it is ready for use in a way that it can give values base on how far
Objective:
Desktop/Laptop
Photo Interrupter
5V Power
LED
29
Breadboard
Connecting Wires
Procedure:
Port.
Serial Port)
30
}
}
Blocked? Output
Yes Logic 1
No Logic 0
No Logic 0
Yes Logic 1
Table 4-1 Blocking of Photo Interrupter
the Arduino IDE. When the IR is being blocked, the output will
Findings/Analysis:
photo interrupter in the MCU. The photo interrupter can detect the
Objectives:
31
To test if the door will unlock and lights will turn on after
Desktop/Laptop
LED
Solenoid
Web Camera
5V Power
Connecting wires
Procedure:
Port.
/ Serial Port)
Face_Recognition_Entry
32
7. Open MATLAB and run the main.m code of the path:
C:\Users\Jennn\Desktop\ClassRoomAll\ClassRoom
code.
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:
recognition
Computation 4-1
where:
Findings/Analysis:
Interrupter
Objective:
correct
34
Materials and Equipment:
Desktop/Laptop
Ultrasonic
Photo Interrupter
5V Power
Connecting Wires
Procedure:
the Microcontroller.
Port.
Serial Port)
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;
}
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'
}
}
detected.
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:
Computation 4-1
where:
Findings/Analysis:
value.
39
4.2.5 Experiment 5: Testing of Face Detection
Objective:
person 10 times
Desktop/Laptop
Web Camera
5V Power
Microcontroller
Procedure:
Port.
Serial Port)
Face_Recognition_Entry
C:\Users\Jennn\Desktop\ClassRoomAll\ClassRoom
40
7. Open databaseCTRL in Visual Basic 6.0 and compile the
code.
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
where:
database
41
The camera connected to the computer terminal
Findings/Analysis:
works.
Logout
Objective:
To test if the program can record the time of entry and exit of the
user
Desktop/Laptop
Web Camera
5V Power
Microcontroller
42
Procedure:
Port.
Serial Port)
Face_Recognition_Entry
C:\Users\Jennn\Desktop\ClassRoomAll\ClassRoom
code.
Visual Basic. The log of the user is successfully created after the
43
Findings/Analysis:
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
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
must be considered in choosing what is best for the system which will help
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
5.2 Recommendations
start that the proponents are able to apply the idea of face recognition
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
Registration:
2. When the camera aligns on the users face, click the Add Professor in
47
3. A new box will pop up, enter the information needed. Make sure not
4. After fill up, click register and five photos of the user will be captured.
specific subject and its time with the use of the ID number given in the
48
Figure A-5 Scheduling the user to its specific subject and time
Recognition:
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.
50
Looking for information:
51
3. In finding the subjects that has a schedule in the specific room, click
52
APPENDIX B: PROJECT CIRCUIT
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
57
APPENDIX E: DATA SHEET
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