1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Design And Implementation Of Smart Door-Lock System.pdf

85 0 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Design And Implementation Of Smart Door-Lock System
Tác giả Pham Dang Khoa, Pham Duc Phuong
Người hướng dẫn Le Minh, Me
Trường học Ho Chi Minh City University of Technology and Education
Chuyên ngành Computer Engineering Technology
Thể loại Graduation Project
Năm xuất bản 2024
Thành phố Ho Chi Minh City
Định dạng
Số trang 85
Dung lượng 5,6 MB

Cấu trúc

  • CHAPTER 1: OVERVIEW (18)
    • 1.1. INTRODUCTION (18)
    • 1.2. OBJECTIVES (18)
    • 1.3. SCOPE (19)
    • 1.4. OUTLINE (20)
  • CHAPTER 2: BACKGROUND (21)
    • 2.1. FACENET (21)
    • 2.2. RADIO FREQUENCY IDENTIFICATION (26)
    • 2.3. SPI PROTOCOL (27)
    • 2.4. I2C PROTOCOL (28)
  • CHAPTER 3: DESIGN AND IMPLEMENTATION (31)
    • 3.1. REQUIREMENTS AND BLOCK DIAGRAM (31)
      • 3.1.1. SYSTEM REQUIREMENTS (31)
      • 3.1.2. BLOCK DIAGRAM OF SYSTEM (32)
    • 3.2. DETAIL DESIGN (34)
      • 3.2.1. HARDWARE DESIGN (34)
        • 3.2.1.1. PERIPHERAL BLOCK (34)
        • 3.2.1.2. CENTRAL PROCESSING BLOCK (45)
        • 3.2.1.3. POWER SUPPLY BLOCK (49)
      • 3.2.2. GENERAL CONNECTIONS (50)
    • 3.3. FLOWCHARTS (51)
      • 3.3.1. PASSWORD AND RFID THREAD (52)
      • 3.3.2. FACE RECOGNITION THREAD (59)
  • CHAPTER 4: RESULTS (64)
    • 4.1. HARDWARE IMPLEMENTATION AND PERFORMANCE EVALUATION (64)
      • 4.1.1. HARDWARE IMPLEMENTATION (64)
      • 4.1.2. PERFORMANCE EVALUATION (69)
    • 4.2. SYSTEM OPERATION (74)
      • 4.2.1. UNLOCK BY USING PIN (75)
      • 4.2.2. UNLOCK BY USING RFID (76)
      • 4.2.3. UNLOCK BY USING FACE RECOGNITION (77)
  • CHAPTER 5: CONCLUSIONS AND FUTURE WORK (80)
    • 5.1. CONCLUSIONS (80)
    • 5.2. FUTURE WORK (81)

Nội dung

Content of the project: The authors have designed and implemented a door lock that supports 3 unlock methods: facial recognition, RFID card, md password.. The effectiveness and robustnes

OVERVIEW

INTRODUCTION

In today's world, maintaining safety and security is crucial to protect individuals and their assets from illegal activities This focus on personal social security emphasizes the safeguarding of personal information and valuable belongings To enhance security, video surveillance and door lock access control systems have been implemented, utilizing various personal authorization methods These methods include PC-based, network-based remote, smart device-based local, and printed document-based authorization, all designed to minimize unauthorized access to building facilities.

OBJECTIVES

Our project aims to enhance home security by designing and implementing a SMART DOOR-LOCK system, providing homeowners with improved safety features The key functions of this innovative system are outlined below.

Facial recognition technology is essential for advancing towards a modern 4.0 lifestyle, seamlessly integrating with current AI trends Our smart door system incorporates this capability, allowing users to easily add or remove faces as desired, enhancing security and convenience.

Unlock by RFID: To improve convenience and expand user choice, integrating magnetic card scanning is also a form desired by most users

 Master card: This tag acts as an admin allowing the owner the right to add tags or delete tags

 Member card: With this method, the member card can be easily added by the owner, thereby increasing the number of users conveniently

Unlocking devices with a PIN remains a common security method, allowing users to personalize their password preferences while ensuring protection for modern utilities.

Easily manage user access by flexibly adding or removing users from the system, ensuring a seamless experience The process of adding users through facial recognition and magnetic cards is straightforward and efficient, meeting essential user requirements.

Direct unlock: This is a method allowing people inside to rapidly open the door without having to perform any additional security methods other than pressing a button

Interact with users: Users can monitor system operation and take futher action with the device.

SCOPE

Face recognition technology offers convenient detection capabilities; however, optimal recognition depends on various factors, including lighting conditions For effective scanning or adding a new user's face, it is essential for the user to position themselves approximately 60 cm from the webcam Due to the resource-intensive nature of facial recognition, our system is designed to store a maximum of 9 user faces within its scanning function.

Password: The password is set to a sequence of 4 characters including all the characters that can be pressed on the 4x4 keypad

Number of users: The number of users in the three security methods will have different limits:

 Face scanning: limited to 9 user’s faces

 RFID: Depends on the user and is limited to home usage

 Password: Anyone who knows the password can unlock the device

Under environmental conditions: External conditions affect device performance

 The system will operate well in room temperature conditions below 35 degrees and avoid

 The system is not water-resistant, so it should not be placed in high-humidity environments or exposed to direct contact with water

The SMART LOCK-DOOR system operates directly from an adaptor, which means that during a power outage in a residential area, it, like other electronic devices, will be unable to function.

Proper lighting is crucial for accurate facial recognition To ensure optimal performance, the device must be positioned in an area with sufficient light, steering clear of direct sunlight and environments with complicated lighting scenarios.

OUTLINE

The outline of the thesis is divided into five chapters as follows:

 Chapter 1 Introduction: This chapter provides an overview of the literature review, the study's objectives, the research methods, the constraints, and the structure of the report

Chapter 2 offers a comprehensive overview of the theoretical framework that supports the methodologies employed in this study, highlighting the FaceNet face recognition package and the essential theories related to the system's hardware components.

Chapter 3 focuses on the design and implementation process, detailing how to identify solutions to a problem and establish requirements for the proposed system It begins with a high-level overview and then explores the specifics of the algorithms involved.

 Chapter 4 Results: This chapter presents the outcomes of the system deployment

 Chapter 5 Conclusions and Future Work: This chapter provides conclusions and future work.

BACKGROUND

FACENET

Facial recognition technology has advanced significantly in recent years, driven by deep learning and neural networks Key contributors to this progress include ArcFace, an innovative face recognition algorithm, and MobileNetV2, a lightweight neural network designed for mobile and edge devices While ArcFace may exhibit lower precision compared to models like Facenet512 and Facenet, it stands out for its speed and portability, making it ideal for use on edge devices such as Raspberry Pi.

This article delves into advanced methodologies for face detection, highlighting the superiority of Deep Convolution Networks over traditional handcrafted features We evaluated four prominent deep learning models: FaceNet by Google, DeepFace by Facebook, VGGFace from Oxford, and OpenFace from CMU Among these, FaceNet emerged as the most effective, showcasing exceptional results Renowned for its innovative architecture, FaceNet employs inception modules to reduce trainable parameters, processing RGB images at a resolution of 160×160 and generating a 128-dimensional embedding for each image It is crucial to extract faces from images before utilizing FaceNet, which requires additional functions for optimal implementation.

Table 2.1 FaceNet compare with the other [1]

The table presents the optimal split point thresholds and associated performance metrics for various models across different distance metrics, including Cosine, Euclidean, and Euclidean L2 Notably, the FaceNet model demonstrates impressive results, achieving an accuracy of 98.21% and a perfect precision of 100% with a threshold of 0.40 when utilizing the Cosine distance metric.

FaceNet, developed by Google in 2015, utilizes a model that produces a 128-feature vector for each face, aligning its input with the output size It employs Support Vector Machines (SVM) to cluster these vectors and identify corresponding identities By learning a direct mapping from facial images to a condensed Euclidean space, FaceNet ensures that distances in this space reflect facial similarity This innovative approach allows for the seamless application of standard methodologies that use FaceNet embeddings for tasks like facial recognition, verification, and clustering.

The FaceNet system utilizes a deep convolutional network that optimizes embeddings directly, eliminating the need for an intermediate bottleneck layer found in earlier deep learning methods It employs a unique online triplet mining technique for training, using triplets of closely aligned matching and non-matching face patches This innovative approach greatly enhances representational efficiency.

FaceNet to achieve state-of-the-art face recognition performance using only 128 bytes per face

The network comprises a batch input layer, a deep CNN with subsequent L2 normalization to generate the face embedding, and utilizes triplet loss during training

A Convolutional Neural Network (CNN) is a leading neural network architecture in Computer Vision, a branch of Artificial Intelligence focused on enabling machines to understand and analyze visual data, especially images.

Convolutional layers are crucial for feature extraction in input datasets, utilizing learnable filters or kernels, typically sized 2×2, 3×3, or 5×5 These filters slide over the input images, calculating the dot product between the kernel weights and corresponding image patches to generate feature maps For instance, employing 12 filters in this layer results in an output volume with dimensions of 32 x 32 x 12.

Max pooling is a widely used technique in convolutional neural networks that reduces the size of feature maps by selecting the maximum value from non-overlapping regions This process enhances translation invariance, ensuring that minor shifts in the input data have minimal impact on the pooled results.

A dense layer, or fully-connected layer, is commonly utilized in the final stages of a convolutional neural network (CNN) architecture to classify features extracted by earlier convolutional and pooling layers This layer processes the flattened output from the last convolutional or pooling layer through interconnected neurons, ultimately generating the final classification result.

The convolutional neural network encodes images into 128-dimensional vectors, which are then utilized as inputs for the triplet loss function to assess the distance between them.

Figure 2.3 Triplet loss in FaceNet [1]

The symbols for Anchor, Positive, Negative are respectively: A, P, N

The loss function aims to minimize the distance between two negative images while maximizing the distance between two positive images To achieve this, it is essential to choose sets of three images strategically.

To enhance the algorithm's learning process, it's crucial to select an anchor image that is significantly different from a positive image, ensuring a substantial distance in representation This is akin to choosing a childhood photo in contrast to a recent one, which presents the algorithm with more complex variations to analyze When effectively recognized, this strategy can lead to improved intelligence in the algorithm.

The Anchor and Negative share a close resemblance, making careful selection crucial to maintain a minimal distance, d(A, N) This concept parallels an algorithm that differentiates between images of a sibling who resembles you and those of yourself.

The triple loss function always takes 3 points as input and in all cases we expect: d(A, P) < d(A, N) (2.1)

To make the distance between the left and right sides larger, we will add a very small non-negative coefficient to the left side Then (2.1) becomes:

So the loss function will be: L (A, P, N)(2.2)

In there is the number of sets of 3 points included in training

Correctly identifying Negative and Positive images, whether as the same pair or different pairs with the Anchor, will not impact the outcome Our primary objective is to reduce instances where the model mistakenly classifies Negative images as Positive To achieve this, we will modify the loss function by adjusting the contribution value of accurately identified Negative and Positive cases to zero, thereby minimizing their influence on the overall loss.

𝟐+ 𝜶 ≤ 𝟎 (𝟐 𝟐) will be adjusted to 0 Then the loss function becomes: L (A, P, N) =(2.3)

Utilizing triplet loss in convolutional neural network models enables the network to create optimal vector representations for images This approach effectively distinguishes between similar negative and positive points, while simultaneously clustering points with identical labels closer together in Euclidean space.

RADIO FREQUENCY IDENTIFICATION

RFID technology utilizes radio waves to access data from electronic tags, making it a preferred choice for consumers seeking enhanced security Its swift and accurate identification capabilities improve retail inventory management, logistics efficiency, and healthcare safety The adaptability of RFID across various tag formats underscores its scalability and effectiveness in diverse operational settings This non-invasive data retrieval method has revolutionized operational efficiency and automation across multiple industries.

An RFID system comprises essential components:

 Tags: Individuals transporting distinct identification information, encompassing passive tags that depend on reader energy and active tags equipped with their own power source for extended communication

 Readers: Send and receive signals to interact with tags, collecting data for analysis in computer systems

 Antennas: Essential for facilitating communication between readers and tags, emitting and receiving radio waves play a crucial role in determining the range and effectiveness of communication

 Middleware: A type of software is responsible for filtering and organizing data gathered by readers before sending it to central databases or software applications

 Software and Database: Managing collected RFID data within applications, and seamlessly integrating it with current business operations

 Network Infrastructure: Critical for efficient communication and easy data transmission between RFID system components, ensuring successful operation across multiple industries.

SPI PROTOCOL

The Serial Peripheral Interface Bus (SPI) is a full duplex synchronous serial data link standard developed by Motorola, allowing devices to communicate in a master/slave configuration In this setup, the master device initiates data frames, enabling multiple slave devices through dedicated chip select lines Often referred to as a "four-wire" serial bus, SPI distinguishes itself from other protocols that use fewer wires Its versatility and synchronous operation facilitate simultaneous data transmission and reception during SPI transfers.

SPI device has 4 kind of signals:

 Main out, subnode in (MOSI)

 Main in, subnode out (MISO)

To initiate SPI communication, the master device provides the clock signal and activates the CS signal to select the slave node, typically using an active low signal (logic 0) SPI functions as a full-duplex interface, allowing simultaneous data transmission between the master and slave nodes via the MOSI and MISO lines During SPI communication, data is serially shifted out through the MOSI/SDO bus while being concurrently sampled from the MISO/SDI bus, with synchronization maintained by the serial clock edge Users can choose either the rising or falling edge of the clock for data sampling and shifting in the SPI interface.

I2C PROTOCOL

The 2C protocol is a two-wire serial communication system that employs a serial data line (SDA) and a serial clock line (SCL) for efficient communication This protocol enables multiple target devices to connect on a single bus and supports various controllers for transmitting and receiving commands and data Data is sent in byte packets, with each packet assigned a unique address that corresponds to the intended target device.

 SDA (serial data): the data transmission and reception line for the master and slave

 SCL (serial clock): the line on which the clock signal is carried

The I2C protocol facilitates data transfer via messages composed of data frames Each message features an address frame that contains the binary address of the slave device, along with one or more data frames that carry the actual transmitted data Furthermore, the message incorporates essential elements such as start and stop conditions, read/write bits, and ACK/NACK bits that are interspersed between each data frame.

 Start Condition: Before the SCL line switches from high to low, the SDA line transitions from a high voltage level to a low voltage level

 Stop Condition: After the SCL line transitions from low to high, the SDA line transitions from a low voltage level to a high voltage level

 Address Frame: A sequence of 7 or 10 bits unique to each slave is used to identify the slave when the master needs to communicate with it

 Read/Write Bit: One bit that indicates whether data is being sent from the master to the slave (low voltage level) or requested from it (high voltage level)

The ACK/NACK bit is a crucial component in communication protocols, where the sender expects an acknowledgment after receiving each frame Upon successful receipt of either an address frame or data frame, the receiving device responds by sending an ACK bit back to the sender, confirming the successful transmission.

DESIGN AND IMPLEMENTATION

REQUIREMENTS AND BLOCK DIAGRAM

The SMART DOOR-LOCK system is meant to provide user safety and convenience, hence it must satisfy the following requirements:

Unlocking devices using facial recognition technology involves capturing data through a camera, which is then processed by the FaceNet model and facial recognition software to extract unique features, enabling accurate identification of the user's face.

Unlocking by RFID technology has gained immense popularity, as magnetic card scanning is now widely utilized across various sectors The RFID module plays a crucial role in this process by efficiently reading and writing the information contained on the cards.

Unlocking using a PIN is a straightforward method that simplifies access compared to other techniques Users can easily press buttons on a keypad, which continuously scans its rows and columns to transmit signals to the central device This process allows for real-time performance, displaying information on the user's LCD The keypad, equipped with a number sequence from 0-9 and letters A-B-C-D, serves as an effective input choice within the system.

Direct unlock offers users a seamless experience by utilizing a single button that sends an immediate signal to the system, allowing for instant access without the need for re-authentication through multiple security methods This convenience is particularly beneficial for individuals looking to exit their homes quickly and efficiently.

User interaction is facilitated through keypads, allowing individuals to operate the system effectively, while an LCD display provides real-time feedback on task completion The device's user interface is crafted to ensure ease of use for all family members.

The system offers flexible user expansion, featuring both facial recognition and RFID technology to accommodate a growing number of users The facial recognition capability can support up to nine distinct user faces, while the RFID feature allows for customization based on the owner's preferences, particularly among family members.

The diagram below will offer an overview of what the complete system will consist of, especially the actions of each block that exists in the system

Figure 3.1 Block diagram of SMART DOOR-LOCK system

In Figure 3.1, the system of project is represented as being divided into 9 primary blocks:

The RFID Block is used to capture analog signals from RFID cards/tags, converting them into digital signals, and then sending these signals to the CENTRAL PROCESSING

To enhance facial recognition alongside a specific model, an efficient method for managing user data is essential This involves not only allowing the machine to learn from previously captured images but also facilitating the easy addition or removal of faces In this context, the Camera block serves as a crucial data receiver for the system, streamlining the process of user management.

The keypad serves as a crucial interface for user interaction with the system, allowing users to select the "open the door" option To unlock the door, users can enter a personal identification number (PIN), which the keypad processes It verifies the entered PIN for accuracy and, based on this validation, communicates the correct command to the device, enabling access.

NOTIFICATION Block and DISPLAY Block:

The system will respond to user interaction and notify necessary information via DISPLAY block and NOTIFICATION block

Receive interaction from the user via the push button when opening the door from the inside

Its function is to receive control signals from the central processing unit to secure or release based on pre-established sequences

The central processing unit (CPU) is essential for receiving and processing data from various sources, including the RFID, KEYPAD, and CAMERA blocks It processes this data based on preset control sequences and sends control signals to the DISPLAY, NOTIFICATION, and DOOR-LOCK CONTROLLER blocks Additionally, the CPU manages communication with peripherals and provides power to connected devices such as the RFID, CAMERA, DISPLAY, and DOOR-LOCK CONTROLLER blocks.

The power supply unit is essential for delivering stable power to the entire system, including all peripheral devices It plays a crucial role in safeguarding the hardware from potential problems like overloads, overheating, overvoltage, short circuits, and low voltage, ensuring reliable operation and system integrity.

DETAIL DESIGN

When designing an RFID block, it's crucial to integrate convenient interfacing, efficient communication, programmability, low power consumption, a compact form factor, and cost-effectiveness A key requirement is the ability to quickly receive, process, and transmit signals to the central processing unit.

The RC522 module is a top choice among RFID modules due to its ability to meet essential criteria, making it the preferred option for RFID applications It will be connected to the Central Processing block to perform its designated functions effectively.

RC522 connects to CENTRAL PROCESSING BLOCK according to SPI standard, while CENTRAL PROCESSING BLOCK acts as a 3.3V power source for RC522

Table 3.1 Technical specifications of RC-522

IDEAL DISTANCE FOR READING DATA 0-60mm

RFID modules operate using specific connection protocols, categorized into passive and active systems Passive RFID systems commonly employ basic protocols such as UART, SPI, or occasionally I2C, while active RFID systems utilize wireless protocols like Bluetooth or Wi-Fi for long-range data transmission The SPI protocol is particularly favored in RFID applications due to its efficiency and fast data transfer speeds, making it ideal for scenarios that demand quick and straightforward communication between RFID tags and readers.

Identifying and isolating facial features is crucial for the system, as these elements are minimally affected by recording equipment Consequently, choosing a high-resolution camera that can capture steady, high-quality color images is essential.

Figure 3.4 Webcam Xiaovv XVV-6320S-USB

Maintaining uniform brightness is critical for the CAMERA block to obtain and analyze images with precision and dependability, safeguarding image quality against external influences

The Camera and Central Processing unit will connect through the USB standard, enabling the camera to transmit facial image data to the face recognition program while simultaneously receiving power for operation.

Table 3.2 Technical specifications of Webcam

VIDEO FORMAT H.264 H.265 MJPG NV12 YUY2

The Xiaomi Xiaovv XVV-6320S-USB 1080P webcam offers impressive Full HD 1080P resolution, delivering sharp images with vibrant colors Its USB 2.0 interface guarantees seamless connectivity and compatibility with Raspberry Pi, making it an ideal choice for the CAMERA component of your system.

To access the project PIN, users only need to input a simple password composed of a limited set of numeric characters The system is designed to include all digits from 0 to 9 and alphabetic letters, facilitating user navigation through various operations Consequently, the 4x4 keypad is ideal for meeting these essential requirements.

The 4x4 matrix keypad features 16 keys arranged in a grid of 4 rows and 4 columns, allowing for efficient circuit completion when a key is pressed Each row is connected to a row pin, while each column links to a column pin, enabling the microcontroller to identify the pressed key by scanning the connections This matrix design significantly reduces the number of pins required to connect the keypad to the microcontroller compared to a setup where each key has its own input pin.

To identify which key is pressed, the microcontroller scans the rows and columns in succession, applying a logic low to each row while monitoring the column inputs This scanning method enables the microcontroller to accurately determine the specific key that has been activated.

The keypad interfaces with the Central Processing Block through 8 GPIO pins, where four pins function as OUTPUT to send signals to the keypad, while the other four serve as INPUT to receive signals This keypad operates as a 4x4 matrix, with intersection points acting as switches When a button is pressed, the processor identifies the corresponding row and column in the matrix to confirm the displayed characters.

Table 3.3 Technical specifications of 4x4 Keypad

Key keypads, constructed from either plastic or silicone rubber, function based on a fundamental principle where each key acts as an individual switch For example, a keypad featuring 12 keys will include 12 corresponding switches, and keypads with more keys will naturally have an increased number of switches.

Keypads function as switch-like devices, with each key acting as a unique switch These keys contain circuits that can be either open or closed, similar to other switch types.

By default, the switches connected to a keypad's keys remain in the open position

Keys are engineered to remain inactive without contact with the conductive contacts beneath them, ensuring that the switch circuits remain open When a key is pressed, it closes the circuit by connecting its conductive point to the underlying contact, while releasing the key breaks the circuit, reverting it to the open state.

To enhance customer convenience when exiting, incorporating a button into the system is a practical solution By pressing the button, a signal is swiftly sent to the CENTRAL PROCESSING unit, which promptly unlocks the door.

In the schematic, a 10KΩ pull-up resistor is used to connect the push button to ground, which prevents the Central Processing Block from accurately determining the pin's voltage level, as it can be either HIGH or LOW To address this issue, we will implement a pull-down resistor to guarantee that the pin remains in a LOW state, ensuring reliable readings for the Central Processing Block.

FLOWCHARTS

The system is configured with three functions, therefore for ease of use, the functions will be separated into two threads for parallel execution

Figure 3.20 Two threads in system

The DOOR-LOCK program operates through two main threads: the first handles door opening by verifying passwords or accepting function keys from the keypad, enabling access to features like password changes, magnetic card usage, and user management; the second thread focuses on facial scanning, allowing for the creation or deletion of a user database after passing a security check via a PIN method.

The first thread will contain 2 functions including RFID and Pin code entry

Upon activation, the system begins reading data from the save file Users can easily select and execute preset functions using the keypad buttons Once the security procedure is completed, regardless of the authentication outcome, the system will promptly terminate.

 The program starts with the "Begin" step

 It then reads password, magnetic card's id (master and member card) from a file saved in Raspi4

Figure 3.21 Flowchart of DOOR-LOCK program

 Next, it reads the keypad input function The User will use keypad to communicate with system by pressing in this

If user don’t interact with keypad, system will restart process and enter rest mode

 The backlight will turn off after 30 seconds when no buttons are pressed

When the user presses 'A', the program verifies the accuracy of the old password If the password is correct, the program will proceed to change the password However, if the password is incorrect, the program will terminate.

 If the user presses 'B', the program performs an RFID function

When a user inputs their password, the system will unlock if the password is correct; however, if the password is incorrect, the program will terminate.

The “read keypad input”, “the rest mode” and “RFID function” will be described in detail at below

When the system is enabled, if the user does not engage with it within 30 seconds, the system will switch off the screen and resume the procedure

 The flowchart starts with a “Begin” Rest mode subprogram" terminator, indicating the beginning of the process

Once begun, the system will wait for user contact before proceeding to one of two scenarios based on whether or not the user interacts with the system

 It then checks if the keypad button is pressed o If the keypad button is pressed, the process turns on the backlight It then resets the

"Count" variable to 0 o If the keypad button is not pressed, the process increments the "Count" variable by

If the user enters a keypad button while waiting, the system will wait another 30 seconds before proceeding to the next procedure

The flowchart monitors the "Count" variable to determine if it has reached 150, which takes approximately 30 seconds If the "Count" reaches 150, the process will deactivate the backlight and conclude, followed by a reset of all ongoing operations Conversely, if the "Count" has not yet reached 150, the process will simply terminate.

When the user clicks any button on the keyboard, the keypad is designed to continually scan for and receive signals Details are detailed in the image below

Figure 3.23 Flowchart of KEYPAD INPUT subprogram

This subprogram activates the first row of the keypad, designating it as an output while the columns function as inputs To prevent button bounce after a user presses a button, the system operates in "Holding button" mode Once the row and column are triggered to a high level, the system will subsequently revert them to a low level.

 The process starts with "Begin” read keypad input, which suggests that the program begins by reading input from a keypad

 Next, it "Consider 1 Row, and load characters in that Row to array"

 The "Set Row to High level" step sets the current row to a high level, which occurring continuously for all Row

The system continuously scans each step, undetectable to the naked eye When the user presses a column, a signal is emitted corresponding to the HIGH level of that row, prompting the program to generate the appropriate character.

 There is a "Holding the button" step, which using for avoiding the “Switch bounce” phenomenon

 The final step is to "Set the Row to Low level", which resets the row to a low level

In RFID, the system clearly distinguishes between two sorts of cards, the master card having more authority and distinct functions than the member card

The RC-522 functions as a card reader that scans magnetic cards, effectively reading card data and differentiating between two types: Master cards and Member cards.

 Start RFID function: This is the starting point of the process

Figure 3.24 Flowchart of RFID FUNCTION subprogram.

 Read card's ID by the Reader: The RFID reader reads the ID of the card presented to it

To determine the type of card, the system first verifies if the card's ID corresponds to a Master's card If the ID matches, it activates the "Master's Card function." Conversely, if the ID does not match, the system then checks whether the card's ID is associated with a member's card.

To ensure secure access, the system first verifies whether the card's ID corresponds to a member's card If the ID matches, the process continues to the "Unlock" function; however, if it does not match, the procedure is terminated.

To be more explicit about the function of adding and deleting cards from the master card, the system has been programmed as follows

Figure 3.25 Master’s card function subprogram

The "Predefined process" symbol in the RFID FUNCTION subprogram flow chart indicates the need for a master card, which acts as an administrator to enable admin powers Setting up this master card is essential for executing the various functions outlined in the instructions below.

 The process begins with the "Begin" Master's card function step, where the user has the option to either "Choose A Change" or "Choose B Unlock" o If the user chooses "Choose A Change":

 "Add new card": If the card does not exist, the user can "Use other card please"

If the card does not exist, the user can "Use other card please"

The system prevents users from removing the "Master's card." It then verifies whether the "ID exists in the data file."

If the card ID is present, the system will remove it from the data file; otherwise, it will indicate that the card is not in the database and terminate the program Additionally, users have the option to select "B Unlock," which initiates the unlocking process.

The face recognition system is organized into a separate thread to ensure that its functionality can operate simultaneously with the "RFID and PIN code" thread.

Figure 3.26 Flowchart of FACE RECOGNITION THREAD

For seamless operation, the facial recognition system must be deployed in a separate thread, enabling users to complete their selections without interruption This system allows users to unlock doors using facial recognition, as well as add or remove other users' faces To modify a user's facial profile, the user must select the desired options and enter their previously established PIN code to finalize the changes.

 The process starts with the "Begin" Face Recognition Thread step

RESULTS

HARDWARE IMPLEMENTATION AND PERFORMANCE EVALUATION

Following the design and implementation phases, the system is now fully operational, aligning with the established objectives The implementation team has effectively assembled the components and structured the layout to enhance user experience Below are actual images showcasing the product post-construction.

Figure 4.1 Smart Door-Lock system

The product features a rectangular box measuring 165mm x 95mm at the base and standing 210mm tall, including the camera Its cover is constructed from 5mm thick formex cardboard, offering a cost-effective yet sturdy solution capable of supporting devices mounted directly on top.

Figure 4.2 Front side of the product

The product features a user-friendly front interface that includes a 4x4 keypad for password login, password changes, and system customization Above the keypad, a magnetic card reader enables interactive functions with magnetic cards Additionally, a 16x2 LCD screen displays essential information, allowing users to monitor system operations and make informed choices In the bottom right corner, a 5V buzzer speaker provides auditory feedback, notifying users of successful or failed actions and responding to keypad inputs.

Figure 4.3 Left side of the product

The system features a robust magnetic lock, positioned on the left side of the protective box, which operates based on signals from the system Weighing approximately 140g, the lock is reinforced with a durable formex cover and a drawstring A strategically placed gap measuring 40mm x 70mm allows access to the RaspPi4's connection ports, including USB and Ethernet, facilitating easy connections for camera USBs and Ethernet for system development Additionally, this gap aids in air circulation, helping to dissipate heat and prevent overheating of the RaspPi4 during operation.

Fig 4.4 Back side of the product

The system features a convenient exit option for individuals inside the house, allowing them to unlock the door effortlessly by pressing a button located in an unobstructed area This button is designed to facilitate easy access without the need to bypass any security measures The power source for the system is situated beneath the button, with a plug for a 12V/1A adapter to power the magnetic lock and a separate plug for the RaspPi4, which operates on a 5V/3A adapter.

Figure 4.5 Top side of the product

The webcam, designed to recognize the user's face, is strategically positioned on top of the Formex box, ensuring an unobstructed view for capturing images This optimal placement allows the camera to effectively monitor users without interference from other system components.

Fig 4.6 Inside of the product

The system's box includes essential devices like the Door-Lock Controller block and RaspPi4, securely held together using plastic glue, hinges, tape, and drawstrings Flexible reinforcement techniques are employed to ensure the device is stable while allowing for easier future repairs.

Figure 4.7 Door-Lock Controller block position

The door-lock control block is located here, featuring a relay module, a magnetic lock, and the wiring connected to the magnetic lock's power supply All devices are securely fastened with a drawstring for enhanced safety.

Figure 4.8 The bottom of the product

The RaspPi4 is located at the bottom of the box, which is the central position of the protection box, making it convenient for wiring and connecting to other blocks.\

The system's capacity to recognize users' faces is highly effective To more specifically examine the system's recognition ability, the researchers tested it in a variety of lighting conditions and challenges

In this indoor experiment, fluorescent lamps will provide sufficient lighting as the system is configured to recognize user_1's face The experimenter will consistently face the camera to ensure accurate front-facing identification.

Figure 4.9 Recognizes frontal face in adequate lighting condition

The identification system demonstrated exceptional performance, accurately detecting faces in all 10 test cases To test its limits, the experimenter varied the distance and position of the face within the frame Results indicated that the system effectively recognizes users at distances ranging from 15cm to 70cm from the lens However, beyond this range, the system fails to detect faces, preventing the extraction of facial features and rendering it incapable of identifying even unknown individuals.

Figure 4.10: Recognizes side face in adequate lighting condition

Researchers are adjusting the angle of the face during identification, but this leads to a decline in accuracy The system often misidentifies individuals or identifies people not present in the dataset Consequently, the identification success rate is low, achieving only 40% accuracy with just 4 out of 10 identifications being correct.

Yellow light is widely used in many families and frequently occurs in hotels and restaurants, thus the team attempted to conduct research in a yellow light situation

Figure 4.11 Recognizes frontal face in yellow lighting condition

The study revealed that, like fluorescent lighting, adequate yellow light does not affect face recognition accuracy When presented at a frontal angle, face identification achieved a perfect success rate of 100% across ten trials Additionally, variations in face position and distance did not hinder the system's performance, maintaining a flawless success rate of 10 out of 10.

Figure 4.12: Recognizes size face in yellow lighting condition

The challenge of altering the face angle during recognition experiments revealed that the system struggled to accurately identify faces As a result, users were frequently not successfully recognized.

Inadequate lighting severely affects the facial recognition abilities of artificial intelligence models, posing challenges in low-light conditions When lighting is poor, accurately extracting facial features becomes difficult, leading to incorrect user predictions The system's effectiveness will be evaluated in two scenarios: one where the user's face is somewhat visible and another where it is not clearly visible at all.

Figure 4.13: Recognizes frontal face in poor lighting conditions when able to see the user's face

For optimal facial recognition, sufficient lighting is essential, enabling the system to fully identify the user's face The ideal conditions for accurate identification occur when the user is positioned at a frontal angle and within a distance range of 15cm to 70cm, ensuring reliable recognition without any confusion.

Fig 4.14 Recognizes frontal face in poor lighting conditions when unable to see the user's face properly

SYSTEM OPERATION

Upon launching the software, users are greeted with a welcome message on the LCD, confirming that the system has successfully started and is ready to perform its functions Additionally, the application will provide notifications to users through the front-side LCD display.

The Smart Door-Lock system has 3 methods to unlock magnetic locks, including using PIN, using RFID method, and using facial recognition

After the greeting message, the LCD prompts users with 'Enter your Pin.' At this point, users can authenticate their access either by entering their PIN via the keyboard or by utilizing facial recognition through the camera for unlocking.

The system utilizes a straightforward authentication method that requires a password for access, making it user-friendly and non-restrictive Homeowners can conveniently share this password with anyone, enabling easy entry without the need to set up additional user accounts.

This password authentication method necessitates users to input a four-digit password, represented by the '*' character, from a keypad to unlock a magnetic lock, ensuring that the password remains concealed during operation.

Users can effortlessly change their passwords by pressing the 'A' function button on the keypad, which initiates the password change process To set a new password, it is essential for the user to first input their correct existing password.

Magnetic cards are also a very trustworthy authentication system The advantage of this method is that users may open it fast without worrying about the password they generated

Figure 4.21 Normal RFID authentication process

To utilize this confirmation method, users must press the ‘B’ key This program allows users to unlock the door using any magnetic card stored in the system's database.

Users of MasterCard magnetic cards can enjoy an added feature that allows them to easily add or delete magnetic cards from their data By simply inserting the card they wish to manage into the reader, the program automatically handles the process.

4.2.3 UNLOCK BY USING FACE RECOGNITION

This cutting-edge technology enables users to unlock doors using facial recognition, enhancing security by storing unique facial features This system ensures both safety and convenience for users.

Figure 4.23 Face recognition in SMART DOOR-LOCK system

Upon launching the program, the face recognition method is activated alongside password authentication Users must position themselves in front of the camera, ensuring it remains unobstructed by accessories The system will then automatically identify the user's face to unlock the door.

Figure 4.24 Add new-Face for Face recognition

To activate the face addition feature, users should press the 'C' button on the keypad and enter the correct system password The system will verify that fewer than 10 faces are saved before proceeding If these conditions are satisfied, the camera will capture an image of the user, while the LCD will display a reminder to "Look at the camera" until the process is completed successfully.

The system allows users to manage their accounts by adding photos and deleting saved users To delete a user, individuals must authenticate their password and select the desired user ID from the keypad.

CONCLUSIONS AND FUTURE WORK

CONCLUSIONS

The SMART DOOR-LOCK system features three advanced security authentication methods: facial recognition, RFID unlocking, and PIN entry This innovative approach not only enhances security but also improves user convenience, contributing to a broader user adoption.

Unlock by using facial recognition:

Face recognition technology has shown promising results, achieving a high accuracy rate in user identification In a recent evaluation, a new user's face was successfully recognized nine out of ten times, with the only failure attributed to insufficient lighting However, the speed of adding and identifying faces comes at the cost of recognition accuracy While the system remains functional, its performance does not match that of models trained on extensive datasets, which require significantly more time for training.

The security system features three unlocking techniques, including a password input method Unlike face scanning systems that require continuous efficacy checks, the PIN code mode only verifies its functionality at each entry When the correct password is entered, the lock opens; if incorrect, the user is prompted to try again This method is secure, as only the correct password can activate the door mechanism, ensuring consistent performance and straightforward setup.

The most popular method for unlocking smart locks today is through the use of a magnetic card This system features an integrated magnetic card that allows for easy addition and deletion of user access It differentiates between master and member cards, where the master card provides the owner with full control over user management, including unlocking capabilities, while the member card is solely for unlocking the system All these functionalities are seamlessly incorporated into the master card system, ensuring compatibility with member cards.

Flexibly expand the number of users:

In addition to the previously mentioned unlocking methods, the ability to accommodate multiple users is a significant advantage of this system It enables users to register up to 10 different faces, and the number of magnetic cards can be customized based on individual preferences, limited only by the number of family members.

Direct unlock and Interact with users:

To enhance user convenience, smart door lock systems should eliminate the need for security confirmation upon leaving Implementing rapid unlocking options, like a simple button press, enables users to unlock the system instantly This addition not only improves precision but also ensures quick response times, thanks to the seamless communication between the button and the Raspberry Pi 4.

FUTURE WORK

With this advancement, owners can easily unlock accounts for users who have forgotten their passwords or for family members lacking access to the data set by directly contacting the system through the website.

Users can freely update the system password simply using the website

Modern laptops are equipped with webcam systems that enable users to capture their faces and save the images directly to the device without needing to position themselves in front of the camera This feature enhances the system's flexibility, making it easier to add new users.

To enhance system monitoring, the owner can see the history that other users utilized the system, which is kept in a database linked to the website

Regular updates and retraining of the FaceNet model are essential for adapting to changing user demographics and improving recognition accuracy Additionally, integrating diverse datasets is vital for ensuring the model's robustness across various facial characteristics.

To enhance the efficiency of the FaceNet model, it is essential to explore optimization techniques such as model quantization and pruning These strategies effectively reduce the model's size and improve inference speed while maintaining accuracy.

To ensure the protection of facial recognition data and models, it is essential to implement robust security measures Prioritizing user privacy is crucial, which can be achieved by adopting privacy-preserving techniques like on-device processing and secure data transmission protocols.

The hardware has adopted lightweight models for facial recognition and feature extraction, achieving efficient processing with good accuracy However, these models have limitations that hinder their effectiveness To improve facial recognition, extraction, and differentiation, it is essential to either utilize advanced models or enhance the current ones.

To improve facial recognition systems, it is essential to explore and implement advanced models that accurately extract facial features while reducing the effects of environmental factors Furthermore, developing a new lightweight compressed facial feature extraction model is necessary for efficient operation on embedded devices such as the Raspberry Pi 4 Model-B 4GB, enhancing facial feature extraction and minimizing the impact of varying environmental conditions.

Enhancing facial recognition models involves optimizing scanning and data collection processes, which improves user convenience and overall system usability Furthermore, analyzing the workflow of the control program and establishing clear standards for face differentiation are essential for ensuring the system's efficiency and reliability.

[1] Florian Schroff, Dmitry Kalenichenko, James Philbin, FaceNet: A Unified Embedding for Face Recognition and Clustering, CVFR2015 provided by the

[2] M.Jyothi, L.Ravi Chandra, M.Sahithi, ,S.Daya Sagar Chowdary, K.Rajasekhar K.Purnima, Implementation of SPI Communication Protocol for Multipurpose Applications with I2C Power and Area Reduction, Vol 2, Issue 2, Mar-Apr 2012, pp.875-883

[3] A Firmansyah, T F Kusumasari and E N Alam, Comparison of Face Recognition

Accuracy of ArcFace, Facenet and Facenet512 Models on Deepface Framework,

2023 International Conference on Computer Science, Information Technology and Engineering (ICCoSITE), Jakarta, Indonesia, 2023, pp 535-539, doi: 10.1109/ICCoSITE57641.2023.10127799

[4] Peng Liu, Xiaofan Cao and Yujiao Jia, Performance evaluation and analysis of scalable Raspberry Pi 4 Model B clusters, Institute of Energy and Electrical

Engineering, Changchun University of Science and Technology, Changchun,

[5] M Sandler, A Howard, M Zhu, A Zhmoginov & L-C, Chen, MobileNetV2: Inverted residuals and linear bottlenecks, March 2019, https://arxiv.org/abs/1801.04381

[6] Ageitgey, Face_recognition, https://github.com/ageitgey/face_recognition

[7] Dr Sagar Patel, Prachi Talati, Saniya Gandhi, Design of 12C Protocol, International Journal of Technical Innovation in ModernEngineering & Science (IJTIMES), March-2019, 5.22 (SJIF-2017), e-ISSN: 2455-2585 Volume 5, Issue 03

[8] Scott Campbell, DIY Electronics (2024, June 14 th ), BASICS OF THE I2C

COMMUNICATION PROTOCOL [Online] Available: https://www.circuitbasics.com/basics-of-the-i2c-communication-protocol/.

Ngày đăng: 20/12/2024, 10:59

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w