home automation based on processing of iris …

43
HOME AUTOMATION BASED ON PROCESSING OF IRIS RECOGNITION A final project report Presented to The Faculty of Engineering By Rayhan Mohammad 002201100006 In partial fulfillment Of the requirement of the degree Bachelor of Science in Electrical Engineering President University April 2015

Upload: others

Post on 15-Oct-2021

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

HOME AUTOMATION BASED ON PROCESSING OF IRIS

RECOGNITION

A final project report

Presented to

The Faculty of Engineering

By

Rayhan Mohammad

002201100006

In partial fulfillment

Of the requirement of the degree

Bachelor of Science in Electrical Engineering

President University April 2015

Page 2: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University i

DECLARATION OF ORIGINALITY

I declare that this final project report, entitled “Home automation based on processing of

iris recognition” is my own original piece of work and, to the best of my knowledge and

belief, has not been submitted, either in whole or in part, to another university to obtain a

degree. All sources that are quoted or referred to are truly declared.

Cikarang, Indonesia, April 2015

Rayhan Mohammad

Page 3: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University ii

HOME AUTOMATION BASED ON PROCESSING OF IRIS

RECOGNITION

By

Rayhan Mohammad

002201100006

Approved by

Arthur Silitonga, M,Sc Dr.-Ing. Erwin Sitompul

Final Project Supervisor Head of Study Program

Arthur Silitonga, M,Sc

Final Project Supervisor

Dr.-Ing. Erwin Sitompul

Head of Study Program

Electrical Engineering

Dr.-Ing. Erwin Sitompul

Dean of Faculty of Engineering

Page 4: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University iii

ACKNOWLEDGMENT

Honour to the Only God, the Most Gracious, and the Most Merciful. With whole-hearted

happiness, I finally finished my thesis. This is one of my happiest moments of my

university life. It is as exciting as the first time I went to Electrical Engineering class. All

the restless nights and efforts are finally paid off.

This thesis is dedicated to all people who have given me a lot of support and motivation,

especially for my beloved parents Mr. Afrizal Muslim and Mrs. N.Erliwita who always

give me strength when I need it. They taught me to achieve the best result in every part of

my life and always give the best effort to do so. And also for my sisters, Erfiliza Nuur

Najla and Raina Salsabilla Erlizal who always supports me .

I would also thank my final project supervisor, Mr. Arthur Silitonga, for the continuous

support of my final project, for his encouragement, patience, and immense knowledge. I

also would like to thank Dean of Faculty of Engineering, Mr. Erwin Sitompul, for his

positive inputs and guidance. And all lecturers who have taught me everything I need for

my final project.

I also would like to thank Savitri who always support and accompany me from the start of

my study until the end of this final project. And the last, thanks for my fellow classmates

who also help and assist me with some trouble when I am doing my final project that I

cannot mention one by one.

Cikarang, April 2015,

Rayhan Mohammad

Page 5: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University iv

ABSTRACT

We live in the era of technology, most people helped by machine to do their works, or even

protect them. Because of this, the system of automation is the best choice people have.

With the automation system help and protect their live such as their home, most people

who not responsible are trying to manipulate or hack the system. From this phenomenon

result the idea of implement biometric technology into system automation is come up. The

iris recognition is the key to minimized the system hacking or impersonation because each

people have different iris even for the twin. This project concentrates in designing the

hardware and the software that will work as an integrated system of automatic door lock,

implemented with iris recognition. Through this function, the user will be able to take their

iris and then lock or open it without any physical key.

Keywords: Biometric technology, iris detection and recognition, solenoid lock.

Page 6: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University v

TABLE OF CONTENT

DECLARATION OF ORIGINALITY ................................................................................... i

APPROVAL LETTER .......................................................................................................... ii

ACKNOWLEDGMENT ...................................................................................................... iii

ABSTRACT ......................................................................................................................... iv

TABLE OF CONTENT ........................................................................................................ v

TABLE OF FIGURES ........................................................................................................ vii

CHAPTER 1 INTRODUCTION ........................................................................................... 1

1.1. Final Project Background ........................................................................................ 1

1.2. Problem Statement .................................................................................................. 1

1.3. Final Project Objective ............................................................................................ 2

1.4. Final Project Scopes and Limitations ...................................................................... 2

1.5. Final Project Methodology ...................................................................................... 3

1.6. Final Project Outline ............................................................................................... 4

CHAPTER 2 THEORY ......................................................................................................... 5

2.1. Arduino mega 2560 ................................................................................................. 5

2.2. Liquid Crystal Display ............................................................................................ 8

2.3. Buzzer ..................................................................................................................... 9

2.4. Solenoid Door Lock ................................................................................................ 9

2.5. TIP 120 Transistor ................................................................................................. 10

CHAPTER 3 DESIGN REQUIREMENT, SPECIFICATION AND DEVELOPMENT ... 11

3.1. Requirement .......................................................................................................... 11

3.2. Specification .......................................................................................................... 11

3.3. Hardware Design ................................................................................................... 14

3.3.1. Arduino Mega 2560 .................................................................................. 15

3.3.2. Liquid Crystal Display .............................................................................. 16

3.3.3. Solenoid Lock ........................................................................................... 17

3.4. Software Design .................................................................................................... 17

3.4.1. Segmentation ............................................................................................. 18

Page 7: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University vi

3.4.2. Normalization ............................................................................................ 19

3.4.3. Feature Encoding ...................................................................................... 20

3.4.4. Matching ................................................................................................... 21

3.4.5. Programming Implementation .................................................................. 21

CHAPTER 4 RESULT AND DISSCUSION ...................................................................... 25

4.1. Result .................................................................................................................. 25

4.2. Disscusion ............................................................................................................. 28

CHAPTER 5 CONCLUSION AND RECOMMENDATION ........................................... 29

5.1. Conclusion ............................................................................................................. 29

5.2. Recomendation ...................................................................................................... 29

REFERENCES .................................................................................................................... 30

APPENDIX ........................................................................................................................ 31

Page 8: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University vii

LIST OF FIGURES

Figure 1.1 Image of an eye .................................................................................................... 1

Figure 2.1 Arduino Mega 2560 ............................................................................................. 5

Figure 2.2 Arduino Mega 2560 Pin Configuration ............................................................... 7

Figure 2.3 LCD 2x16 ............................................................................................................. 8

Figure 2.4 LCD Pin Configuration ........................................................................................ 8

Figure 2.5 Buzzer .................................................................................................................. 9

Figure 2.6 Solenoid Lock ...................................................................................................... 9

Figure 2.7 TIP 120 Transistor ............................................................................................. 10

Figure 2.8 TIP 120 Transistor Circuit ................................................................................. 10

Figure 3.1 V-Model of the Design ..................................................................................... 12

Figure 3.2 Block Diagram of Device .................................................................................. 12

Figure 3.3 Matlab R2013a .................................................................................................. 13

Figure 3.4 Flow Chart of Device ........................................................................................ 14

Figure 3.5 Arduino Mega 2560 Circuit .............................................................................. 15

Figure 3.6 LCD Circuit ....................................................................................................... 16

Figure 3.7 Solenoid Circuit ................................................................................................ 17

Figure 3.8 Arduino IDE Program ....................................................................................... 17

Figure 3.9 Segmented Image .............................................................................................. 19

Figure 3.10 Daugman‟s Rubber Sheet Mode ..................................................................... 20

Figure 3.11 Block Diagram Of the Program ...................................................................... 21

Figure 4.1 Automatic Door Lock Using Iris Recognition ................................................... 25

Figure 4.2 Matlab Result ..................................................................................................... 26

Figure 4.3 LCD Standby Mode ........................................................................................... 26

Figure 4.4 Complete Circuit of The device ......................................................................... 27

Figure 4.5 The Confirm Mode of The Device ..................................................................... 27

Figure 4.6 The Unconfirmed Mode of The Device ............................................................. 28

Figure 5.1 The Final Project Achievements ........................................................................ 29

Page 9: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 1

CHAPTER 1

INTRODUCTION

1.1. Final Project Background

Day in and day out we need to prove our identity at various places, for secure access to

buildings, air and rail travel, to cast a vote, etc. Security and the authentication of

individuals are necessary to provide the privacy. Traditionally, we have been using photo-

based identity cards to prove our identity and we have been quite accustomed to it. These

identity cards were augmented/replaced by passwords in many cases. However, these

conventional identity proofs are being replaced by biometric identifications to overcome

many of the shortfalls of these methods. One of the most dangerous security threats is the

impersonation, in which somebody claims to be somebody else. Trend in the identification

& authentication world is headed towards biometrics. Finger prints, face recognition, Iris

Recognition, DNA pattern recognition are replacing printed identity cards. Biometric

identification technology provides a valid alternative to conventional authentication

mechanisms such as ID cards and passwords. Biometric identification technology

identifies an individual based on “who they are (Biometrics)” rather than “what they

possess (passport)” or “what they remember (password)”, and the Iris Recognition is one

of the Biometric Identification technology that is used in this final year‟s project.

1.2. Problem Statement

The iris is a thin circular structure in the eye, responsible for controlling the diameter and

size of the pupil and thus the amount of light reaching the retina. The iris is the blue area.

The other structures visible are the pupil center and the white sclera surrounding the iris.

Figure 1.1 Image of an eye

Page 10: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 2

The iris consists of a number of layers, the lowest is the epithelium layer, which contains

dense pigmentation cells. The stromal layer lies above the epithelium layer, and contains

blood vessels, pigment cells and the two iris muscles. The density of stromal pigmentation

determines the color of the iris. The externally visible surface of the multi-layered iris

contains two zones, which often differ in color.

The iris is divided into two major regions:

The pupillary zone is the inner region whose edge forms the boundary of the pupil.

The ciliary zone is the rest of the iris that extends to its origin at the ciliary body.

The problem is our pupil not always in the same size, our pupil will adapt according to the

light of the environment. If at the low light condition, our pupil will be larger than normal

condition and if at the high light condition our pupil will smaller. It affect also to the size

of the iris, if the pupil larger so that the iris will be smaller and otherwise.

1.3. Final Project Objective

The objective of this project is to design automatic door lock by applying biometric

technology based on iris recognition. The project that will be designed only can be access

by an accepted user and otherwise other user cannot access it and even cannot manipulate

it. This technology will be very useful in the future to prevent impersonation. Another

Objective in this project is to implement Matlab 2013a to process an iris recognition

process and communicate with arduino to do the action according from Matlab result.

1.4. Final Project Scopes and Limitations

The final project will be conducted under the following scopes:

This project discusses about using iris recognition that will apply to the safe box which

includes the interfacing of microcontroller with solenoid lock, LCD, and buzzer.

The programming language that will used and developed by using software MATLAB

r2013a.

In conducting this research, there are several limitations to be considered:

Page 11: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 3

When the MATLAB process the image irises will take a moment until it finish,

because the computer that author use is a normal computer. The problem can solve by

using the faster computer.

The different position of iris will be resulting the error, the fixed position has been

made.

The extreme different of intensity of the light environment will affect the image iris,

recommend to use source the light not directly from the sun light.

1.5. Final Project Methodology

The iris is an externally visible, yet protected organ whose unique epigenetic pattern

remains stable throughout adult life. These characteristics make it very attractive for use as

a biometric for identifying individuals. Image processing techniques can be employed to

extract the unique iris pattern from a digitized image of the eye, and encode it into a

biometric template, which can be stored in a database. This biometric template contains an

objective mathematical representation of the unique information stored in the iris, and

allows comparisons to be made between templates.

When a subject wishes to be identified by iris recognition system, their eye is first

photographed, and then a template created for their iris region. This template is then

compared with the other templates stored in a database until either a matching template is

found and the subject is identified, or no match is found and the subject remains

unidentified.

Procedure of Iris Recognition using camera:

Acquire the image of the eye, which includes the iris.

Defines the boundaries.

Analyzes image data.

Generates pattern data.

Stores the pattern data.

When recognition desired, another image is taken, and pattern data from the image is

matched to the stored data.

Compared with other biometric technologies, such as face, voice and fingerprint

recognition that tend to change over time, iris biometric is stable and remains the same for

Page 12: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 4

a person‟s lifetime, iris recognition can easily be considered as the most reliable form of

biometric technology.

1.6. Final Project Outline

The final project report consists of five chapters and is outlined as follows:

CHAPTER 1: INTRODUCTION. This chapter consist of Final Project background, Final

Project statement, Final Project objective, Final Project scope and limitation, Final Project

methodology, and Final Project outline.

CHAPTER 2: THEORY. This chapter describes about the components used and discusses

their functions.

CHAPTER 3: DESIGN REQUIREMENT, SPECIFICATION AND DEVELOPMENT.

This chapter covers the development of hardware and software.

CHAPTER 4: RESULT AND DISCUSSIONS. This chapter consists of the analysis of the

hardware and software. Simulation result is examined to finally conclude the strength and

weakness of the proposed system.

CHAPTER 5: CONCLUSIONS AND RECOMMENDATIONS. This chapter consists of

conclusions obtained throughout this project and recommendations for future projects.

Page 13: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 5

CHAPTER 2

THEORY

2.1. Arduino mega 2560

A microcontroller is a small computer on a single integrated circuit containing a processor

core, memory, and programmable input/output peripherals. Microcontrollers are used in

automatically controlled products and devices, such as automobile engine control systems,

implantable medical devices, remote controls, office machines, etc. In this project, the

microcontroller that will use is Arduino mega 2560 microcontroller.

Figure 2.1 Arduino Mega 2560

The Arduino Mega 2560 is a microcontroller board based on the ATmega2560. It has 54

digital input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4

UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power

jack, an ICSP header, and a reset button. It contains everything needed to support the

microcontroller; simply connect it to a computer with a USB cable or power it with a AC-

to-DC adapter or battery to get started.

Arduino Mega does not need any voltage regulator and capacitor to be added on the circuit

with the arduino, because the entire component that is needed is already inside the arduino.

The only component that is not attached in arduino is the power source, so that we need to

connect arduino with the USB connection or with power jack.

Page 14: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 6

Arduino Mega 2560 is different from all proceeding boards in that is does not use the FTDI

USB-to-serial driver chip. Here are the features of the Arduino Mega 2560:

1.0 pinout : added SDA and SCL pins that located nearly to the AREF pin and two

other new pins placed near to the RESET pin.

The IOREF exist that allow the shields to adapt to the voltage provide from the board.

Stronger RESET circuit.

2.1.1. Arduino Mega 2560 Pin Configuration

Arduino Mega 2560 has many pin configurations, these pin configuration can be divided

into many parts. There are digital, analog, communication, PWM (Pulse Width

Modulator), Vcc , and Ground. Here are the descriptions of the pin configurations of

Arduino Mega 2560:

a) Power Pin :

3.3V and 5V

The output voltage that can be out from the Arduino Mega 2560, by

connecting the cable each one of the choices of voltage it will give the output

3.3V or 5V.

Ground

Supply Negative Voltage.

Vin

The input voltage that can become the source of the Arduino Mega 2560 if the

user wants to supply the voltage manually using cable, the range of the voltage

is between 7V until 12V.

b) Analog In Pin

Analog In pin on Arduino Mega 2560 is from A0 until A15 which has DC current

40mA per pin. Each of which also provide 10 bits of resolution.

c) Digital Pin

Digital pin on Arduino Mega 2560 is fromP22 until P53. Pin digital only gives the

output of 0 or 1.

Page 15: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 7

d) Communication Pin

Communication pin is displayed as TX , RX, SDA, and SCL. The communication pin

is from TX0 until TX3, RX0 until RX3, SDA, and SCL. Used to received (RX) and

transmit (TX) TTL serial data, the connection between RX and TX is very crucial or

the circuit won‟t working properly. SDA and SCL are the supporting TWO

communication using the wire library.

e) AREF

Aref is a voltage reference pin for the analog inputs. Used with analogReference().

f) PWM Pin

Start from pin 2 until 13, there are 12 pins of PWM provide 8-bit PWM output with

the analogWrite().

g) External Interrupts

Pin 2 (Interrupt 0), Pin 3 (Interrupt 1), Pin 18 (Interrupt 5), Pin 19 (Interrupt 4), Pin 20

(Interrupt 3), and Pin 21 (Interrupt2). These pins can be configured to trigger an

interrupt on a low value, a rising or falling edge, or a change in value.

h) SPI

From pin 50 until 53 is supporting the SPI communication using the SPI library.

i) LED

There is a built-in LED connected to digital pin 13. When the value of this pin HIGH

then the LED will be turn on and when the value of the pin is LOW, the LED will be

turn off.

Figure 2.2 Arduino Mega 2560 Pin Configuration

Page 16: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 8

2.2. Liquid Crystal Display

Liquid Crystal Display (LCD) is an electronic visual display to show characteristic such as

number and letter. This project applies a 2x16 LCD, it requires lines (RS, R/W, EN) and 8

(or 4) data lines. The 8-bit mode is faster than 4-bit mode in processing data from

microcontroller to be displayed. On the other side, applying the 4-bit mode saves more

lines used in microcontroller rather than the applying 8-bit mode.

Figure 2.3 LCD 2x16

Figure 2.4 LCD Pin Configuration

Pin Symbol Function

1 Vss Ground

2 Vdd Supply Voltage

3 Vo Contrast Setting

4 RS Register Select

5 R/W Read/Write

select

6 EN Enable Signal

7 DB0 Data Lines

8 DB1 Data Lines

9 DB2 Data Lines

10 DB3 Data Lines

11 DB4 Data Lines

12 DB5 Data Lines

13 DB6 Data Lines

14 DB7 Data Lines

15 A/Vee GND for

Backlight

16 K Vcc for

Backlight

Page 17: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 9

2.3. Buzzer

A buzzer or beeper is an audio signaling device. Typical uses of buzzers and beepers

include alarm devices, timers and confirmation of user input such as a mouse click or

keystroke and in this project this item will be used for alarm devices.

Figure 2.5 Buzzer

2.4. Solenoid Door Lock

Solenoid door lock is a remote door locking mechanism that latches or opens by means of

an electromagnetic solenoid. In many case, the actual locking mechanism of a solenoid

door lock will be identical to a conventional key-operated example. The only difference

between both is the inclusion of low-voltage solenoid in the mechanism, which pulls the

latch back into the door lock when the push button or other controller is activated. The

latch will then be retained in the door lock for as long as the button is pushed. Otherwise,

the latch will stay out of the door lock until the controller is activated again. Usually, the

solenoid door lock is used in security matters or automotive doors. The solenoid door lock

that will be used in this project is DC 12V linear pull type open frame solenoid lock.

Figure 2.6 Solenoid Lock

Page 18: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 10

2.5. TIP 120 Transistor

The TIP 120 is a NPN Darlington transistor with a current gain of 1000 that is a good

choice for interfacing many higher current or higher voltage loads to an Arduino or other

microcontroller. It can be used to control DC motors, solenoids or strings of LEDs with

minimal current draw from the microcontroller.

Figure 2.7 TIP 120 Transistor

Figure 2.8 TIP 120 Transistor Circuit

Page 19: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 11

CHAPTER 3

DESIGN REQUIREMENT, SPECIFICATION AND

DEVELOPMENT

3.1. Requirement

The main purpose of this final project is to make the high security level device. The

important element that decides the security of the room or house is the door itself. If

anyone can access the door freely, that means the security of the door itself is very low.

This day, some important things can be easy to steal if we cannot keep it carefully. The

idea is to make the lock that can be only opened by the owner without any physical key by

implement the lock using iris recognition.

Iris recognition is one of the most accurate and secure biometric identification. The iris has

a unique characteristic of very little variation over a life‟s period yet multitude of variation

between individuals. Irises not only differ between identical twins, but also the left and

right eye. By using Matlab R2013a author can process the iris recognition and to process

properly, the author must through some steps or procedure. The main steps are

segmentation, normalization, feature encoding, and matching.

The problem is when other person tries to access the lock even if they do not have match

iris, they will force to access it because there is no one guarding the lock. That is why the

author was aware on this condition and took preventive measure. The author set a buzzer to

alarm if something wrong happened. In this project the author using 2 software the

MATLAB R2013a to process the iris image and arduino software IDE to control the

arduino work. In designing and developing the system, the author started with stating the

requirement to the final result using a v-model sketched in figure below.

Page 20: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 12

Figure 3.1 V-Model of the Design

3.2. Specification

The system specification of this project is divided into two classes: hardware design and

software design. Matlab R2013a is applied as to process the iris image and deliver to

arduino on the other hand Arduino Mega 2560 is to receives the input from matlab and

then send output signal to solenoid lock, buzzer, and LCD. The block diagram of the

circuit of the project made by the author is shown in Figure below.

Figure 3.2 Block Diagram of Device

Arduino

Mega

2560

Matlab R2013a

(Iris Recognition)

Solenoid Lock

Buzzer

LCD

Requirement

Specification

Software Hardware

Design Design

Structure

Programming

Component Test Modular test

Integration Integration

System Test

Final Result

Capture the eye

image

Page 21: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 13

The block diagram above shows generally about the components which are used in this

project. Iris Recognition plays its role as the input of the system, whereas the buzzer, LCD,

and Solenoid door lock perform as the output of the system. The arduino itself, which is

Arduino Mega 2560, performs as the brain of the device.

The program that will use in this project is Matlab R2013a to processing the iris image.

Whenever the input receive the new iris, Matlab R2013a will matching the new iris with

the iris database and then delivering the result into arduino to decide what action should be

done by solenoid lock, LCD, and buzzer.

Figure 3.3 Matlab R2013a

Page 22: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 14

START

Figure 3.4 Flow Chart of Device

3.3. Hardware Design

This device need 2 power sources to be worked, to powering the arduino itself the author

using notebook and for solenoid lock using adaptor AC/DC. The solenoid lock can work in

various voltages, with the maximum value of 12V. It can also work below 12V but the

response of the solenoid itself is slower. For the solenoid work very properly or with the

best performance the author using 12V.

Since the solenoid requires higher current than the arduino mega 2560, the author using

transistor TIP 120 to control the current from the solenoid and the arduino. Transistor TIP

120 has 3 pins that needs to connect properly otherwise the transistor not works properly.

ID not accepted

Take the iris

ID

Result

The lock open

ID accepted

Run the Iris

Recognition

Code

Take the iris

Page 23: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 15

3.3.1. Arduino Mega 2560

Arduino Mega 2560 is the main hardware in this project. By using arduino the author can

control all hardware directly and also by using arduino, the author can simplify the amount

of hardware and software development that needed to do in order to get the system

running. On the other side, arduino provides a number of libraries to simplify the

programming of a microcontroller. The author using usb cable to provide power to the

arduino and also to make arduino can communicate later with matlab. The arduino circuit

schematic will be shown in figure below.

Figure 3.5 Arduino Mega 2560 Circuit

1k Ohm

Page 24: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 16

3.3.2. Liquid Crystal Display

Liquid Crystal Display (LCD) is used to show the result of iris recognition to the user. It

requires (RS, R/W, EN) to control lines and 8 (D0-D7) for data lines. The connections to

microcontroller are as follows:

1. RS to pin 12

2. R/W to pin Ground

3. EN to pin 2

4. Data lines D4-D7 to pin 7-10

In total there are 16 pins on LCD but the author only applying 12 pins. Beside the pins

mentioned above the rest are connected to ground, Vcc, and control for control the display

contrast and to apply backlight. The pin VEE is connected to potentiometer to adjust the

brightness of LCD. The interfacing of LCD to Arduino Mega 2560 can be seen in figure

below.

Figure 3.6 LCD Circuit

Page 25: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 17

3.3.3. Solenoid Lock

To control solenoid lock TIP 120 transistor applied to make sure there is no feedback

current to the arduino. The emitter of transistor is connected to the ground, and the base

pins connect to arduino and the collector base is connecting to the ground and VCC of

solenoid lock. The solenoid is powered by 12V of adaptor. The circuit of solenoid to

arduino can be seen in figure below.

Figure 3.7 Solenoid Circuit

3.4. Software design

Matlab will be the main software to process the iris recognition. Through matlab the iris

will be measure and the result will be delivering to arduino to take next action. After the

image sent to arduino, the arduino will process the data and deliver it to the hardware

depend to the result of the matlab because different result will have different action that

arduino will take. The author use arduino software IDE to configure the arduino program.

1k ohm

Page 26: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 18

Figure 3.8 Arduino IDE Program

3.4.1. Segmentation

The first step of iris recognition is dividing the actual iris region in a digital eye image. A

technique is required to isolate and exclude these artifacts as well as locating the circular

iris region. The segmentation stage is critical to the success of an iris recognition system,

since data that is falsely represented as iris pattern data will corrupt the biometric templates

generated, resulting in poor recognition rates. A technique that the author used is the

Hough transform.

The Hough transform is a standard computer vision algorithm that can be used to

determine the parameters of simple geometric objects, such us lines and circles, present in

an image reference. The circular Hough transform can be employed to deduce the radius

and center coordinates of the pupil and iris region. Firstly, an edge map is generated by

calculating the first derivatives of intensity values in an eye image and then thresholding

the result. From the edge map, votes are cast in Hough space for the parameters of circles

passing through each edge point. These parameters are the center coordinates xc and y

c, and

the radius r, which are able to define any circle according to the equation.

(3.1)

A maximum point in the Hough space will correspond to the radius and center coordinates

of the circle best defined by the edge points. The parabolic Hough transform can be used to

Page 27: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 19

detect the eyelids, approximating the upper and lower eyelids with parabolic arcs, which

are represented as

( ( ) ( ) ) (( ) ( ) ) (3.2)

Where controls the curvature, ( ) is the peak of the parabola and is the angle of

rotation relative to the x-axis. Below is example of image that has been process through

segmentation successfully.

Figure 3.9 Segmented Images

3.4.2. Normalization

After the iris region successfully segmented from an eye image, the next step is to fix the

position of the iris region in order to allow comparison. The problems that sometime exist

are the differences of eye image due to the stretching of the iris caused by pupil dilation

from varying levels of illumination, the varying imaging distance, rotation of the camera,

etc. The normalization process will reduce the iris region into the same constant

dimension, so that two photographs of the same iris with different time and condition will

have same characteristic features. A technique that will author used to process the

normalization is Daugman‟s rubber sheet model.

Page 28: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 20

Figure 3.10 Daugman’s Rubber Sheet Model

The center of the pupil was considered as the reference point, and radial vectors pass

through the iris region. A number of data points are selected along each radial line and this

is defined as the radial resolution. The number of radial lines going around the iris region

is defined as the angular resolution. Since the pupil can be changing, a remapping formula

is needed to rescale points depending on the angle around the circle.

√ √ (3.3)

With

(3.4)

(

) (3.5)

Where displacement of the center of the pupil relative to the center of the iris is given by

, , and is the distance between the edge of the pupil and edge of the iris at an

angle, around the region, and is the radius of the iris. The remapping formula first

gives the radius of the iris region „doughnut‟ as a function of the angle .

3.4.3. Feature encoding

After an eye image through process segmentation and normalization, the image of iris

should be processed by feature encoding and after that the iris template will be the final

result and also become iris database. A technique that author will be used is Log-Gabor

filter.

The log-Gabor filter is filter that has been improved from the original one, Gabor filter.

The advantage of this filter is that it better fits the statistics of natural image. The log-

Page 29: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 21

Gabor filter has been shown to be particularly useful in image processing applications,

because it has been shown to better capture statistics of natural images. The other

advantage by using the log-Gabor filter is zero DC components can be obtained. The

frequency response of the log-Gabor filter is given as

(3.6)

Where represents the center frequency, and gives the bandwith of the filter.

3.4.4. Matching

A technique that author will be used for compare between 2 iris image is the hamming

distance. It gives a measure of how many bits are the same between two bit patterns. In

comparing the bit patterns X and Y, the hamming distance is defined as the sum of

disagreeing bits over N, the total number of bits in the bit pattern.

(3.7)

If two images of iris are completely different, the hamming distance between the two

patterns should close to equal 0.49. This occurs because independence implies the two bit

patterns will be totally random. Therefore, half of the bits will agree and other half will

disagree. If between the two images are from same iris, the hamming distance will be close

to 0.0 since are highly correlated and the bits should agree between the two iris codes.

3.3.5. Programming Implementation

Figure 3.11 Block Diagram of Program

With help the MATLAB R2013a all of the techniques of iris recognition will be combining

into one program and later the author only use it to control the lock. Here are the main

code after the combining all of the techniques of iris recognition.

SSSegmentation Normalization Feature Encoding

Matching

Page 30: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 22

function [status] = Main (eyeimage_filename) [template1] = cell2mat(struct2cell(load('mask1.mat','template'))); [mask1] = cell2mat(struct2cell(load('mask1.mat','mask'))); [template2, mask2] = createiristemplate(eyeimage_filename); scales = 1; hd = gethammingdistance(template1, mask1, template2, mask2, scales)

ID = hd *100 answer=1; % this is where we'll store the user's answer arduino=serial('COM3','BaudRate',9600); % create serial communication

object on port COM3 fopen(arduino); % initiate arduino communication answer=input('<<ENTER ID>>'); % ask ID fprintf(arduino,'%s',char(answer)); % send answer variable content to

arduino fclose(arduino); % end communication with arduino

The explanation about the code above is after all is very easy to understand. Basically,

before the author run this code to process the iris recognition the author must make a

template of his iris and later the template will become the database and the new iris will be

compare with it. After the new iris come and be compared with the database, the next step

is hamming distance will measure the differences between the database and the new one.

After hamming distance measure the differences, it will produce the ID of the person. Each

person has different ID because it is from iris of the user. And later the ID will be delivered

to arduino to do the next action that should be taken.

The second software that the author uses is programmed by using Arduino Development

Environment (IDE) and its code libraries. This development environment is written in

Java. The core libraries are written in C and C++. Here the main code of arduino that

author uses.

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 2, 7, 8, 9, 10);

int BUZZER = 11;

int LOCK = 14;

int matlabData;

void setup() {

Serial.begin(9600);

lcd.begin(2, 16);

lcd.print(" Hi!");

lcd.setCursor(0, 1);

Page 31: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 23

lcd.print(" SHOW THE EYE");

pinMode(LOCK, OUTPUT);

pinMode(BUZZER, OUTPUT);

}

void loop() {

if (Serial.available() > 0)

{

matlabData = Serial.read();

if (matlabData < 39) { //data confirm

delay(200);

Match();

}

else { //data not confirm

delay(200);

NoMatch();

}

}

}

void Match()

{

digitalWrite(LOCK, HIGH); //Lock open

lcd.begin(2, 16);

lcd.print("WELCOME");

lcd.setCursor(0, 1);

lcd.print("RAYHAN");

delay (5000);

digitalWrite(LOCK, LOW); //Lock closed

lcd.begin(2, 16);

lcd.print(" Hi!");

lcd.setCursor(0, 1);

lcd.print(" SHOW THE EYE");

}

void NoMatch()

{

lcd.begin(2,16);

lcd.print("NOT");

lcd.setCursor(0, 1);

lcd.print("MATCHED");

digitalWrite(BUZZER, HIGH); //Buzzer on

delay(500);

digitalWrite(BUZZER, LOW);

delay(500);

digitalWrite(BUZZER, HIGH);

delay(500);

digitalWrite(BUZZER, LOW);

delay (2000);

Page 32: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 24

lcd.begin(2,16);

lcd.print(" Hi!");

lcd.setCursor(0, 1);

lcd.print(" SHOW THE EYE");

}

The basic explanation of the code is, if the arduino get the confirmed data from matlab, the

arduino will show the owner name at the LCD display and open the lock in same time and

after 5 second the lock will automatically closed and then the device will back to standby

condition. If the arduino get the unconfirmed data, the arduino will show the warning

massage at the LCD and the buzzer turn on without open the lock and after 2 second the

device will back to standby condition.

Page 33: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 25

CHAPTER 4

RESULT AND DISSCUSIONS

4.1. Result

This project result in a small miniature of box with a hole on the right side to put the cable

inside the box and on the outer right side of the box is consist of all component hardware

that author used in this project. Below is shown the complete device of automatic door lock

using iris recognition.

Figure 4.1 Automatic Door Lock Using Iris Recognition

After the author take the image of iris, the matlab will process the iris recognition

procedure. After the image has been processed by iris recognition the matlab will give the

Hamming Distance value and then convert it into ID and later matlab will deliver the ID

into arduino Mega 2560. Below is shown the result of MATLAB that resulting the

Hamming Distance value and convert it into ID.

Page 34: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 26

Figure 4.2 Matlab Result

When the device is in standby condition or the device not receive any input, the lock will

remain closed. Below is shown the LCD standby mode condition. In the standby condition

all hardware will remain not working except the LCD.

Figure 4.3 LCD Standby Mode

Page 35: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 27

The author using 2 power sources in this device. Computer usb port to powering and also

make the matlab communicate with arduino and the second power using adaptor 12V to

powering solenoid lock. In the below figure is shown the complete circuit of the device.

Figure 4.4 Complete Circuit of The device

After matlab process the image of iris, the data will send to arduino and if the data is

confirm, the arduino will open the lock with trigger the buzzer. And if the arduino get the

unconfirmed data, the arduino will show the LCD and trigger the buzzer. Below is example

if there is a confirmed data, the LCD will greet the owner and the lock will be opened.

Figure 4.5 The Confirm Mode of The Device

Adaptor 12V

USB Serial

Page 36: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 28

An if there is a not confirmed data come up, the arduino will trigger the buzzer and LCD

will give a warning massage to the user without opening the lock. Below is example of

uncofirmed data condition.

Figure 4.6 The Unconfirmed Mode of The Device

4.2. Discussions

The strengths of the proposed system in this project are:

The lock cannot be controlled directly by other user, but the lock only can be control

with the owner by using the iris, it is much improved compare with manual lock using

physical key that can be manipulate easily.

The weaknesses of the proposed system in this project are:

The process of iris recognition will take a moment due to the speed of the computer

that author use. The bigger resolution of the image, the longer time will be taken to

process the iris recognition.

A margin of error still can be found in the future. The code that author develop not

100% accurate, it because the camera that author used is not especially use to iris

recognition. From the 10 times trial there are 3 times error can be found.

The difference position of iris will be resulting different calculation or error, the best

solution is to fixed the iris position.

Page 37: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 29

CHAPTER 5

CONCLUSION AND RECOMMENDATION

5.1. Conclusion

In this final project, an automatic door lock using iris recognition has been built. This

device achieves the objectives of this project by having the following abilities:

Objective Conclusion

Build automatic door lock using iris

recognition

The automatic door lock using iris

recognition has been built and running

well.

Implement Matlab to process iris

recognition and try communicating with

arduino.

The communication between Arduino with

MATLAB for processing iris recognition is

successfully implemented.

Figure 5.1 The Final Project Achievements

In conclusion, the automatic door lock using iris recognition is working well. From 10

times trial to capture the iris, the device works with 7 times success and 3 errors and the

objective of this project is achieved.

5.2. Recommendation

Some developments can be made to improve the iris recognition performance in future:

1. Applying GUI (Graphic User Interface) is the best improvement that can be made to

simplify the interface of iris recognition software.

2. Using computer with high speed clock to speed up the process of iris recognition.

3. Applying at least the camera with 1 megapixels of the lens for more accurate result of

iris recognition.

Page 38: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 30

REFERENCES

[1] Arduino Mega 2560 datasheet by RS components, 2009.

[2] Libor Masek, Peter Kovesi. MATLAB Source Code for a Biometric Identification

System Based on Iris Patterns. The School of Computer Science and Software

Engineering, The University of Western Australia. 2003.

[3] Matlab support to arduino package. Retrieved January 2015 from

http://www.mathworks.com/matlabcentral/fileexchange/47522.

[4] A database of eye images by Chinese Academy of Sciences, 2004.

[5] Arduino release notes. Retrieved February 2013 from

http://arduino.cc/en/Main/ReleaseNotes

[6] Build and sketch the circuit software. Retrieved on January 2015 from

http://fritzing.org/home/

[7] Matlab R2013a software. Retrieved on December 2014 from

http://www.mathworks.com/matlabcentral/fileexchange/?s_tid=gn_mlc_fx

[8] Solenoid door lock specification by sourcing map, 2010.

[9] Specification for LCD datasheet by engineers garage, 2009.

[10] Iris recognition/ detection by engineers garage articel, 2012.

[11] Controlling solenoid lock from arduino. Retrieved on January 2015 from

http://www.instructables.com/id/Controlling-solenoids-with-arduino/

Page 39: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 31

APPENDIX

Matlab code

function [template, mask] = createiristemplate(eyeimage_filename)

% path for writing diagnostic images global DIAGPATH DIAGPATH = 'diagnostics';

%normalisation parameters radial_res = 20; angular_res = 240; % with these settings a 9600 bit iris template is % created

%feature encoding parameters nscales=1; minWaveLength=18; mult=1; % not applicable if using nscales = 1 sigmaOnf=0.5;

eyeimage = imread(eyeimage_filename); checksize=size(eyeimage,3);

if (checksize >1); eyeimage= eyeimage(:,:,1); % eyeimage(:,:,1) =

0.2126*eyeimage(:,:,1)+0.7152*eyeimage(:,:,2)+0.0722*eyeimage(:,:,3); % eyeimage(:,:,2) = eyeimage(:,:,1); % eyeimage(:,:,3) = eyeimage(:,:,1); % eyeimage= rgb2gray(eyeimage); end eyeimage= imcomplement(eyeimage); eyeimage= imfill(eyeimage); eyeimage= imcomplement(eyeimage);

% savefile = [eyeimage_filename,'-houghpara.mat']; % [stat,mess]=fileattrib(savefile);

% if stat == 1 % if this file has been processed before % then load the circle parameters and % noise information for that file. % load(savefile);

% else

% if this file has not been processed before % then perform automatic segmentation and % save the results to a file

[circleiris circlepupil imagewithnoise] = segmentiris(eyeimage); save('circleiris','circlepupil','imagewithnoise');

Page 40: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 32

% end

% WRITE NOISE IMAGE %

imagewithnoise2 = uint8(imagewithnoise); imagewithcircles = uint8(eyeimage);

%get pixel coords for circle around iris [x,y] =

circlecoords([circleiris(2),circleiris(1)],circleiris(3),size(eyeimage)); ind2 = sub2ind(size(eyeimage),double(y),double(x));

%get pixel coords for circle around pupil [xp,yp] =

circlecoords([circlepupil(2),circlepupil(1)],circlepupil(3),size(eyeimage

)); ind1 = sub2ind(size(eyeimage),double(yp),double(xp));

% Write noise regions imagewithnoise2(ind2) = 255; imagewithnoise2(ind1) = 255; % Write circles overlayed imagewithcircles(ind2) = 255; imagewithcircles(ind1) = 255; w = cd; cd(DIAGPATH); imwrite(imagewithnoise2,[eyeimage_filename,'-noise.jpg'],'jpg'); imwrite(imagewithcircles,[eyeimage_filename,'-segmented.jpg'],'jpg'); cd(w);

% perform normalisation

[polar_array noise_array] = normaliseiris(imagewithnoise,

circleiris(2),... circleiris(1), circleiris(3), circlepupil(2), circlepupil(1),

circlepupil(3),eyeimage_filename, radial_res, angular_res);

% WRITE NORMALISED PATTERN, AND NOISE PATTERN w = cd; cd(DIAGPATH); imwrite(polar_array,[eyeimage_filename,'-polar.jpg'],'jpg'); imwrite(noise_array,[eyeimage_filename,'-polarnoise.jpg'],'jpg'); cd(w);

% perform feature encoding [template mask] = encode(polar_array, noise_array, nscales,

minWaveLength, mult, sigmaOnf);

Page 41: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 33

Arduino code

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 2, 7, 8, 9, 10);

int BUZZER = 11;

int LOCK = 14;

int matlabData;

void setup() {

Serial.begin(9600);

lcd.begin(2, 16);

lcd.print(" Hi!");

lcd.setCursor(0, 1);

lcd.print(" SHOW THE EYE");

pinMode(LOCK, OUTPUT);

pinMode(BUZZER, OUTPUT);

}

void loop() {

if (Serial.available() > 0)

{

matlabData = Serial.read();

if (matlabData < 39) {

delay(200);

Page 42: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 34

Match();

}

else { //data not confirm

delay(200);

NoMatch();

}

}

}

void Match()

{

digitalWrite(LOCK, HIGH); //Lock open

lcd.begin(2, 16);

lcd.print("WELCOME");

lcd.setCursor(0, 1);

lcd.print("RAYHAN");

delay (5000);

digitalWrite(LOCK, LOW); //Lock closed

lcd.begin(2, 16);

lcd.print(" Hi!");

lcd.setCursor(0, 1);

lcd.print(" SHOW THE EYE");

Page 43: HOME AUTOMATION BASED ON PROCESSING OF IRIS …

President University 35

}

void NoMatch()

{

lcd.begin(2,16);

lcd.print("NOT");

lcd.setCursor(0, 1);

lcd.print("MATCHED");

digitalWrite(BUZZER, HIGH); //Buzzer on

delay(500);

digitalWrite(BUZZER, LOW);

delay(500);

digitalWrite(BUZZER, HIGH);

delay(500);

digitalWrite(BUZZER, LOW);

delay (2000);

lcd.begin(2,16);

lcd.print(" Hi!");

lcd.setCursor(0, 1);

lcd.print(" SHOW THE EYE");

}