Sunteți pe pagina 1din 78

MICROCONTROLLER-BASED LOCK USING COLOUR SECURITY CODE

THEN DAO HUI

UNIVERSITI TEKNOLOGI MALAYSIA

PSZ 19:16 (Pind. 1/07)

UNIVERSITI TEKNOLOGI MALAYSIA


DECLARATION OF THESIS / UNDERGRADUATE PROJECT PAPER AND COPYRIGHT
Authors full name : Date of birth :

THEN DAO HUI 14th MARCH 1989

Title

MICROCONTROLLER-BASED LOCK USING COLOUR


SECURITY CODE

Academic Session :

2012/2013

I declare that this thesis is classified as :

CONFIDENTIAL RESTRICTED OPEN ACCESS

(Contains confidential information under the Official Secret Act 1972)* (Contains restricted information as specified by the organization where research was done)* I agree that my thesis to be published as online open access (full text)

I acknowledged that Universiti Teknologi Malaysia reserves the right as follows: 1. The thesis is the property of Universiti Teknologi Malaysia. 2. The Library of Universiti Teknologi Malaysia has the right to make copies for the purpose of research only. 3. The Library has the right to make copies of the thesis for academic exchange. Certified by

SIGNATURE

SIGNATURE OF SUPERVISOR

890314-01-5369
(NEW IC NO. /PASSPORT NO.) Date : 7
th

Prof. Dr. Johari Halim Shah NAME OF SUPERVISOR Osman


Date : 7
th

June 2013

June 2013

NOTES :

If the thesis is CONFIDENTAL or RESTRICTED, please attach with the letter from the organization with period and reasons for confidentiality or restriction.

"I hereby declare that I have read this report and in my opinion this report is sufficient in terms of scope and quality for the award of the degree of Bachelor of Electrical Engineering (Mechatronic)

Signature Name Date

: : Prof. Dr. Johari Halim Shah bin Osman : June 7th, 2013

MICROCONTROLLER-BASED LOCK USING COLOUR SECURITY CODE

THEN DAO HUI

A thesis submitted in partial fulfillment of the requirements for the award of the degree of Bachelor of Electrical Engineering (Mechatronic)

Faculty of Electrical Engineering Universiti Teknologi Malaysia

JUNE 2013

ii

I declare that this thesis entitled "MICROCONTROLLER-BASED LOCK USING COLOUR SECURITY CODE" is the result of my own research except as cited in the references. The thesis has not been accepted for any degree and is not concurrently submitted in candidature of any other degree.

Signature Name Date

: : : THEN DAO HUI June 7th, 2013

iii

Special dedicated, in appreciative attitude for the supports, encouragement and caring to my beloved parents, siblings and friends.

iv

ACKNOWLEDGEMENT

First and foremost, I would like to thank my supervisor, Prof. Dr. Johari Halim Shah bin Osman for the unfailing supports and pointed guidance given all along my final year project. Prof. Johari had giving me a lot of advice and consultation in completing the project.

Besides, I would like to express my appreciation to my family who for their whole-hearted supports during my study in university. Without their encouragement and supports, both financial and mental, I would not have gone this far. Thanks for their tolerances and understanding shown during my project.

Last but not least, a special thanks to my friends who have selflessly shared the opinions and useful information as well as the technical supports to me in order to complete the project.

ABSTRACT

Nowadays, lock has evolved into the security device that embedded with the microcontroller which is usually named electronic lock. There are several authentication methods for the electronic lock and the password based electronic lock are the most ubiquitous and cheapest among them. However, there are some drawbacks for this type of lock. This colour security code lock is designed to overcome those drawbacks. It is a microcontroller based lock which using the colour sequence code as password to unlock the system. An Arduino mega 2560 R3 is used as the brain of the electronic locking mechanism. A semi-transparent keypad equipped with RGB LEDs is used to provide user as an end peripheral to insert the code. Meanwhile, a Graphic Liquid Crystal Display (GLCD) is used as a platform for the system to exhibit its condition and status as well as to allow user to select the desired menu option. A vehicle power lock is chosen to perform the locking mechanism in this project. The colour of the keypad buttons is changing randomly during the code inserting process to provide an unfixed button. User is required to key in the correct colour sequence in order to unlock of the system. Three accounts are provided for the user to set their owned combination of code. The Arduino IDE is used to develop and boot the programming code into the project. Generally, this colour security code lock is able to increase the security level as compared to the ordinary password based lock, since the sequence of buttons to key in the security code is not fixed and security code is not based on alpha numeric numbers.

vi

ABSTRAK

Kebelakangan ini, teknologi mangga berkembang dengan pesat. Alat mangga yang terbenam dengan mikropengawal dapat dikesan di pasaran dan biasanya ia dikenali sebagai mangga elektronik. Terdapat beberapa jenis cara pengesahan bagi mangga elektronik, dimana manga jenis kata laluan adalah jenis yang paling terkenal dan murah. Walaubagaimanapun, terdapat beberapa kelemahan untuk manga jenis kata laluan ini. Bagi mengasai kelemahan ini, mangga jenis kod warna direka. Ia berasaskan mikropengawal dan menggunakan urutan kod warna sebagai kata laluan untuk process login. Arduino mega 2560 R3 digunakan sebagai otak dalam system ini untuk memanipulasi dan memproses isyarat input dan output. Papan litar bercetak kekunci separa telus yang dilengkapi dengan RGB LED digunakan untuk memasukkan kod. Selain itu, Liquid Crystal Display bergrafik (GLCD) digunakan sebagai platform untuk menunjukkan status system ini dan membenarkan pengguna untuk memilih pilihan menu yang dikehendaki. Mangga kuasa dipilih untuk mewakili mekanisme penguncian dalam projek ini. Warna butang kekunci berubah secara rawak semasa proses pemasukan kod. Pengguna dikehendaki memasukkan kod mengikut urutan warna yang betul untuk mengakses ke dalam system ini. Tiga akaun disediakan dalam system ini, pengguna boleh mengudahsuai kod yang sedia ada dengan kod baru. Perisian bernama Arduino IDE digunakan dalam penyedian kod pengaturcaraan bagi projek ini. Secara umumnya, mangga jenis kod warna ini dapat meningkatkan tahap keselamatan berbanding dengan mangga jenis kata laluan yang biasa. Hal ini disebabkan mangga jenis kod warna tiada warna butang yang tetap dan tidak menggunakan nombor untuk kata laluan.

vii

TABLE OF CONTENTS

CHAPTER

TITLE

PAGE

DECLARATION DEDICATION ACKNOWLEDGEMENT ABSTRACT ABSTRAK TABLE OF CONTENTS LIST OF TABLES LIST OF FIGURES LIST OF ABBREVIATIONS LIST OF APPENDICES

ii iii iv v vi vii x xi xiii xiv

INTRODUCTION 1.1 1.2 1.3 1.4 1.5 Background Objective of Project Scope of Project Thesis Outline Summary of Works 1 2 3 3 3

LITERATURE REVIEW 2.1 2.2 Introduction Authentication methods 2.2.1 2.2.2 2.2.3 Password Type Token Type Biometric Type 7 8 8 9 9

viii

2.3

Existing Modal of Security System 2.3.1 2.3.2 2.3.3 2.3.4 Security System using Password Security System using Token Security System using Biometric Others Security System

10 11 12 13 13 14 16 18 20 21

2.4 2.5 2.6 2.7 2.8

Drawbacks of each authentication method Color Colour Authentication System Random Keypad System Arduino 2.8.1 Arduino Mega 2560 R3

22 24

2.9

The Key Scanning Concept

METHODOLOGY 3.1 Hardware 3.1.1 Microcontroller Part 3.1.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 Serial peripheral Interface (SPI) 25 26 26 28 29 32 34 35

Keypad Part Controller Interface Parts Lock Interface Board Electric Lock Part Graphic Liquid Crystal Display (GLCD) Shield

3.2

Software 3.2.1 3.2.2 3.2.3 Algorithm for Color Code Verification Algorithm for Menu Programming Code

35 35 37 39

RESULT AND DISCUSSION 4.1 Result 4.1.1 4.1.2 4.2 Keypad Colour Operation 44 45 45 48

Discussion

ix

4.2.1 4.2.2 4.2.3 4.2.4

Control of RGB LED Number of Available Buttons colour True Random Number Multiple Jumper Wires on Keypad Interface Board

48 49 50 51

4.2.5

Keypad Brightness

51

CONCLUSION 5.1 5.2 Conclusion Recommendation 53 54

REFERENCES

56

APPENDICES A

61

LIST OF TABLES

TABLE NO. 1.1 1.2 3.1 4.2 4.1

TITLE Gantts Chart and Milestone for FYP1 Gantts Chart and Milestone for FYP1 Resistance value for the potentiometer set Default code settings for each account Colour Chart

PAGE 5 6 42 47 48

xi

LIST OF FIGURES

FIGURE NO. 1.1 1.2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11

TITLE Project flow for FYP1 Project flow for FYP2 Password Based System Token based system Types of token Types of biometric information Example of iris biometric lock Result of colour combination traced by human eye Colour combination chart Pass-Color System The ColorLogin Scheme keypad of the ScramblePad from HIRSCH Operation flow of the Swivel PINSAFE Input output connection of Atmega 2560 Overview of the project Arduino Mega 2560 R3 board SPI connection and SPI data transferring diagram Silicon rubber keypad and internal keypad PCB Layout of the keypad First design of the controller interface board Digital potentiometer sent from RS Component First version of keypad interface board Second version of keypad interface board Circuit diagram for Toshiba optocoupler Signal flow diagram for power lock connection

PAGE 4 4 8 9 9 10 10 17 17 19 19 20 21 24 25 26 27 28 29 30 31 31 31 33 33

xii

3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19

Schematic diagram for lock interface board Program flowchart of the system Algorithm for whole program Algorithm for code changing process SPI control register (SPCR) and the setting condition Data transferring mode for SPI Program flowchart of key scanning part Programming concept for joystick input of GLCD shield

34 36 38 38 40 40 41 43

4.1 4.2 4.3 4.4 4.5 4.6 4.7

Colour security code lock System process display Connection of RGB LED 10 available colours for button First colour combination after reset for twice attempt Position of the boards Colour keypad without and with casing

44 47 49 50 50 51 52

xiii

LIST OF ABBREVIATIONS

DSP DVD EEPROM FPGA GLCD IC IDE LCD LED MISO MOSI MSTR PCB PIC PWM RFID RISC SCK SPI SS USB

Digital Signal Processing Digital Video Disc Electrically Erasable Programmable Read-Only Memory Field Programmable Gate Array Graphic Liquid Crystal Display Integrated Circuit Integrated Development Environment Liquid Crystal Display Light Emitting Diode Master In Slave Out Master Out Slave In Master Printed Circuit Board Peripheral Interface Controller Pulse Width Modulation Radio Frequency Identification Reduced Instruction Set Computing Serial Data Clock Serial Peripheral Interface Slave Select Universal Serial Bus

xiv

LIST OF APPENDICES

APPENDIX A

TITLE Arduino Mega 2560 schematic

PAGE 61

CHAPTER 1

INTRODUCTION

1.0

Background

Nowadays, the public security in our country is not so ideal and the crime rate seems not to be reduced these past years. Our life is full of threats in every minute from now, no matter where we are especially in the city. The tragedy may occur during our way to work, travelling or even at our sweet home which is usually defined as the safest place for us. The robbery and burglary cases seemed rampant today, it even occurred under the CCTV surveillance. Even though the police have put a lot of efforts on this, but still, it needs our own effort to ensure the security for our home. Due to this, the security has become a crucial issue for our daily life. Everyone is going to use whatever means that can promise them the safety of their asset.

The lock is considered as the main hire of defense to prevent others to access personal stuffs or intrude into our private area. It is one of the earliest security methods over the centuries. The lock is an indispensable part for security system and still used in the security system today with other extra access operation, likes password, token or biometric verification.

Password authentication system seems to be the most common type among these accessing methods. However, the users are facing an inconvenience when someone is standing beside or behind them during the keying in of the password. The

bystander can watch the whole process over the shoulder of the user and can make guesses of the password that the user pressed by observing the position of the finger. Thing will become worse if the onlooker know or able to see the keyboard or keypad. This condition is known as shoulder surfing [1].

In addition, the risk of password being stolen is higher if the security system belongs to a person and the password used is not change for quit sometime. By placing some chemicals on the keypad, someone may easily see the fingerprint. From that, it is able to know the number set that being pressed and the password may be guessed based on that set of numbers [2].

In order to enhance the security by increasing the easiness in memorising of password and reduce if the chances of the password being stolen by bystander, a password authentication lock system using colour sequence is introduced. This lock requires user to enter the correct colour sequence from the keypad where the buttons colour are changing randomly. By pressing one of the key, the color will change immediately. This will increase the toughness of shoulder security of password; hence increase the security level of the locking system.

1.2

Objective of Project

The main objective of this project is to develop a security system that uses the color sequence as authentication method. The color of the button to key to key in the colour code is changing randomly, hence creating a security lock that can reduce the probability of password being stolen by bystander in such a way that the passwords pressed are difficult to be guessed by others nearby.

1.3

Scope of Project

In order to fulfill the project objective, there are several scopes had been set. Firstly, the security lock is aimed to use for door locking system using Arduino board as the controller. Second, there will be at least 3 colors changing randomly for each key of the keypad. Third, the colour will be changed once one of the keys (button) is pressed or 5s had elapsed without any key pressed.

1.4

Thesis Outline

This thesis comprises five chapters. The first chapter discusses about the objective and scope of this project as well as the summary of work. Meanwhile, chapter 2 is regarding the literature review and research based on books, journals and previous thesis on the subject. It introduces about the authentication method of electronic lock, drawbacks for each type of method, current electronic lock modal, color, color coded system and random keypad system as well as Arduino board. Next, the methodology of the project is presented in chapter 3. It includes the hardware part and the software part. In chapter 4, the result and discussion will be presented. Lastly, chapter 5 consists of the conclusion and the recommendation for future extension of the project.

1.5

Summary of Works

The flow of the project is illustrated in the flowcharts which it include the completed works and the future to-do works for FYP 1 and FYP 2 as shown in Figure 1.1 and Figure 1.2 respectively. Meanwhile, the Table 1.1 and 1.2 are the Gantts Charts for FYP1 and FYP2 respectively.

Start

Design the hardware Circuit Re-planing

Supervisor Assignment

Circuit Planning Workable?


Yes

No

3 title proposal No

Hardware Purchasing

Title confirmation
Yes

Study programming language and draw program flowchart

Thesis writing The existing modal Research

Literature Review

End

Figure 1.1 : Project flow for FYP1

Start

Testing and troubleshooting

Keypad circuit

Improvement

Poster designing Keypad Interface circuit Seminar Lock Interface circuit Thesis writing

Programming by part End

Figure 1.2 : Project flow for FYP2

Table 1.1: Gantts Chart and Milestone for FYP1

Table 1.2: Gantts Chart and Milestone for FYP2

CHAPTER 2

LITERATURE REVIEW

2.1

Introduction

It was believed that the first lock in the world was vanished and it was nowhere to investigate as there was no any record of it [3]. The history of lock can only be traced back to 4000 thousand years ago when the oldest ancient lock was invented by the Egyptian. This oldest lock was discovered in 1842 in Persia and it used the same technique with pin tumbler lock as nowadays. Apart from the ancient Egypt, there are others old civilizations, likes Greek and Roma that invented lock with different locking techniques. Some archaeologist deduced that all of these locking techniques were not related with each other and they were developed independently [3].

With the fast growing of technology, the lock has evolved from only pure mechanical type into electrical and electronic type. With the assemblage of electronic and mechanic at system, the lock has developed into a high-tech style which uses some special authentication method. Usually, it is called electronic lock or smart lock as it can operate based on the given information. In the current market, there are many authentication methods to trigger the electronic lock including, button sequence, radio frequency identification (RFID), biometric, security token and etc. Generally, these kinds of authentication use the embedded system to process or verify password or data entered by the users. The intruders have to spend quite a time to crack these kinds of high tech lock [4] [5].

2.2

Authentication methods

2.2.1

Password Type

Among these authentication methods, the most popular type is using the numerical code as access tool [4][5][25]. This method requires the user to enter the correct sequence of code via keypad (button) in order to unlock the system. Some examples of password based system are shown in Figure 2.1. Basically, it contain 4-6 digits of number as the security code. Besides numerical code, the password is also one of the methods under the button sequence type. It may consist of the combination of alphabetic and numerical code. Meanwhile the passphrase is a set of words which is having the function as the password but it is longer than password. The longer password will cause a problem in recalling the password where a user may easily forget [1]. This longer password has no obvious improvement on the security as long as the inserted information is remained unchanged. It will increase the rate of error during the entering session; this may bring frustration to the user.

However, password seems to be the main authentication method for some period due to the consideration of dependability, safety, user friendly of the technologies and confidentiality. But there will always a conflict between safety and user friendly. As stated by Birget [7], the password must have two criterions which are against to each other. First, passwords should be highly memorable, and the access process should be done in swift and simple by user. Second, passwords should be safe where they should seem to be random and secret. They need to be altered from time to time and cannot be the same for every account of the same person. Besides, the passwords also cannot be recorded or kept in bare text.

Figure 2.1: Password based system

2.2.2

Token Type

For the authentication using security token, it requires possession of the so called key or token in order to unlock [4][5][6] as illustrated in Figure 2.2. The token can be a card, ring, passport or other devices that contained the information to be verified by the security system as exhibited in Figure 2.3. The system needs the tag and the reader to operate. RFID is a method that authenticates the user by using the radio wave which is belongs to the token type group. It needs a tag to store the information as the code and the tag is usually embedded into an object, or living thing including human for the verification. The valid detection range is depending on the system. It may up to several meters as long as the tag is presented in the detection field of the reader. Usually, the door access tag is made in a card like shape.

Figure 2.2: Token based system

Figure 2.3: Types of token

2.2.3

Biometric Type

Lastly, the biometrics authentication is the access operation that is growing fast and is getting more popular as it performs in high security level [4][5][6]. There

10

are several types of biometric authentication such as fingerprint scanning, iris and retina scanning, voice detection, hand geometry recognition, face detection and so on as displayed in Figure 2.4. This kind of system is said to be safe as each individual having a unique pattern for the retina, iris, and fingerprint as well as other body parts that are used as the authentication method.

Figure 2.4 : Types of biometric information

Figure 2.5 : Example of iris biometric lock

2.3

Existing Modal of Security System

There are many types of microcontroller based lock introduced by different researches. In this part, the type of lock is categorised according to the authentication method which are basically consist of three main types as stated before. There are password pin based, token based, biometric based and other types.

11

2.3.1

Security System using Password

For the password based microcontroller based lock, most of them are using PIC as the microcontroller while there are also some using Atmels chip and FPGA. An electronic based lock is presented [8]. It is a low cost PIC based lock with simple design. The 4x4 keypad is used as the input and a relay is used as the lock. Another password based lock system named Office Access Control System is presented by S. R. Khan in his paper [9]. It is a low cost system that uses to restrict unauthorized person to access into certain zone. PIC is used as the main controller and a 4x4 keypad is attached in the system. Generally, the function is just slightly different as it has the alarm function.

Another similar electronic lock is also introduced by M. H. Muhammed in his journal [10]. Just as the previous lock, it uses PIC microcontroller and the 4x4 keypad as input. However, it has some extra functions which the password can be reset and the backspace function is added. Besides, the system is claimed to be smooth as the software have been verified without any bug. In the journal written by Sitong S., Angang T. and Decai Z. [11], a FPGA based electronic lock have been introduced. It is claimed to be reliable as the processes are carried out by the hardware and is easy to modify as it can load the latest design into the FPGA without any alteration of the hardware. The main disadvantage is that the price might be higher than other locks that using microcontroller chip.

In addition, a home automation system is implemented by Indeerpret K.[12] This Atmel based system has several subsystem such as, locking system, switching system, temperature control, lighting and fire detection system. In this project, locking system which is using password authentication by receiving input from a keypad is considered. The lock is installed inside the door where cannot be seen from the outside and this reduce the chance of damage by intruder.

12

2.3.2

Security System using Token

There are four token-based security systems found in the literature. The types of token that has been used in these literatures are keys, RFID card and remote controller. The first is an electronic and mechanical lock that using DSP as controller [13]. It joins the mechanical and the electronic lock function in one system where a key that contained digital information is used to access the system. User is required to plug in the key and turn it. During this moment, the lock will read the information on the key and start the verification process to determine the next step. If the information is not match the alarm signal will be sent to the coordinate center. This system has the function of key deletion, it is useful when the key is missing or being stolen. Overall, it is safe and has the identification function. However, it is operated on battery.

An intelligent door lock created by student from Nanchang University is introduced in the ISECS International Colloquium [14] which uses a 32-bit Arm CPU as the controller which associates with other subsystems, including LCD, RAM, ROM, and Real time clock to perform as a complete locking system. The RFID card is used as the token to access the system. The main advantage of this system is its ability to trace the entry record directly from the lock without the need of the central computer.

There is another RFID security system operated in 13.5 MHz is found in the literature [15]. The system comprises a communication module, data manipulating system and the RF token. Overall, it is just a simple RFID system. The other system is a remote door lock controller invented by University of Connecticut [16]. This design is aimed at the handicapped group who face the inconvenience in moving the hand freely. The system is made up of a remote controller and receiver to perform the lock and unlock operation.

13

2.3.3

Security System using Biometric

For the biometric based security system, there are several methods that have been proposed such as the face, iris, fingerprint and voice recognition. A face recognition door locking system is designed [17]. A GUI is implemented using Matlab and PIC is used to control the status of the electronic lock in this system. A computer is needed to perform the face recognition procedure.

Soni-Key is another biometric based door lock that uses voice and fingerprint in the authentication process [18]. It is developed by student from the University of Connecticut. It is purposely designed for the disable group who are using the wheelchair. The system can be controlled by either voice or fingerprint where it depends on the position of the user. When user needs to access from the outside, he/she is required to pass the voice and fingerprint verification. Meanwhile, the system requires only voice command form the user inside the house to operate. This system faces the accuracy problem as the voice is hard to be constant for every access.

In addition, there is also a security system that uses multi type biometric being proposed by a researcher from India [19]. The system uses iris and fingerprint as the dimension to verify the authorized user. It is aimed for the application in the office where the high security is needed. It is a safe system as the fingerprint and iris pattern are different for everyone. Due to the advanced technology used, the cost for the system is also high.

2.3.4

Others Security System

Apart from the three main authentication methods, there are still some other type such as, audio and internet. A security procedure using audio recognition has been proposed by student from West Visayas State University [20]. This method uses the high frequency audio as code and this code is combined and played during the

14

accessing process to let the lock system to trace and verify it. It is safe enough for this stage as the technology have not been widely applied. This means others still do not master in cracking this system. Besides, the technique used in the audio verification is very accurate as it shows less error during the experiment. It can prevent the stealing of the code as the audio from the key is hard to trace by the human ear. On the down side, this method needs a music player to play the code and a computer to verify the real code.

A home appliance control system is published in the SiCE-ICASE international conference by D. H. Yoon, D. J. Bae and H. S. Kim [21]. It involves telephone to control the locking operation via internet. There are several subsystems that existed in this control system, such as the door lock, the lighting system and the motor system. It is convenient that to control those subsystems via internet but this exposes the system to the risk of virus infection.

2.4

Drawbacks of each authentication method

The users tend to forget the password easily if they are having many accounts with different passwords [22]. Due to the easiness in forgetting password, the user usually tend to select a short and easy to remember password. According to the ABC news on Oct 2012, the website SplachData had announced the most used passwords for 2012 [23]. Due to its popularity, these passwords are become defenseless and may easily be cracked. The worst passwords used by the majority are password, 123456, abc123, 111111 and letmein. This makes their passwords on the high risk of being broke or hacked by others with the use of dictionary attack. Besides, they also try to save the password on a paper or in the text file in computer [24]. This is against the purpose of setting the password and it will cause the system unsecure anymore. Furthermore, the password system is in the risk of password being stolen by the bystander [1]. The bystander can simply peep the inserted password during the password entry process if the users are not aware of it. Sometimes, even an alert user can become victim, if the peeper manages to observe

15

the finger movement and guess the password as they know the position of the keypad numbers.

The biggest drawback of the token method is the system will not recognize the owner but only the token itself. When the token is possessed by other nonauthorized person or the token is missing or being stolen, it will become a problem [26]. The system will not verifying the person but the token he or she has. Once the wrong person gets the token, he or she may access into the security area without any resistance. The token may be duplicates if someone knows the technique of making the token. The system will be at risk if someone stole and duplicated it without the knowing of the user. Since it needs reader and tag to operate, the price will be high as compared with other. In the market, the price of those tags is still high unless bundle purchasing is made [6].

For biometric security, an undeniable fact is that the detection system response cannot give the 100 percent accuracy as there is always a wrong scanning from it either in false positives (false acceptance) or false negatives (false rejection). False acceptance is the error that the system verified the unauthorised person, while false rejection is the error that the system fail to verify the authorised user. Generally, the cost of this kind of system is higher as it needs advanced technology to operate. Besides, there will be a problem when the user underwent a surgery for either healthy or beauty purposes. The system may not recognize the authorised user due to the changing personal biometric features. The problem rises if the thumbprint of the user is cloned by someone and it is impossible to ask to get a new thumbprint. In our daily life, it is impossible for an individual to make sure that he /she would not leave any fingerprint at the public area. So, the fingerprint may probably be dropped into the wrong hand if someone purposely trace for it. There will be another worry if the database of the biometric system has been broke into. This means that the identity of the user may be exposed and their activities on other systems may be traced as they are using the same biometric information [27][28].

16

2.5

Color

Color is important to our daily life. From our sight, almost everything on earth has its own color. The color is actually the light that sensed and analysed by our brain. When light are transmit from either the lighting stuff or non-lighting stuff into our receptor, the signal will be produce and will be sent to our brain. We will notice about this signal and translate it as color [29].

Our vision system is good as we can detect more type of colours as compared to other mammals. According to the Art Laboratory Handbook, human can detect and interpret around 10Mil of various colours they see [29]. There are 4 kinds of receptor that mankind used i.e. one rod and 3 kind of cone. Each of the cones (Blue, green and red) have their own specification to sense different wavelength of light which are optimum at 430,530 and 560 respectively [30]. Different wavelength will trigger different receptor and this will make us sense the variety of colour as shown in Figure 2.6. Just like the general color chart which consists of 3 base colours , the colour combinations that can be sensed by human eye is explained. For example, the red wavelength and green wavelength go into our eye at the same time, we will see it as yellow in colour. The Figure 2.7 is the colour chart for the colour combination.

17

Figure 2.6 : Result of colour combination traced by human eye

Yellow

Red

Green

Magenta Cyan Blue Figure 2.7: Colour combination chart

However, our memory is unable to recall the exact colour that we see before. Usually there will be a slight difference between the exact and the one in our memory after a certain period [31]. The experiment revealed that we will see the two

18

slightly different colours as the same one if we are exposed to the first color for a period and followed by the second.

Colour is not only useful for us as it provides information through our sight, but it is also will influence our feeling. As Lynnay Huchendorf stated in his paper [32], the bright colour is exciting despite of soothing. In the paper [29], colour is claimed that will bring joyful for our lives and make us to enjoy. Furthermore, he also declared that colour is a need in our life as it can help us to avoid danger like detecting the red burning flame, the dark cloud in the sky and etc. This benefit of colour is also proved in the book [33][34] which stated that colour in nature are crucial for living creature to continue on their life such as finding food, detecting prey and so on.

Apart from the need for living, colour is also reported helpful in memorizing. Several papers claimed that colour help people to memorize and recall more faster [35] [36]. One of the paper [37] [38], have explained how colour can help in memorizing. People will normally pay attention on the color and this makes them more concentrate on the thing or information they are watching. Indirectly, they will keep the information in memory easily [39].

2.6

Colour Authentication System

Most of the papers or journals published security system are based on graphical password. There are not many systems that use colour as security code and all of them are software based system where the colour changing is showed on the screen instead of hardware. There is a research on the feasible of the use of colour as the code to access security system in 2008 [35]. The research used a system called Pass-Colour (Figure 2.8) as the security system that based on the colour code. Users are required to set their code using colour and use that code to login the system. The research found that the colour as security code method is safe enough and easy to remember by the user. This method made the password entry process become more

19

interesting and easy to remember. By this they reduce the chance that user record their password in other place and indirectly enhance the safety aspect.

Figure 2.8 : Pass-Color System

ColorLogin scheme is a system that based on graphical password with the help of color in the password searching process which is developed by Xidian University [40]. In this scheme users are given some row of icons and are required to click on the row where the icon password is located. Once pressing the row, it will be replaced with another lock icon to prevent others to record the icons on that row. As there are many rows and many icons in a row, it is tedious for user to search for the correct icon password. As solution, the inventor has use difference background color to assist user in searching for their password icon as shown in Figure 2.9.

Figure 2.9 : ColorLogin Scheme

There are some systems that use colour as the password likes Color Contacts Lock, GallerySMS Color Lock and etc. [41][42]. All of these systems are the software based system where the color is show in the screen and the color location is fixed.

20

2.7

Random Keypad System

Random keypad system is the system where the number or symbol on keypad buttons is changing randomly during operation. This feature can reduce the chance of password being stolen by the bystander during the password entry process. The onlooker will have difficulty to see what number is being pressed by watching the finger movement as the location of the numbers is placed randomly.

HIRSCH ScramblePad is a random keypad where the number is displayed randomly on it as displayed in Figure 2.10 [43]. The number positions are placed randomly on the keypad before the password entry. The keypad button is built by LED seven segment display with the restriction of the light wave in certain direction. This caused the numbers only to be visible within certain angle. This can prevent others to read from the side plus it is hard to guess the code by watching the movement of the users finger.

Figure 2.10 : Keypad of ScramblePad from HIRSCH

Another random key system is the PINSAFE software form Swivel as demonstrated in Figure 2.11[44]. It provides user a set of random number combination from 0 to 9 during the time that user try to login. User is required to remember 4 numbers at the location of their original password and insert the 4 numbers during the login process. This method can prevent others from knowing the real password even when they have watched the login process. Besides, they can resist the attack on key logger as the entered number is not the real password.

21

Figure 2.11 : Operation flow of the Swivel PINSAFE

2.8

Arduino

Arduino is a microcontroller that acts like a mini computer to perform specified function. It can be programmed to manipulate the collected data from the input and control the connected output peripheral. It is usually applied in the embedded system where it interacts with the surrounding via its combination of hardware and software. There are a lot of applications of Arduino as long as there is a loaded program to command the input devices (usually sensors or keypad) and the output devices (such as the LED or LCD screen) connected to the board [45][46].

Basically, the Arduino board consists of several main parts in a single board, such as processor, power supply, Input/output ports, USB Port and extension connectors. Arduino is an Atmel based Microcontroller. The Atmel Microprocessor is used as the brain for all Arduino modal. A voltage regulator is soldered in the Arduino board which receives the unregulated voltage from the range of 7V-12V to produce a regulated 5V DC to the circuit. The supply is connected to the power jack to get the external power source [45][46].

Besides, a crystal clock is used to generate the clock pulse (heart beat) for the microprocessor to process in stable time for each cycle. The number of input/

22

output ports is varied according to the modal of the Arduino as the microprocessor for each modal is different. The USB Port is mainly used for connecting the Arduino with the computer during program burning. Apart from that, the USB port also supplies the 5v voltage directly from the computer. It means that there is no need for other external source to power up the Arduino when it is connected through the USB. However one has to bear in mind that the current from the USB port may not be enough for other bigger output loads such as, relays, motor and etc. As the microprocessor type in each Arduino is different, the number of extension connector (usually located at the side of the board) is also different. These extension connectors are a user friendly feature where it provides the direct ports for the user to connect the input/output pins of the IC [45][46].

The reason of Arduino is chosen as the controller in this project is because there are many shields with different function that can be added when it is modification is needed. Another reason to choose Arduino is due to the open source of its hardware and software. It means that it can be used commercially without copyright issue. Furthermore, the program burning process of Arduino is also simple as it only needs to connect the USB cable between Arduino and the computer. This will save a lot of money and programming time as it does not need to connect to the programmer [45][46].

2.8.1

Arduino Mega 2560 R3

The modal of Arduino in this project is the Arduino Mega 2560 R3. It can work with the power supply of 6-20V but the optimal range is 7V -12V. The overheat problem may be encountered if the supply exceed 12V; whereas the insufficient voltage regulators output will happen if the input of the regulator is less than 7V. Besides, there is a 3.3V regulator used on the board with the ability of supplying a 50mA current [47].

23

It used Atmega2560 chip as the processor. According to the Atmel Datasheet for the ATmega2560, it is an 8-bit high efficiency chip as its power consumption is small. The RISC architecture is applied in this processor where the execution of the instruction is quicker than the CISC architecture [47].

There is a 256Kbyte of flash memory, 8k byte of internal Static Random Access Memory and 4k byte of Electrically Erasable Programmable Read Only Memory. The write/ erase cycle for Flash memory and EEPROM are 10K times and 100ktimes respectively. The 16 mega Hertz crystal is used to supply the clock pulse for the chip.

Besides, there are 54 Input/output pins in this model. The 12 ports are varied from port A to port K. All ports are 8 pins accept the port G with only 6 pins. It also consists of 32 General Purpose Registers. Among these I/O pins, there are 16 pins for analog input, 15 pins for PWM output, 3 sets of serial communication interface and 1 set of Serial peripheral Interface as well as 2-wire Serial interface [47]. The output connection of Atmega 2560 is shown in Figure 2.12. The whole schematic diagram is shown in APPENDIX A.

24

Figure 2.12 : Input output connection of Atmega 2560

2.9

The Key Scanning Concept

The key scanning concept is used in the programming part. The keypad in this project is arranged in matrix form which it can be divided into row and column for each button. In the scanning routine, each button is scanned according to the row and followed by the column. The scanning concept is applied the zero row pins and 5V to all column pins. If there is a connection (button is pressed) and the particular column shows 0V then one will know which column and row of the button is pressed. If there is no pressed button trace in the row, the program will start the scanning the next row. It means that all the first row buttons will be scan by checking the signal from each column and this will move to another row for scanning if no button is pressed [10].

25

CHAPTER 3

METHODOLOGY

3.1

Hardware

Firstly, the hardware of the security system is determined. The system proposed consists of five main parts: the semi-transparent keyboard button (input), the controller interface circuit board, the lock interface board, the microcontroller board (data processor) and the electronic lock as displayed in Figure 3.1.

Arduino Mega 2560 R3

Lock interface board

GLCD shield

Keypad interface board

Vehicle Power Lock

Colour Keypad

Figure 3.1 Overview of the project

26

3.1.1

Microcontroller Part

The microcontroller board for this system is selected from the existing model, such as the Arduino board, PIC start-up kit and etc. The Arduino mega2560 were chosen as the main controller board after the comparison based on the conveniency, price, booting process and user friendly aspect were made. The main reasons the Atmel based Arduino is chosen over the others because of its convenience aspect in bootloading, cheap price, open source hardware and code, large number of libraries and etc. Furthermore, the Mega 2560 modal have the most Input/Output ports among all of the Arduino board which overall is 54 ports. This feature allows output board to be designed without facing insufficient I/O port issue. The replacement of Atmega8U2 with Atmega16U2 as the USB to serial Converter provides swift data transfer and larger flash memory. This Arduino mega board comes in as a complete system where one only needs to load the program into the board in order for it to function. This can save a lot of time in developing a controller board since one does not need to design and troubleshoot the circuit. The Figure 3.2 exhibits the Arduino Mega 2560 R3 board.

Figure 3.2 : Arduino Mega 2560 R3 board

3.1.1.1

Serial peripheral Interface (SPI)

The Serial peripheral Interface (SPI) is a protocol used for communication between the microcontroller and the SPI device which are the 4884 LCD shield and the digital potentiometer AD5206 in this project. The information is sent smoothly in

27

series within a short distance. There are 3 common pins for all devices which are Master Out Slave In (MOSI), Master In Slave Out (MISO), and Serial Clock (SCK). There is also a special pin which is different for all device, the slave select (SS). The connection between two devices for the SPI communication is displayed in Figure 3.3 and the functions of each pin is shown below.

MOSI - Pin on master to send information to slave. MISO - Pin on slave to send information to master. SCK SS - clock pulse. - Pin on slave where the master can enable or disable the slave.

For the Arduino2560 mega board, the pins for the SPI are pin 51(MOSI), pin 50 (MISO), pin 52(SCK) and pin 53(SS). Only the MOSI, SCK and SS were used in this project. The Arduino 2560 is functioned as master to send information to the digital potentiometer. The slave device is only enabled when the SS pin is in low. The speed and the data transfer mode for SPI are set using the SPI control Register (SPCR). The 8 bit of the SPCR is illustrated in the Figure 3.16. All of the bits in the register are used to determine the format of information transferring via SPI.

Figure 3.3 : SPI connection and SPI data transferring diagram

28

3.1.2

Keypad Part

A white colour semi-transparent button type usually made from silicon rubber is needed for the project to allow the light to be emitted from the back. A 4x4 silicon rubber keypad button and a PCB board with the circuit printed on it were used as shown in Figure 3.4. This type of button is used due to its design where it has reserved an empty LED-size space underneath each button. With this feature, the RGB LED can be placed under the button without affecting the pressing operation. This keypad button is flexible as it can be divided into a 2x4 or 2x2 key pool system. It provides the same feel as pressing on the television remote controller and each button needs an equivalent of 190-210 grams force to trigger. There is a conductive ring under each button to connect the PCB circuit to work as a switch. The RGB is placed under each button to allow different colour to show among the buttons by the manipulating of the current signal at the RGB pins. The dimension of keypad is demonstrated in Figure 3.5.

For the keypad Printed Circuit Board (PCB), it reserved a RGB space and a diode space for each button as shown in the Figure 3.4. The diode is used to isolate the button so that it makes the decoding process become simple. Each of the electronic components is inserted into the hole on the PCB until the maximum level and the remaining of their leg is cut as short as possible. These two steps were done to prevent the inappropriate placement of components from affecting the sensitivity of the keypad.

Figure 3.4 : Silicon rubber keypad and internal keypad PCB

29

Figure 3.5: Layout of the keypad

3.1.3

Controller Interface Parts

The main function of the controller interface board is to provide an interface between microcontroller board and the keypad circuit. There is a digital potentiometer ICs AD5206BRZ10 (Figure 3.7) soldered on the board to control the resistance for each pin of the RBG in order for the RGB to show different kind of colour as pre-decided. This AD5206 IC has 6 pots of 10K potentiometer with 256 positions. This permits to control 6 set of LED with a single chip because of the compatibility with serial peripheral interface (SPI) communication. The

microcontroller can give command to the IC via SPI. There are some transistors on the board which were used as switch to control the button during keypad scanning. By controlling the activation of the transistors, keypad button can be manipulated according to column. Apart from that, this board is also used to provide one power supply for all the components accept the microcontroller board. This board operates on 5V input voltage supplied directly from the microcontroller board. The schematic of the interface circuit is shown in Figure 3.6. The first version of the hardware is shown in Figure 3.8. This circuit is soldered on donut board and occupied quite a large space. However, this version needs many jumpers to connect it with the main

30

microcontroller board and all the boards are hard to maintain in a fixed position since there is only jumper wires connected between them. In order to solve this problem, a second version of the keypad interface board is developed where it can be directly attached on to the main Arduino board. It is designed to remove the entire jumper wires that connect between this board and the main board. The only jumper wires set on this second board is connected to the keypad button. With this, this second version became more tidy, well-organised and compact. Aside from that, there is a small modification on this board where it reserved a space for the lock interface board to be attached on it. There is only 3 points of connection between this board and the lock interface board which is the 2 I/O pins and a 5 V supply. The second version board which is also the final version is showed in Figure 3.9.

Figure 3.6 : Schematic of the controller interface board

31

Figure 3.7 : Digital potentiometer sent from RS Component

Figure 3.8 : First version of keypad interface board

Figure 3.9 : Second version of keypad interface board

32

3.1.4

Lock Interface Board

The lock interface board is used to control the operation of the electronic lock. As the common electronic lock operates on 12V, a 12V supply is needed. The lock uses magnetic coil and this may cause a high current flow in the circuit. Hence, an optocoupler is used to separate the electric flow between the main board and the lock part. This is purposely made to protect the main board from any overflow of current or high voltage effect. The optocoupler used is a Toshiba chip named TLP521-2 as shown in Figure 3.10. The last number showed the number of channel on the chip which is 2 channels. These two channels are controlled by two input/ output pins of the Arduino respectively.

Apart from the optocoupler, there are relays, voltage regulator, transistors, and so on. 3 relays are used to control the direction of the lock. Generally, the polarity of the lock connection needs to be exchanged in order to have a different direction of lock movement and it can be solved with some special connection. 3 relays are applied for different polarity setting for the lock without changing the locks wire connection manually. The concept of the connection is shown in Figure 3.11. The first relay is used to control the current for the second and third relays. The common pin of the 2nd and 3rd relay are connected to the two input wires of the power lock. The operation of these 2 relay are always in the opposite way. When the second relay is on, the third relay is not operating or vice versa. With this, the common pin for both relays will have different polarity too.

A 5 V voltage regulator was used to regulate12V input to 5V which is the supply voltage for the whole lock interface board. The direct 12V input is applied to the normally close and open pins of the relays and the lock. Each relay is connected in parallel with a reversed polarity transistor to prevent the spike voltage, called back EMF.

As an isolation circuit, there are two parts of independent current flow on it. They can be categorised as the part before the optocoupler and the part after the isolator. The part before the optocoupler is the flow between the Arduino and the

33

optocoupler. The pin 47 and pin 43 are set to output mode and are connected to the cathode of channel 1 and channel 2 of the optocoupler respectively. Meanwhile, the anode for both channels is connected with the 5V from the Arduino board. Once the pin 43 or 47 is set to low, the current flowed through the LED inside the optocoupler. This leads to the collector and emitter (detector) of the optocoupler to be shorted and the current can flow through. The detector is another part which is after the optocoupler. The channel 1 function to control the current flow to the relay that governed the locking mechanism of the power lock, whereas the channel 2 is to control the current flow to the relay that governed the unlocking mechanism. The schematic of this lock interface board is illustrated in the Figure 3.12.

Figure 3.10 : Circuit diagram for Toshiba optocoupler

Figure 3.11: Signal flow diagram for power lock connection

34

Figure 3.12: Schematic diagram for lock interface board

3.1.5

Electric Lock Part

There are several types of electronic lock available in the market, such as electric door knob, electrical door opener, electrical latch strikes, electromagnetic lock and etc. The electronic lock was chosen according to the price, operating voltage and accessible in the market. After reviewing all the locks price that available on the market, the power lock for vehicle use is considered as the cheapest among them. It is a 12v power door lock which cost only RM 20 as shown in early part of this chapter (Figure 3.1). There are two operation states for the lock: either locking or unlocking. The actuator exerts a 70 N pull/ push force during the maximum 0.2 second operation. The operation depends on the polarity of the locks input wires. The lock will move to the maximum of opposite direction if the polarity is changed. The two input wires are soldered to the common terminal of two different relays in order to have different polarities supply without changing the wire connection.

35

3.1.6

Graphic Liquid Crystal Display (GLCD) Shield

An Arduino 48x84 LCD shield is selected as the display device for this lock system. Besides, it also displayed the menu option for the user to select and play important part as it is used to exhibit the information and status of the lock. This shield fixed perfectly onto the Arduino main board with 84 pixels width and 48 pixels height screen area. There is a 5 Degree Of Freedom (DOF) joystick soldered on it and this worked as an input device for the user to interact with the system. By moving to certain direction, the shield will generate signal to the corresponding I/O pin. As those pins are connected to the microcontroller, the controller can notify the exact insert by referring to that pins. Furthermore, a reset button is located right beside the joystick for resetting the system. This LCD shield is operated on a 5V with LCD backlight control function. The pin 7 is set for the backlight control. SPI interface is used for it to communicate with the microcontroller board via the digital I/O pins of 2, 3, 4, 5 and 6. A library is ready for programming this shield and this saves a lot of time in the programming part, which will be discussed later. A modification was done on the keypad interface board in order to fix this shield on the top of the Arduino board as shown in the next chapter (Figure 4.6).

3.2

Software

For software implementation, the Arduino IDE is used to create, debug and boot the code. There are 3 main parts in the software implementation which are the color code verification algorithm, the menu option algorithm and the programming code.

3.2.1

Algorithm for Color Code Verification

A program flow chart as displayed in Figure 3.13 was prepared as the preliminary work for the programming. The program will start with the initialization

36

of the input/output ports. Then, it is followed by generation of the random colour mode for each keypad button and the scanning of the pressed button. The colour will change randomly if one of the buttons is pressed or 4 seconds without any key press. Once the three codes have been entered, the microcontroller will perform the verification process. The lock will receive pulse to open if the correct code combination has been entered or else the wrong entry will be record and the lock will remain locked. Once it reached the 3 times wrong entry limit, the system is set not to receive to any input for a certain period.

Figure 3.13 : Color Code Verification

37

3.2.2

Algorithm for the Menu

In the second project stage, a GLCD shield is attached to give the instruction and to show the condition of the lock system to the user. The programming algorithm of the GLCD starts with a menu as shown in Figure 3.14. There are four options in the main menu which are LOGIN, CHANGE PASSWORD, LOCKING and ABOUT. Under the LOGIN page, there are 3 user accounts provided to be chosen i.e. Lecturer, Staff and Class Rep. The user is prompted to key in the password for the accounts they have chosen. The later algorithm is just continuation of the previous password verification algorithm that has been set above. For the CHANGE PASSWORD page, the algorithm is the same as the LOGIN except that it is after the true return of the valid password verification. The lock would not be unlocked but the system prompted user to key in the new password (3 times pressed) in sequence. After 3 codes selected, a repetition of the 3 new set codes are needed to be keyed in again for the conformation. The new set of codes is activated only if the user has entered the same colour and sequence of the codes twice as illustrated in Figure 3.16.

The third option of the main menu called LOCKING is used to lock back the system after unlock. Besides, it is also given a hidden function to select the difficulty in unlocking the system. There are two types of difficulty which are direct and hard. The difficulty for the systems unlocking process is alternating every time the LOCKING option is selected. An H alphabet will be shown on the screen to indicate the hard unlocking process or else it is direct unlocking process. The Figure 4.2 h shows the hard mode as H alphabet appeared on the display.

For the last option (ABOUT), it is used to reset all the settings to the default value including the changed password. This function is to prevent someone who has forgotten their new set password. As this project is only a demo kit, this reset option is accessible directly from the menu. It will be a different case if the lock system is applied to guard our properties. This function must be located at the position where only the technical person can access.

38

Figure 3.14 : Algorithm for whole program

Start

No

Choose account

Correct code Wrong code


YES

Insert new code Insert new code again

NO

1st = 2nd
YES

New code set

Figure 3.15 : Algorithm for code changing process

39

3.2.3

Programming Code

The program is developed in C language with the Arduino syntax in the Arduino IDE (Software). This IDE is also used for loading the program code into Arduino board. Based on the previous algorithm, a program for the Arduino to control and manage all the signal of input and output devices is developed. The whole programming code is stored inside the file named Program.doc in the attached DVD. There are some main parts in this C language program such as, the initialization of the ports and SPI, button scanning loop and code scanning part, random colour setting, permanent data storage and menu option.

For the port, there are certain things which need to be highlighted are the mode and hardware connection. The number must be declared based on the hardware connection. The ports for column signal of the keypad are set as the output pins 14 17. In addition, the 4 ports of the keypad column, pins 32, 34, 36 and 38 are set to input mode for the microcontroller to control the RGB. Meanwhile the 2 ports of keypad row (pins 28, 30) are set as output to send signal to the column ports if the button has been pressed.

As the digital potentiometer is used, the SPI is initialized for it to communicate with the microcontroller. In order to decide the style of communication in SPI, a register named (SPCR) is set. In the program, the SPCR is set as 0b01010000 where the SPE and the MSTR are set to high. By referring to Figure 3.16, SPE (bit 6) is set high to enable the SPI and a high in MSTR indicates the master mode. The method of data sending is where the most significant is the DORD (bit 5) is set to low. As the CPOL (bit 3) is equal to low, the data clock will idle when low meanwhile samples data occurs at the rising edge as CPHA (bit 2) is set to low. As shown in Figure 3.17, the data will be sample and send at the rising edge of the clock. During the falling edge, the new second bit data (new cycle) starts and it will be send during the coming rising edge. The last 2 bits, SPR1 and SPR0 are set to zero to have the fastest SPI speed which is equal to 4 MHz. During the data transferring, the SPDR register is stored with the information to be sent and the program is checking for SPIF flag inside the SPI Status Register (SPSR). Before

40

proceeding to the next instruction, the program will wait until the SPIF is set as it indicates the transmission is done.

Figure 3.16 : SPI control register (SPCR) and the setting condition

Figure 3.17 : Data transferring mode for SPI

The button scanning loop is a program that will keep on repeating for scanning the signal from the keypad if any. It is located inside the function called keyinprocess() as shown in the programming document in the CD. This loop will only start when the user tries to login on any account. This scanning loop is a nested loop where it is divided into the column and row for the keypad signal as displayed in Figure 3.18. The loop went through every column in the first row before it moves to the second row. It read the signal from each column in a certain row to check whether the button in the column has been pressed. As the row and column is separated by a diode and the corresponding row is given a high signal (5V) for every row looping, the signal will reach the column port if the button is pressed. The

41

microcontroller will receive a high signal from column to indicate the pressed button. After every column in a row is scanned and before moving to the next row, the microcontroller will send a low signal to that rows pin. By this method, the microcontroller is able to detect the pressed button on the keypad. Once the column signal showed a high, a counter is increased to indicate the times of pressing. As each button has its own colour code during the scanning, the program stored the code in a specific variable. Once the third button is pressed, the program will compare the 3 stored codes with the code set of that particular account in the memory. If the set of entered code does not match with the real code, the wrong counter will increase by 1. The loop will stop after the wrong counter showed 3 and it will step in a delay mode for a certain period.

Start

Store key YES Row > 2? NO

Row++; Column=0;
YES

Break

Column > 4?
NO Column++ NO

YES

Key pressed?

Figure 3.18: Program flowchart of key scanning part

The random colour programming part is executed once, before going into the key scanning loop. The program called a function named random_button[] to randomly allocate a color from the 10 colours which are white, yellow, purple, pink, red, green, blue, light green, light blue and orange. Each colour has its own number which is from 1 to 10. The function will be call every 250 times of the key scanning loop if there are no key is pressed within this period. The interval between colour changing is approximately set to 4 seconds. However, this function will also be called right after a button had been pressed. In this function, each button will be linked with a random number (1-10). Based on this number, the microcontroller

42

stored the resistance value for red, green and blue pin of each RGB LED in a set of variable. In the button scanning loop, these variables are sent to the digital potentiometer for the RGB colour setting. By this, the each RGB showed the different colour according to the resistance level set. The values of the resistance level for red, green and blue pin are varying for different colour as showed in the Table 3.1.

Table 3.1 : Resistance value for the potentiometer set Colour White Yellow Purple Pink Red Green Blue Light Green Light Blue Orange Resistance Value Red 20 9 20 5 1 255 255 255 255 5 Green 10 10 255 255 255 1 255 5 20 20 Blue 5 255 5 20 255 255 1 20 5 255

In this project, there are some important values needed to be stored such as the new password set by the user. In the Adruino board, there is a 4 kB EEPROM memory that can be used to keep nonvolatile data where the data does not fade out even during the power off period. Therefore, the library entitled avr/eeprom.h is initialised in order to call the read and write function for the EEPROM memory. The eeprom_read_block ((void*)&structure, (void*)0, sizeof (structure)); function is to read all the structure parameter void*)& from the EEPROM. (void*)0, Meanwhile, the eeprom_write_block((const sizeof(structure));

structure,

function is to write or stored the structure into the EEPROM.

The menu option is done through the programming of the GLCD shield. A library for this GLCD has been downloaded and included in the program to make the coding easier. With the library, the SPI setting for the communication between the

43

shield and board is ignored. Therefore, the focused was only on how to read the input and to create the menu page and the option. The program kept on looping for scanning for the pressed joystick as demonstrated in Figure 3.19. Once the joystick is pressed, the program will fall into the corresponding case to execute the instruction accordingly. There is a 5 degree of freedom on the joystick where 4 of them are for direction indications and the center-down is used as select or the enter function. Besides, a function lcd.backlight(ON/OFF) is used to turn on or off the back light for the user to read the screen in a dark environment. It is programmed to be on for only a certain period to reduce the energy consumption.

Figure 3.19: Programming concept for joystick input of GLCD shield

44

CHAPTER 4

RESULT AND DISCUSSION

4.1

RESULT The result part is divided into 2: the keypad colour and operation part. The

keypad colour part shows the keypad colour that is available and the colour chart. Meanwhile, the operation part exhibits the menu page and the status of the lock system during the whole operation. The overall view of this project is exhibited in Figure 4.1.

Figure 4.1: Colour security code lock

45

4.1.1

Keypad Colour

There are 10 colours available on the keypad for the user to select. Each of the colour is associated with a specific value from 1 -10 as shown in the table 4.2. Based on the observation done, most users tend to treat the light blue and blue colour and light green and yellow colour as the same colour. The process started with the introduction of the colour keypad to the user. The user was required to calculate the total number of the colour on the keypad which each button colour is changing randomly. The majority mentioned that there are only 7, 8 or 9 colours in total. But after the colour chart is exposed to them, they managed to differentiate all the ten colours correctly even without a second look on the chart. This had proved that the 10 created colours are valid to be used as the user password. Another observation that had been done is for the dark environment; all users were able to differentiate precisely the shown colours.

4.1.2

Operation Once the power code is turned on, the display showed 1st page of the menu

and the backlight is turned on for several seconds before it shuts off. There are 4 options on the menu which is LOGIN, CHANGE PASSWORD, LOCKING and ABOUT as displayed on Figure 4.2a. The function of each option was explained in the algorithm part in previous chapter. There are three options of account and a back option appeared after the LOGIN or CHANGE PASSWORD is chosen. This page is shown on the Figure 4.2 b). The user can either went back to the main menu by choosing Back option or proceed to code inserting process by selecting one of the accounts. The keypad buttons are set with random colour during the code inserting process. The buttons colour will only alter in two conditions which are when one of the buttons is pressed or after the certain idle period. If a button were pressed, the display will show the * to indicate that the code had entered. The condition is illustrated in the Figure 4.2c.

46

There is a difference between the LOGIN and CHANGE PASSWORD after the right code is inserted. For the LOGIN option: after 3 codes were inserted, the lock system will carry on with locking process (Figure 4.2e) and the keypad will blink in green if the right code had verified. Or else, the lock system will indicate wrong input (Figure 4.2d) and prompt user to insert the code again. If the user still failed to insert the right code for the 2 remaining attempts, the screen will exhibit the bad input symbol and user is required to wait for certain period before moving back to the previous menu page. At the meantime, the keypad will blink in red colour. The whole LOGIN process is shown in Video 1 in the DVD.

For the CHANGE PASSWORD option, after the correct code verification, the system will ask the user to enter their new password. After 3 colour codes are set, the second times entry is required as the confirmation process. The new colour code will only set after the confirmation process and the display is shown as Figure 4.2f. If the wrong code is inserted during the process, the display will show the bad input which is the same result for the LOGIN option. This process is demonstrated in Video 2 in the DVD.

The LOCKING option is selected when the user wish to close back the unlocked system or to change the difficulty mode as illustrated in the algorithm part in Chapter 3. The Figure 4.2h exhibits the locking process for the hard mode. There is no alphabet H in the direct mode. The user is required to press directly the colour sequence the same as the original code in the direct mode. For the hard mode, there will be a random number shown during the code inserting process. When the number appeared, it implied that the system is in the hard mode. In order to unlock the system, the shown number needs to be added into the real code. For example, let the real code is purple-green-blue (3, 6, 7) and the given random number is 5. So, the colour code that the user needs to be inserted is light green-white-yellow (8, 1, 2). This is calculated by adding the random number into the real code which is equal to 8, 11 and 12 respectively. For the double digit result, only the second number is considered where 12 will become 2 for this case. Video 3, 4 and 5 in DVD indicates the LOCKING process, the mode changing and the login with hard mode respectively.

47

The ABOUT option is applied to reset all the settings especially the code into the default settings as illustrated in the table 4.1. The default codes for the lecturer, stuff and class representative are red-green-blue, light green-light blue-white and yellow-purple-pink respectively. Upon entered in this option, all the codes are set to this default value as shown in Video 6 in DVD.

a)

b)

c)

d)

e)

f)

g)

h)

Figure 4.2 : a) 1st page of menu


b) Accounts for LOGIN and CHANGE PASSWORD c) Code inserting process d) Wrong code e) Unlocking process f) New code set

g) Reset h) Locking process

Table 4.1: Default code settings for each account

48

Table 4.2: Colour Chart

4.2

Discussion

There are several problems encountered during this project and most of them were solved by using alternative method and applying some modification. Several solved problems are discussed in this section, such as, the control of the RGB LED independently, the number of available colours for the button, true random number, multiple jumper wire on the board, and the brightness problem of the keypad.

4.2.1

Control of RGB LED

This is the first problem encountered at the early stage of the design. As each button needed to be shown in different colours, the resistance of each RGB LED pins had to be controlled independently as each of the RGB LED demanded for specific resistance value to be lighted up in desired colour. The digital potentiometer is chosen to provide the required resistance value to the button and 3 potentiometers are required for each button as there are red green and blue pins. It would be a waste a set of potentiometers to each button is applied. Therefore, a solution was met where a set of digital potentiometers is connected to the buttons in a same row. This

49

indicates that the number of the potentiometer set is depended on the number of the buttons row. Until this stage, only the rows colour is managed to be controlled by setting the potentiometer values for that row. In order to get only one RGB LED to be turned on, the ground of the RGB in the same row had to be controlled individually. This illustrates that the resistance values are shared in the row meanwhile the ground is controlled in column as exhibited in Figure 4.3. The buttons are treated as a matric form in controlling the signal. By this method, let the 2nd row 3rd column button is required to light in green, the potentiometer set in charged for the 2nd row has to be set to a certain resistance value and the ground control for 3rd column has to be activated.

Figure 4.3 : Connection of RGB LED

4.2.2

Number of Available Buttons colour

The total number of colour selection is one of the factors that determine the security level of this lock. The more numbers of available colours will provide a better security for our code. In this project, there are 3 colour codes in a set of code. The 3 codes are chosen from 10 available colour selections as displayed in Figure 4.4. The probability of guessing the code is about .

Actually, this security level can be adjusted by altering either the total number of colour selections or the number of code. This can be easily done by changing the

50

programming code. So, it would not be an issue for us in determining the security level in the future. If the number of colour selection is increased from 10 to 13 colours and the number of code remains unchanged, the chance for the code to be guessed is .

10

9
v

Figure 4.4 : 10 available colours for button

4.2.3

True Random Number The random() function in the Arduino library is used to generate a series of

random numbers . However, the number is not a truly randomly generated number as a problem is found where the random generated numbers are in a sequence of patterns for every time the system is reset. This is because the Arduino is using a formula to calculate the random number. In that case, a solution was found by using a library named TrueRandom. The random() function of this library generates the random number without following a specific sequence and the generated number for every time after being reset is different as exhibited in Figure 4.5.

a)

b)

Figure 4.5 a) and b): First colour combination after reset for twice attempt

51

4.2.4

Multiple Jumper Wires on Keypad Interface Board

The initial design for the keypad interface board consists of multiples of jumper wires that are connected from the interface board to the Arduino main board and the keypad. These wires cause quite a problem during the testing stage. It makes the project looks messy. Apart from appearance, the connection is easily looses and it is hard to trace the loosed part as there are plenty of them. Due to this, a second version interface board is built to fix the problem. This new board is a shield-like board where it can be directly attached onto the Arduino main board as show in the Figure 4.6. All the jumper wires between the interface board and Arduino board were replaced by the male and female pins and the connection would not be rashly lost.

GLCD shield

Keypad interface board Arduino main board

Figure 4.6 : Position of the boards

4.2.5

Keypad Brightness Each keypads button consists of one RGB LED and the light have to

penetrate through the semi-transparent rubber before reaching our eye. Plus, the light from either the Pendaflour lamp or the sun have caused the keypad colour to become plain. It is hard to differentiate while operating under the bright circumstance. As solution, a casing for the keypad is fabricated using the 3D printer. 90% of 4 side surfaces of the button are covered by the casing and only the top surface is exposed to the user. By this method, the brightness of the keypad has been increased drastically to the level where the user is able to distinguish the colour among the

52

buttons. Figure 4.7 displays the keypad under the two different settings. Figure 4.7a shows the keypad without the casing while Figure 4.7b shows the covered keypad.

a)

b)

Figure 4.7: a) Colour keypad without casing

b) Colour keypad with casing

53

CHAPTER 5

CONCLUSION AND RECOMMENDATION

5.1

CONCLUSION

This colour security code lock can be considered as a low cost robust lock. By comparing to other electronic locks that are based on different authentication method such as, RFID and biometrics, this lock has the advantage on the price aspect. At the same time, it provides a safer unlocking process than the ordinary password based lock in which its buttons are fixed.

The goal of this project is to create a security system with the color sequence as authentication method. The color on the buttons is changing randomly during the code inserting process. This is to avoid others from using the chemical attack to trace our fingerprint on the keypad. Besides, this project also aims to reduce the

possibility of the code being peeped by the onlooker. As the code changes instantly once the user pressed, the onlooker was difficultly to trace what code is actually being keyed.

The first objective is completely fulfilled as this lock provides random colour on the button during the inserting process. The second objective can be considered fulfilled in term of reduction of the possibility for passcode being peeped. It cannot completely avoid others from peeping on the code but it is able to reduce the chance of passcode being seen.

54

5.2

RECOMMENDATION

For future works, some problems and recommendations have been outlined in order to improve the quality of the lock system.

i.

Button Sensitivity

There is a small problem on the button sensitivity which has caused a little influence on the second objective. Due to the insensitivity of button, some of the buttons have to be pressed using more force. This has caused delay in the time for the button scanning and the probability of bystander read is the passcode increased. Thus, a new keypad board with different signal detection style can be created in order to increase the sensitivity of the lock system. It will function perfectly once the sensitivity of the button is solved. The bystander will have difficulty to detect the pressed code as the inserting process is done in a short time.

ii.

Data Logging Function and Mobile Phone Communication

As this lock system only stored the data on password only, it may be modified to have a function of recording the number and time of login for each account. By using this method, the user will manage to trace and to check when there is something happened in the guard area. Besides, this lock can also be equipped with the mobile phone communication. When the wrong code is inserted for more than a certain number, the system will trigger the alarm mode with a message to be sent to the users mobile phone. This will provide a chance for user to stop something unwanted from happening.

55 iii. Random Number or Symbol

As this lock only operated with the random colour, it would not suit the users who suffered from colourblindness. Therefore, the lock can be attached with some random numbers or symbols which associated with those random colours. The random numbers can be displayed by using the 7 segment. By this modification, the user with colourblind problem will be able to use it without any different with others who are healthy.

56

REFERENCES

[1]

Volker Roth, Kai Ritchter and Rene Freidinger,. (2004). A PIN Entry Method Resilient Against Shoulder Surfing. Proceedings of the 11th ACM Conference on Computer and Communications Security: pp. 236-245.

[2]

Eric Brier, David Naccache and Pascal Paillier. (2003). Chemical Combinatorial Attacks on Keyboards. Cryptology ePrint Archive, Report 2003: pp.217.

[3]

Bill Phillips. (2005) The Complete Book of Locks and Locksmithing.(Sixth Edition). book, McGraw-Hill. Chapter 1, pp.1-5.

[4]

James Ohwofasa Akpeninor. (2012). Modern Concepts of Security. book, AuthorHouse, chapter 6, pp. 86-97.

[5]

Bill Ballad, Tricia Ballad and Erin Banks. (2011). Access Control, Authentication, and Public Key Infrastructure. Book, Jones & Bartlett Learning, Chapter 1, pp. 13-15.

[6]

Dhiren R. Patel. (2008). Information Security: Theory and Practice. Book, Prentice-Hall, Chapter 1, pp. 9-10.

[7]

Wiedenbeck, S., Waters, J., Birget, J.C., Brodskiy, A., and Memon, N. PassPoints: design and longitudinal evaluation of a graphical password system. International Journal of Human- Computer Studies, 63, (2005), pp. 102-127.

[8]

A. Firdaus (2008). Electronic Combination Lock Using PIC. Thesis of Falculty of Electronic and Computer Engineering.

[9]

Sadeque Reza Khan. (2012). Development of Low Cost Private Office Access Control System(OACS). International Journal of Embedded Systems and Applications (IJESA) Vol.2, No.2.

57

[10]

Muhanad Hayder Mohammed. (2012). "SECURE ELECTRONIC LOCK USING PIC 16F628A MICROCONTROLLER."International Journal of Research in Computer Science, 2 (5): pp. 43-47.

[11]

Si Tong Sun et al. (2011). The Design of Electronic Code Lock. , Advanced Materials Research (Volume 267), Manufacturing Systems and Industry Application: pp. 1001-1004.

[12]

Inderpreet Kaur,. (2010). "Microcontroller Based Home Automation System With Security." (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 1, No. 6.

[13]

Li Hui, Yang Hong-tao, Li Xiu-lan. (2010). Design and application of new kind of electronic and mechanical antitheft lock using DSP. 2010 International Conference on Computer, Mechatronics, Control and Electronic Engineering (CMCE). A. Fang, X. Ye, M. Gong, W. Yang, L. Zhang. (2008). The circuit designing of the intelligent door lock. 2008 ISECS International Colloquium on Computing, Communication, Control, and Management. N-G Choi, H-J Lee, S-H Leel. (2005). A 13.56 Mhz RFID System. Applied Electromagnetics, 2005. APACE 2005. Asia-Pacific Conference. R. Alecsandru, W. Pruehsner, John D. Enderle Ph.D. (1995). Remote Door Lock Controller. Bioengineering Conference, 1999. Proceedings of the IEEE 25th Annual Northeast. Hassan H., Bakar R.A., Mokhtar A.T.F. . (2012). Face Recognition Based on Auto-Switching Magnetic Door Lock System . System 2012 International Conference on Engineering and Technology (ICSET): pp. 1- 6. E. Phelps, W.R. Pruehsner, J.D. Enderle (2000). Soni-key voice controlled door lock [for disabled persons]. Bioengineering Conference, 2000. Proceedings of the IEEE 26th Annual Northeast: pp. 165- 166. Saravanan K., Saranya C., Saranya M. (2012) A new application of Multi modal Biometrics in home and office security system. National Conference On Control, Communication And System Engineering: pp. 435-440. J.R.R. De Josef , B.D. Gerardo, M.B.S. Concepcion , K.G.V. Oreta, YungCheol Byun. (2012). Ultrasonic Key Recognition: Security Algorithm for Pre-composed High Frequency Sound as a Mode of Unlocking a Security Lock. 2012 IEEE/ACIS 11th International Conference on Computer and Information Science, pp. 655-660.

[14]

[15]

[16]

[17]

[18]

[19]

[20]

58

[21]

D. H. Yoon, D. J. Bae, H. S. Kim. (2006). Implementation of Home Electric Appliances Control System based on the Mobile and the Internet. SICEICASE, 2006. International Joint Conference: pp. 3730- 3733. Adams, A. Sasse, M. A. and Lunt, P. (1997) Making Passwords Secure and Usable. HCI '97 - People and Computers XII, pp.1-20. Springer-Verlag, Bristol.

[22]

[23]

Olivia B. Waxman. (October 2012). The 25 worst passwords of 2012. TIME magazine Tech department.

[24]

A. Adams & M. A. Sasse (1999). Users are not the enemy: Why users compromise security mechanisms and how to take remedial measures. Commun. ACM 42(12): pp. 4046.

[25]

Menkus, B. (1988). "Understanding the use of passwords." Comput. Secur. 7(2): pp. 132-136.

[26]

Svigals, J. (1994). "Smartcards a security assessment." Comput. Secur. 13(2): pp. 107-114.

[27]

Dhiren R. Patel. (2008). Information Security: Theory and Practice. Book, Prentice-Hall, Chapter 8, pp. 170-203.

[28]

Brostoff, S., & Sasse, M.A. (2000). Are Passfaces more usable than passwords? A field trial investigation. In Proceedings of HCI 2000, Sept. 58, Sunderland, U.K. Springer., pp. 405-424 .

[29]

Herman Miller.(2001). Experience of Color. Pdf, Herman Miller Inc, pp.112. Retrieved November 26, 2012, from

http://www.hermanmiller.com/hm/content /research_summaries/pdfs/wp_Experience_of_Color.pdf. [30] [31] David Hubel. (1995). Eye, Brain, and Vision. book, Chapter 8 Color Vision. Francis, M. A. and R. J. Irwin (1998). "Stability of memory for colour in context." Memory (Hove, England) 6(6). pp. 609-621. [32] Huchendorf, Lynnay, (2007). The Effects of color on memory. UW-L Journal of Undergraduate Research X, pp. 1-4. [33] Schanda, J. (2006). "Light, vision, and color. Arne Valberg, John Wiley & Sons, Ltd., 2005, pp. 464 .

59

[34]

Lois Swirnoff,w.w. (2003). Dimensional Color, 2nd Ed. Norton & Company, London and New York. pp.160.

[35]

M. Ali, M.N. Hajar Hasrol Jono, M. Yusof Darus, Norkhushaini. (2008). User Perceptions Towards the Use of Colour as Authentication Method: Focus on FTMSK Lecturer. Proceedings of the International Conference on Computer and Communication Engineering.

[36]

Gegenfurtner, K. R. and J. Rieger (2000). "Sensory and cognitive contributions of color to the recognition of natural scenes." Current biology : CB 10(13). pp. 805-808.

[37]

Lin Ching Chen (1997). The Effects of Color Background Information on Childrens Cognitive Learning. Journal of Visual Literacy, Vol 17, Number 2, pp. 39-52.

[38]

Y. Pan (2010). Attentional capture by working memory contents. Canadian Journal of Experimental Psychology, 64 (2), pp. 124-128.

[39]

M. Faiz M. Mustafar, M. A. Dzulkifli. (2011). The Effect of Ground Colour on Memory Performance. The 8th International Postgraduate Research Colloquium.

[40]

H. Gao, X. Liu ,R. Dai. ,S. Wang, X. Chang. (2009) Analysis and Evaluation of the ColorLogin Graphical Password Scheme. Fifth International Conference on Image and Graphics.

[41]

Color Contact software description. Retrieved November 10, 2012, from http://www.e7fanclub.com/2011/10/color-contacts-lock-10-symbian3anna.html.

[42]

Gallery SMS Color Lock software description. Retrieved November 10, 2012, from http://store.ovi.com/content/213346.

[43] Hirsch-Identive (2012) ScramblePad product sheet. Retrieved November 15, 2012, from http://hirsch-identive.com/products-services/physical-

security/readers-keypads-biometrics/scramblepad/ds47l#tab1. [44] Swivel Solution (2012) PINSAFE brochure. Retrieved November 15, 2012, from http://www.swivelsecure.com/core-technology/pinsafe/.

60

[45] [46]

Dale Wheat. (2011). Arduino internals. Technology in Action, pp. 1-25. Harold Timmis. (2011). Practical Arduino Engineering. Technology in Action.

[47]

Atmel (2011). Atmel mega 2560 datasheet. Datasheet. Retrieved November 15, 2012, from http://www.atmel.com/images/doc2549.pdf.

61

APPENDIX A Arduino Mega 2560 schematic

S-ar putea să vă placă și