Biometric Attendance System Using Python and Raspberry PiwithMySQLDatabase
Biometric Attendance System Using Python and Raspberry PiwithMySQLDatabase
net/publication/383876359
CITATIONS READS
0 170
2 authors, including:
Abraham Tefera
1 PUBLICATION 0 CITATIONS
SEE PROFILE
All content following this page was uploaded by Abraham Tefera on 09 September 2024.
BY
June, 2024
Name Signature
This thesis project work has been submitted for examination with my approval as a university
advisor.
Name Signature
II
Acknowledgment
First of all, praise be to God Almighty for giving the courage, wisdom, skill, and chance needed
to start and finish this research project. The accomplishment's significance is further
highlighted by the acknowledgment of divine blessings.
We also extend our sincere gratitude to Mr. Yafet Philipos for his superb oversight, creative
suggestions, and constant support during the research project. With gratitude, we acknowledge
the honor of continuing our study under his direction.
Lastly, friends and colleagues in the School of Electrical and Computer Engineering are
sincerely thanked for their support, encouragement, and credible suggestions that greatly aided
in the completion of the thesis.
III
Abstract
Accurate staff attendance tracking and control are critical to operational effectiveness and
payroll management in today's company environment. Conventional attendance
monitoring techniques frequently have inaccurate data, security flaws, and inadequate data
protection. This paper suggests a Fingerprint-Based Attendance System that uses the
Raspberry Pi 3 to address these problems and provides improved security and
dependability. Utilizing fingerprint recognition technology, the system is accurate and
resistant to fraud, and its implementation is made possible by the Raspberry Pi 3, which
is a small and robust platform. It is anticipated that this novel approach will considerably
increase labor management's operational effectiveness, security, and accuracy while
lessening the burden on administrative staff and promoting openness. The extensive
literature review, thorough methodology, and system architecture for the design,
development, and implementation of the suggested system are provided in the next parts.
IV
TABLE OF CONTENTS
Declaration ................................................................................................................................................... II
Acknowledgment ........................................................................................................................................ III
Abstract ....................................................................................................................................................... IV
TABLE OF CONTENTS ............................................................................................................................. V
LIST OF FIGURES .................................................................................................................................. VII
LIST OF TABLES ........................................................................................................................................ 1
LIST OF ACRONYMS ................................................................................................................................ 2
CHAPTER ONE ........................................................................................................................................... 3
INTRODUCTION ........................................................................................................................................ 3
1.1 Background ................................................................................................................................... 3
1.2 Motivation ..................................................................................................................................... 4
1.3 Problem Statement ........................................................................................................................ 5
1.4 Objectives ..................................................................................................................................... 6
1.4.1 General Objective ................................................................................................................. 6
1.4.2 Specific objectives ................................................................................................................ 6
1.5 Scope of the project ...................................................................................................................... 6
1.6 Significance of the project ............................................................................................................ 7
1.7 Outline of the project .................................................................................................................... 8
CHAPTER TWO .......................................................................................................................................... 9
LITERATURE REVIEW ............................................................................................................................. 9
CHAPTER THREE .................................................................................................................................... 12
METHODOLOGY AND SYSTEM DESIGN ........................................................................................... 12
3.1 Introduction ................................................................................................................................. 12
3.2 System Architecture .................................................................................................................... 13
3.2.1 Employee registration ......................................................................................................... 13
3.2.2 Authentication Function...................................................................................................... 15
3.2.3 Attendance Tracking and Payroll Function......................................................................... 16
3.3 System Block Diagram ............................................................................................................... 18
3.4 Schematic circuit diagram of the system .................................................................................... 18
3.5 The materials used in this Project ............................................................................................... 19
3.5.1 Personal Computer .............................................................................................................. 19
3.5.2 Raspberry Pi ........................................................................................................................ 19
V
3.5.3 Fingerprint Module ............................................................................................................. 21
3.5.4 Liquid Crystal Display (LCD) ............................................................................................ 22
3.5.5 I2C Module ......................................................................................................................... 23
3.5.6 4x3 Keypad ......................................................................................................................... 23
3.6 Software Requirement................................................................................................................. 24
3.6.1 PuTTY Software ................................................................................................................. 24
3.6.2 RealVNC Viewer Software ................................................................................................. 25
3.6.3 MySQL Database ................................................................................................................ 25
3.6.4 Python ................................................................................................................................. 26
3.7 System Design ............................................................................................................................ 26
3.7.1 User to System Interaction .................................................................................................. 26
3.7.2 System to Database Interaction ........................................................................................... 27
3.8 Database Design.......................................................................................................................... 28
CHAPTER FOUR ....................................................................................................................................... 31
RESULT AND DISCUSSION ................................................................................................................... 31
4.1 Implementation Results............................................................................................................... 31
4.1.1 System Setup ....................................................................................................................... 31
4.1.2 Employee Registration ........................................................................................................ 31
4.1.3 Attendance Tracking ........................................................................................................... 32
4.1.4 Payroll Calculation.............................................................................................................. 33
4.1.5 Admin Panel........................................................................................................................ 33
4.2 Hardware Implementation........................................................................................................... 35
CHAPTER FIVE ........................................................................................................................................ 36
CONCLUSION AND RECOMMENDATION .......................................................................................... 36
5.1 Conclusion .................................................................................................................................. 36
5.2 Recommendations ....................................................................................................................... 36
Reference .................................................................................................................................................... 37
Appendix 1 .................................................................................................................................................. 38
Appendix 2 .................................................................................................................................................. 39
VI
LIST OF FIGURES
Figure 1. Flow diagram of Methodology ................................................................................ 12
Figure 2. Design of system architecture ................................................................................. 13
Figure 3. Employee Registration flowchart ............................................................................ 14
Figure 4. Attendance recording flowchart .............................................................................. 15
Figure 5. Payroll computing flowchart ................................................................................... 17
Figure 6. System Block Diagram............................................................................................ 18
Figure 7. Schematic Circuit diagram ...................................................................................... 18
Figure 8. Raspberry Pi 3B Pin Configuration ......................................................................... 20
Figure 9. R307 Fingerprint Module ........................................................................................ 21
Figure 10. LCD Display ......................................................................................................... 23
Figure 11. I2C Module ........................................................................................................... 23
Figure 12. 4x3 Keypad ........................................................................................................... 24
Figure 13. User System Interaction environment ................................................................... 27
Figure 14. Employee Database ............................................................................................... 29
Figure 15. Attendance Database Schema ............................................................................... 29
Figure 16. Employee Registration function ............................................................................ 31
Figure 17. Registration Confirmation ..................................................................................... 32
Figure 18. Attendance Tracking process ................................................................................ 33
Figure 19. Attendance Payroll panel ...................................................................................... 33
Figure 20. Website Monitoring Panel ..................................................................................... 34
VII
LIST OF TABLES
1
LIST OF ACRONYMS
HR Human Resource
GSM Global System for Mobile Communication
LCD Liquid Crystal Display
ID Identification
PC Personal Computer
2
CHAPTER ONE
INTRODUCTION
1.1 Background
These days, many organizations—including government agencies, corporations, and
educational institutions—need precise and effective attendance management systems.
Conventional techniques for keeping track of attendance, such punch cards and manual
registers, are frequently beset by problems like fraud, time wastage, and human mistake.
These drawbacks emphasize the requirement for a more dependable and automated
solution. A viable substitute is provided by biometric technologies, which make use of
distinct physiological traits like fingerprints, face recognition, and iris scans. Fingerprint
recognition is unique among them all because of its great accuracy, affordability, and
convenience of usage.
The field of attendance management has undergone even more change thanks to the
incorporation of fingerprint identification technologies with microcomputers like the
Raspberry Pi. The Raspberry Pi single-board computer is a flexible and reasonably priced
device that offers the computing capacity and adaptability required to create complex
biometric systems. It is the perfect platform for putting in place a fingerprint-based
attendance system because it supports a wide range of sensors and modules. Organizations
can automate the process of collecting attendance by utilizing the features of Raspberry
Pi, which guarantees accuracy, security, and real-time data management.
3
attendance systems have become widely accepted and are being used more frequently in
a variety of industries.
1.2 Motivation
A number of constraints and inefficiencies present in conventional organizational
processes are the driving force behind the development of a fingerprint-based attendance
management system utilizing Raspberry Pi that is coupled with a payroll and report
system. Punch cards and manual registers, two labor-intensive but error- and
manipulation-prone old methods of keeping track of attendance, are outdated. Erroneous
manual data input and buddy punching are two problems that might result in erroneous
attendance records among employees. The occurrence of these errors may lead to
disparities in payroll, which could financially impact companies and lead to employee
discontent.
Further adding substantial value to the project is the payroll and reporting system that is
integrated into the attendance management framework. Employers may ensure that
workers are paid promptly and equitably by automating payroll calculations based on
precise attendance data. This also reduces administrative burden by doing away with
manual calculations. When it comes to employee timeliness, attendance trends, and
4
general workforce productivity, the report generation feature is indispensable. The
creation of these reports can help with performance reviews, strategic decision-making,
and pinpointing areas that need work. Developing a comprehensive solution that improves
payroll accuracy, streamlines attendance management, and offers extensive reporting
features is the driving force behind this project. This will increase organizational
effectiveness and employee happiness.
In addition, manually processing attendance data for payroll needs takes a lot of time and work.
Payroll processing, work hour calculations, and attendance record verification all require a
significant amount of effort from human resources staff. Errors can occur in this manual
procedure, impacting employee happiness and even resulting in legal and financial
consequences for the company. This might also result in improper payments. Efficient
monitoring and analysis of worker performance is impeded by the absence of automated
reporting and real-time data, which further complicates the management of payroll and
attendance.
Given these problems, an automated, dependable, and effective system that can precisely
record attendance, stop fraud, and expedite payroll processing is desperately needed. A
workable solution to these issues is provided by a fingerprint-based Raspberry Pi attendance
management system coupled with a payroll and reporting system. The objective of this system
is to do away with the need for manual intervention that comes with traditional techniques,
guarantee the confidentiality and accuracy of attendance data, and offer automatic payroll
5
computations and thorough reporting. The suggested solution aims to improve organizational
efficiency, lessen administrative responsibilities, and raise overall employee happiness and
productivity by tackling these important challenges.
1.4 Objectives
1.4.1 General Objective
To develop a fingerprint-based attendance management system using Raspberry Pi, integrated
with a payroll and report system. This system aims to automate attendance recording, reduce
errors and fraud, streamline payroll processing, and provide comprehensive reporting to
enhance operational efficiency and employee satisfaction in organizations.
6
Pi. It includes setting up hardware for fingerprint recognition, developing software for payroll
processing and attendance monitoring, and building a centralized database for safe data
storage. The system will process data in real time, generate reports automatically, and offer an
intuitive user interface for HR administration. Scalability, security, and adaptation for a range
of organizational sizes—from tiny enterprises to major institutions—are all included in the
scope.
In addition, the system's capacity to provide thorough payroll summaries and attendance trends
reports provides HR management with important information that supports strategic decision-
making and performance reviews. The intuitive interface streamlines administrative duties,
relieving HR staff of extra labor and freeing them up to concentrate on more important
responsibilities. Furthermore, the project's focus on adaptation and scalability guarantees that
it can meet the requirements of different organizational sizes, ranging from small startups to
major corporations, making it a flexible solution.
All things considered, this project fosters an organizational culture of accountability and
openness in addition to increasing operational efficiency and accuracy. It is a major
advancement in the use of cutting-edge technology to improve and expedite crucial business
operations, which will ultimately lead to improved labor management and increased
productivity inside the company.
7
1.7 Outline of the project
This paper is a report for our project written after much effort made practically. It includes the
following chapters:
➢ First an introduction is discussed, which gives a general concept about this project
➢ Next a literature review will explain about reports of projects done before in areas
similar to our project.
➢ Then the overall system design and analysis briefly discusses circuit components,
design analysis and system working principles.
➢ After the design and analysis, a simulation and prototype implementation of the project
is discussed.
➢ Finally, the paper talks about conclusion and the possible future scopes which gives a
generalized idea about our final points and future works to be made to develop more
than this.
8
CHAPTER TWO
2 LITERATURE REVIEW
A thorough examination of various documents, journals, and books is essential for the
successful completion of this project. This section provides a review of previous and relevant
works in the field of attendance management systems. To gain insights into new and more
efficient methods, we have reviewed and will continue to review related past studies.
This paper explores the development of a fingerprint-based attendance system that combines
the functionalities of Arduino and Raspberry Pi. The system captures fingerprint images using
a fingerprint sensor, which are then processed by the Arduino for initial matching. The
Raspberry Pi acts as a central controller, handling database management and user interface
functionalities. An LCD screen is integrated to provide real-time feedback to users about their
attendance status. The system also includes features for adding new users and managing
attendance records efficiently. The paper highlights the potential scalability of the system, its
cost-effectiveness, and ease of deployment in various institutional settings, such as schools
and offices. The study concludes that the combined use of Arduino and Raspberry Pi provides
a robust and efficient solution for attendance management. Rani, R. J., & Karthika, M. (2017)
A paper by Kumar, S., & Singh, P. (2018) discusses the design and implementation of a
fingerprint-based attendance management system that integrates Raspberry Pi and a GSM
module. The system captures fingerprint data using a sensor, processes it for verification, and
updates attendance records accordingly. One of the unique features of this system is its ability
to send real-time attendance information via SMS to designated recipients, such as
administrators or parents, using the GSM module. The paper covers the system's architecture,
including hardware components like the fingerprint sensor, Raspberry Pi, and GSM module,
and software algorithms for fingerprint matching and SMS communication. The centralized
database ensures secure storage and easy retrieval of attendance records. The authors highlight
the system's reliability, cost-effectiveness, and potential applications in educational institutions
and corporate environments. They conclude that the integration of GSM technology enhances
the system's functionality by providing instant updates and improving communication.
9
Gupta, R., & Sharma, A. (2017) develop a system with the Raspberry Pi serving as the central
processing unit, this research paper presents a thorough overview of a biometric attendance
system. To collect biometric data, the system uses a fingerprint sensor. Then, it processes and
compares the fingerprints using complex algorithms. All of the hardware connections—such
as those for the power supply, communication ports, and fingerprint sensor—are described in
full. We also talk about the software's components, including the database management system
and the algorithms for matching fingerprints to attendance records. Concerning accuracy,
speed, and user experience, the writers assess the system's performance. Its conclusion is that
the system offers a dependable way to manage attendance in a variety of scenarios, and it is
also very effective and user-friendly. A larger database and the integration of more biometric
modalities are only two examples of the potential improvements that the study draws attention
to for large-scale implementation.
This study by Verma, R., & Singh, D.(2019) focuses on the design and development of a
Raspberry Pi-based biometric attendance management system. The system takes fingerprints,
verifies them, changes attendance records instantly, and saves all of the information in a single,
centralized database. The database management system, fingerprint matching algorithms, and
the Raspberry Pi's integration of the fingerprint sensor are just a few of the hardware and
software elements that the authors go into great depth about. Scalability, security
characteristics, and possible uses in a range of organizational contexts, including offices,
factories, and schools, are also included in the research. According to the authors' conclusion,
the system provides a reliable and effective way to manage attendance, with room for future
development and customization in response to particular user needs.
Using a Raspberry Pi as the central processing unit, Rajput, N., & Chavhan, V. (2019)
investigates the creation of a real-time biometric attendance system based on fingerprint
recognition technology. In real time, the system updates attendance records by capturing
fingerprint data and validating it against pre-stored templates. In addition to the software
methods for fingerprint matching and database administration, the article also covers the
hardware components, such as the Raspberry Pi and fingerprint sensor. The authors draw
attention to the real-time features of the system, such as its ability to update attendance records
10
instantly and provide rapid feedback. They draw the conclusion that, with possible uses in a
range of institutional contexts, the method offers a dependable and effective approach to
managing attendance.
The creation of a dependable and safe biometric attendance system with a Raspberry Pi is
presented in this paper by Patel, A., & Shah, M. (2018). To provide precise identification and
safe attendance data storage, the system makes use of cutting-edge fingerprint recognition
algorithms. The authors go over the software techniques used for data encryption and
fingerprint matching as well as the hardware components, such as the Raspberry Pi and
fingerprint sensor. The use of secure communication methods to safeguard attendance data
while it is being transmitted is also covered in the study. The system offers a solid and
dependable solution for controlling attendance with a high level of security, according to the
authors, who also emphasize the system's security features, which include data encryption and
safe access restrictions.
The study by Saini, S., & Kumar, R. (2019) examines the use of a Raspberry Pi fingerprint
attendance system in conjunction with Internet of Things technologies. Using a sensor, the
system takes fingerprint data, validates it, and changes attendance records in a database stored
on the cloud. The fingerprint sensor, Raspberry Pi, cloud storage, and other hardware and
software components are all described in great depth by the writers. Real-time access to
attendance records and improved data security are only two advantages that the study
emphasizes of adopting IoT for remote monitoring and administration of attendance data. The
scalability of the system and its possibilities for implementation in big enterprises are also
covered by the writers. The use of IoT technology improves the system's performance and
offers a reliable approach to managing attendance, they conclude.
11
CHAPTER THREE
3 METHODOLOGY AND SYSTEM DESIGN
3.1 Introduction
Methodology, as the name implies, describes the stages or approaches that are developed in
order to accomplish a certain objective; in this example, creating a prototype fingerprint-based
attendance management system that is linked with a payroll and reporting system. In essence,
it provides a useful structure. The knowledge and data obtained from earlier publications helps
to clarify the purpose and aims. Hardware and software integration leads to the design model.
The prototypes, components, architecture, and parts of the system are depicted in this model.
Nonetheless, the hardware and software need to be properly connected and arranged for the
project to succeed. This project's methodology flow block diagram is displayed below.
12
3.2 System Architecture
1. Employee registration
2. Authentication function
3. Attendance tracking and payroll function
13
Figure 3. Employee Registration flowchart
Steps in Employee Registration:
14
This process ensures that each employee's fingerprint data is accurately recorded and linked
to their personal details, facilitating seamless attendance tracking and payroll processing.
15
Steps in Authentication Function:
This process ensures that only registered employees can record their attendance, maintaining
the integrity and accuracy of attendance data.
16
Steps in Attendance Tracking and Payroll Function:
1. Capture Attendance Data: When employees sign in and sign out, their attendance
data, including timestamps, is captured and stored in the database.
2. Calculate Work Hours: The system calculates the total hours worked by each
employee by subtracting the sign-in time from the sign-out time for each workday.
3. Compute Payroll: Using the total work hours and the predefined hourly rate, the
system computes the payroll for each employee. Additional factors like overtime,
bonuses, and deductions are also considered in the calculation.
4. Generate Reports: The system generates detailed attendance and payroll reports,
providing insights into employees' work patterns and payroll details.
5. Update Payroll Database: The computed payroll data is stored in the payroll database,
ensuring accurate and up-to-date records for salary disbursement.
6. Provide Access: HR administrators and authorized personnel can access the attendance
and payroll reports through a secure interface, facilitating efficient payroll management
and decision-making.
17
3.3 System Block Diagram
The general block diagram of the system is shown below:
18
3.5 The materials used in this Project
3.5.1 Personal Computer
A Personal Computer (PC) is essential for the development and implementation of the
fingerprint-based attendance management system. It facilitates software development,
including coding, compiling, and debugging, and manages the centralized database for secure
data storage and retrieval. The PC is also used for configuring the Raspberry Pi and integrating
various hardware components, generating and analyzing reports using tools like Excel or
Power BI, and developing a user-friendly interface for HR administrators. Overall, the PC
provides the necessary computational power and versatility for effective software
development, system configuration, data analysis, and user interface design, making it
indispensable for the project's success.
3.5.2 Raspberry Pi
An essential piece of hardware in an attendance control system that uses fingerprints is the
Raspberry Pi 3B. It performs the functions of the central processing unit by processing
attendance records, handling data from the fingerprint scanner, and overseeing component
communication. GPIO pins are used by the Raspberry Pi 3B to seamlessly integrate with a
variety of hardware elements, including the LCD display and fingerprint reader. It does payroll
computations, executes fingerprint recognition algorithms, updates the database in real-time,
and operates the software designed for the attendance management system.
The system's integrated Ethernet and Wi-Fi allow for remote access to payroll and attendance
data as well as real-time data synchronization. Because of its low power consumption, the
Raspberry Pi 3B is a great option for continuous operation in an attendance management
system, hence lowering total operating expenses. All things considered, the Raspberry Pi 3B
offers the connection, flexibility, and processing power needed to create an effective and
dependable fingerprint-based attendance monitoring system.
19
Features:
20
3.5.3 Fingerprint Module
A crucial piece of hardware for the fingerprint-based attendance control system is the R307
Fingerprint Module. It ensures precise and dependable identification by employing an optical
sensor to take high-quality fingerprint pictures. It works with a wide range of organizational
sizes since it can hold up to 1,000 fingerprint templates and handle a big number of personnel.
The module guarantees that only authorized persons are identified, boasting great accuracy
and a low false acceptance rate (FAR). Quick identification and verification are made possible
by its effective fingerprint matching system, which also improves user experience. Via a serial
interface, the R307 and Raspberry Pi 3B may connect, facilitating smooth data transfer and
system integration.
The R307 requires little setup or configuration since it is intended to integrate easily with
microcontrollers and single-board computers like the Raspberry Pi. It is an essential part of
precise attendance monitoring because of its strong design, which guarantees dependable
operation in a range of environmental circumstances, and its low power consumption, which
supports the project's energy-efficient objectives.
21
Features:
Pin Description:
22
attendance has been appropriately recorded by displaying confirmation messages upon
successful sign-ins and sign-outs.
• Type: Character.
• 20 characters * 4 lines.
• Display mode & backlight variation.
• 4-bit or 8-bit microcontroller interface.
23
and commands, such as employee IDs and administrative commands. Its design and
compatibility with microcontrollers like Raspberry Pi 3B make it a user-friendly and efficient
input device.
24
3.6.2 RealVNC Viewer Software
A crucial piece of software for the fingerprint-based attendance management system that gives
the Raspberry Pi 3B remote desktop access is RealVNC Viewer. It makes it possible for users
to engage with the Raspberry Pi desktop environment as if they were physically there by
allowing them to watch and control it remotely from another computer. This feature is essential
for troubleshooting and maintenance work, as well as for installing, configuring, and
maintaining the system's software. Secure, encrypted connections are supported by RealVNC
Viewer, guaranteeing the security of any data sent between the Raspberry Pi and the remote
device. It is an essential component of the system, increasing the flexibility and ease of
operating the attendance management solution from any place thanks to its user-friendly
interface and strong performance.
Large data quantities may be efficiently queried and managed by the database, supporting
intricate tasks like payroll processing, report generation, and work hour calculations. The
system's total functionality is improved by its connection with the Raspberry Pi 3B and other
system components, which guarantees smooth data flow and real-time updates.
Access control and user authentication are two of MySQL's robust security features that guard
critical information and guarantee that only authorized users may access or alter the database.
Its ability to work with a wide range of computer languages and development tools makes it a
flexible option for developers, which helps to ensure the attendance management system is
implemented and maintained efficiently.
25
3.6.4 Python
Python is a flexible programming language that's often utilized in the attendance management
system that takes fingerprints. It is used to design the main software, integrate hardware,
process fingerprint data, and oversee payroll and attendance functions. Writing readable and
understandable code is made easy with Python's ease of use and simplicity. Python scripts are
used in this project to do things like interface with the MySQL database, generate reports, and
collect and analyze fingerprint data from the R307 module.
The web interface for administrators is also developed using Python modules and frameworks
such as Flask and Django. Real-time data updates, effective data analysis, and connectivity
with Raspberry Pi GPIO pins are all made possible by Python's robust standard library and
third-party modules. Robust system performance and smooth integration are guaranteed by its
interoperability with technologies like MySQL for database administration and PuTTY for
remote access.
After entering their ID, the employee uses the R307 fingerprint module to scan their
fingerprint. This module, which collects fingerprint data and compares it with templates stored
in the database, is essential to the authentication process. To promptly confirm the employee's
identification, the system compares the scanned fingerprint with the pre-registered data. The
system records the sign-in time in the MySQL database after successful authentication. After
26
that, the LCD display verifies that the employee successfully logged in and gives them instant
feedback.
In a similar vein, the employee engages with the system once more when they leave the office
by first using the keypad to input their employee ID and then scanning their fingerprint to sign
out. After recording the sign-out time in the database, the system determines the working hours
for the day and modifies the payroll records appropriately. To provide a seamless and user-
friendly experience, the LCD display keeps providing instructions and status updates
throughout this operation. The main user interface for safe and effective attendance monitoring
is formed by the integration of the fingerprint module, LCD display, and keypad.
27
The system stores and manages this data in a MySQL database. To add new records to the
database or edit ones that already exist, the Raspberry Pi connects to the MySQL server and
runs SQL queries. For example, the system records the sign-in time in the attendance table
when an employee signs in. In a similar manner, the total working hours are computed by
updating the sign-out timings. The accuracy of payroll processing depends on these processes'
ability to guarantee that the database accurately represents real-time attendance data.
Apart from maintaining documents, the Raspberry Pi obtains information from the database
for several objectives. The system fetches the saved fingerprint templates to verify the
employee's identification during the sign-in procedure. In order to calculate payrolls on a daily
and weekly basis, it also searches attendance data, producing detailed reports for management
and HR. The total working hours multiplied by the hourly wage is the basis for payroll
computations. Through constant communication, the system keeps an accurate and up-to-date
record of all payroll and attendance-related data, which makes data processing, reporting, and
decision-making more efficient. A strong and dependable attendance management system is
made possible by the smooth connection of the Raspberry Pi and the MySQL database.
The fingerprint template, pay rate per hour, employee ID, first and last names, and other
pertinent employee data are all kept in the "Employees" table. During the sign-in and sign-out
procedures, this table serves as the main source of information for confirming employee IDs.
The biometric information required for authentication is safely stored in a binary field called
the fingerprint template.
Employee sign-in and sign-out timings are recorded in the "Attendance" database. This table's
records each have an employee ID (connected to the "Employees" table), the date, and the
28
sign-in and sign-out timestamps. By deducting the sign-in and sign-out times for each day, the
table is made to efficiently compute working hours. Both the payroll computations and the
attendance monitoring system depend on this data.
29
Data integrity is guaranteed by the relational database design, which also makes it possible to
access and modify data with efficiency using sophisticated queries. Indexes are used on
important data to improve query efficiency, including employee ID and dates. Additionally,
the database's scalability was considered throughout design, making expansion simple as the
company expands. The fingerprint-based attendance management system is primarily
supported by a well-thought-out and sturdy database design, which guarantees dependable and
effective operation.
30
CHAPTER FOUR
4 RESULT AND DISCUSSION
This chapter covers the findings and offers the outcomes of the fingerprint-based attendance
management system's installation. The system's performance was assessed by a battery of tests
and real-world applications to make sure it fulfills the project's goals. To provide the debate a
visual framework, pictures of the operational system and the installation phases are given.
31
Figure 17. Registration Confirmation
4.1.3 Attendance Tracking
The capability for tracking attendance was carefully examined. By inputting scanning their
fingerprints, employees may sign in and leave. The sign-in and sign-out timings were precisely
captured by the system, which updated the attendance table instantly. Every step of the way,
the LCD display gave clear feedback to guarantee seamless functioning.
32
Figure 18. Attendance Tracking process
4.1.4 Payroll Calculation
By looking through the attendance records and figuring out the total number of working hours,
the payroll calculation feature was confirmed. The working hours multiplied by the hourly rate
allowed the system to properly calculate the daily paycheck. The monthly payroll report, which
included comprehensive details on each employee's wages, was produced appropriately.
34
4.2 Hardware Implementation
35
CHAPTER FIVE
5 CONCLUSION AND RECOMMENDATION
5.1 Conclusion
This project's fingerprint-based attendance management system has shown to be a dependable,
efficient, and user-friendly tool. The system proved to have strong data management
capabilities, high accuracy fingerprint recognition, and efficient data processing through
extensive testing and real-world application. The project's goals were achieved through the
reliable and functioning system that was created by integrating hardware components with the
Raspberry Pi and MySQL database.
The LCD display and keypad, which formed up the system's user-friendly interface, made the
operations of employee registration, sign-in, and sign-out simple and easy to use. Payroll
administration and attendance monitoring are made easier with real-time updates and thorough
reporting, which improves organizational effectiveness. The technology performed as
expected overall and shown its ability to greatly enhance personnel management procedures.
5.2 Recommendations
36
Reference
1. Rani, R. J., & Karthika, M. (2017). Fingerprint Based Attendance System Using
Arduino and Raspberry Pi. International Journal of Engineering and Technology
(IJET), 9(2), 1696-1701.
2. Kumar, S., & Singh, P. (2018). Fingerprint Based Attendance Management System
Using Raspberry Pi and GSM Module. International Journal of Innovative Research in
Computer and Communication Engineering (IJIRCCE), 6(4), 4155-4160.
3. Gupta, R., & Sharma, A. (2017). Biometric Attendance System Using Raspberry Pi.
International Journal of Advanced Research in Computer and Communication
Engineering (IJARCCE), 6(5), 789-795.
4. Verma, R., & Singh, D. (2019). Design and Development of a Biometric Attendance
Management System Using Raspberry Pi. International Journal of Computer Science
and Mobile Computing (IJCSMC), 8(3), 45-52.
5. Rajput, N., & Chavhan, V. (2019). Real-Time Biometric Attendance System Based on
Fingerprint Recognition. International Journal of Emerging Trends in Engineering
Research (IJETER), 7(3), 45-50.
6. Patel, A., & Shah, M. (2018). Development of a Secure and Reliable Biometric
Attendance System Using Raspberry Pi. Journal of Information Technology and
Software Engineering (JITSE), 7(2), 33-40.
7. Saini, S., & Kumar, R. (2019). Design and Implementation of Fingerprint-Based
Attendance System Using Raspberry Pi and IoT. International Journal of Advanced
Research in Electrical, Electronics and Instrumentation Engineering (IJAREEIE), 8(6),
1425-1431.
37
Appendix 1
No Name of the Component Quantity Cost of each item Total Cost in ETB
in ETB
1 PC 1 30,000 30,000
2 Fingerprint Module 1 1,500 1,500
3 Raspberry Pi 3B 1 18,000 18,000
4 LCD 1 500 500
5 Cable 15 7 215
6 4x3 Keypad 1 450 450
7 I2C Module 1 450 450
Table 2. Cost Analysis
Year 2024
Activities April May June
Week Week Week Week Week Week Week Week Week
2 3 4 1 2 3 4 1 2
Project Proposal ✓
Literature Proposal ✓
Installing ✓
necessary
Softwares
Database ✓
designing
Software ✓ ✓ ✓
Implementation
Hardware ✓ ✓ ✓
implementation
Documentation ✓
Table 3. Working plan schedule
38
Appendix 2
Project Python Code
import os
import datetime
import time
import sys
import pyfingerprint
import hashlib
import smtplib
import pymysql
import I2C_LCD_driver
mylcd = I2C_LCD_driver.lcd()
pressed_keys = ''
pin = "1234"
fun = ''
month = ''
year = ''
first_initial = ''
last_initial = ''
employee_number = ''
employee = ''
r = ''
39
person = ''
day = datetime.date.today().strftime("%m-%d-%y")
def finger():
try:
except Exception:
print('')
main_menu()
else:
print('')
print_grab()
db_config = {
'host': '192.168.8.101',
'user': 'rpi_fp',
'password': '1234567890',
'db': 'payroll',
'charset': 'utf8mb4',
'cursorclass': pymysql.cursors.DictCursor
40
# Function to connect to the database
def connect_to_db():
return pymysql.connect(**db_config)
def finger():
try:
except Exception:
print('')
main_menu()
else:
print('')
print_grab()
def print_grab():
global person
try:
mylcd.lcd_clear()
print('')
pass
41
f.convertImage(0x01)
result = f.searchTemplate()
positionNumber = result[0]
if positionNumber == -1:
mylcd.lcd_clear()
print('')
time.sleep(2)
main_menu()
else:
print('')
mylcd.lcd_clear()
print('PLEASE WAIT')
print('')
f.loadTemplate(positionNumber, 0x01)
characteristics = str(f.downloadCharacteristics(0x01)).encode('utf-8')
val_hash = hashlib.sha256(characteristics).hexdigest()
conn = connect_to_db()
try:
42
sql = 'SELECT * FROM fingerprint_store WHERE id=%s'
cursor.execute(sql, (positionNumber,))
db_val = cursor.fetchall()
person = row['employee']
mylcd.lcd_clear()
mylcd.lcd_display_string(' ID NUMBER:', 2)
print('')
time.sleep(2)
finally:
conn.close()
check_if_in()
except Exception as e:
print(e)
def check_if_in():
global person
with pymysql.connect(
host='192.168.8.101',
user='rpi_fp',
password='1234567890',
database='payroll',
charset='utf8mb4'
43
) as conn:
with conn.cursor() as c:
date = datetime.date.today().strftime("%m-%d-%y")
conn.commit()
result = c.fetchone()
if result is None:
write_in()
else:
check_if_out()
def write_in():
with pymysql.connect(
host='192.168.8.101',
user='rpi_fp',
password='1234567890',
database='payroll',
charset='utf8mb4'
) as conn:
with conn.cursor() as c:
status_in = 'IN'
day = datetime.date.today().strftime('%m-%d-%y')
44
"VALUES(%s, %s, %s, %s)", [person, day, status_in, timestamp])
mylcd.lcd_clear()
print('Sign In Successful')
print('')
time.sleep(2)
conn.commit()
main_menu()
def check_if_out():
with pymysql.connect(
host='192.168.8.101',
user='rpi_fp',
password='1234567890',
database='payroll',
charset='utf8mb4'
) as conn:
with conn.cursor() as c:
date = datetime.date.today().strftime("%m-%d-%y")
conn.commit()
result = c.fetchone()
if convert == 'None':
45
write_out()
else:
mylcd.lcd_clear()
mylcd.lcd_display_string(' Today', 3)
print('')
time.sleep(2)
main_menu()
def write_out():
with pymysql.connect(
host='192.168.8.101',
user='rpi_fp',
password='1234567890',
database='payroll',
charset='utf8mb4'
) as conn:
with conn.cursor() as c:
date = datetime.date.today().strftime("%Y-%m-%d")
# Fetch the existing record for the current date and person
result = c.fetchone()
46
if result:
if result[2] == 'OUT':
mylcd.lcd_clear()
print('')
time.sleep(2)
main_menu()
else:
# Update the existing record with the new status and time
else:
47
c.execute("INSERT INTO employees (first, date, status_in, time_in, status_out,
time_out, hours_worked) "
conn.commit()
mylcd.lcd_clear()
print('')
time.sleep(2)
main_menu()
def password():
global fun
mylcd.lcd_clear()
mylcd.lcd_display_string(' Password', 2)
print("Password")
print('')
def password_input(key):
global pressed_keys
global pin
if key == '#':
print(pressed_keys)
48
if pressed_keys == pin:
clear_keys()
# grad_month()
admin_menu_1()
else:
mylcd.lcd_clear()
print('Incorrect Password')
print('')
time.sleep(2)
main_menu()
else:
pressed_keys += key
def admin_menu_1():
global fun
clear_keys()
mylcd.lcd_clear()
49
print('')
def admin_input(key):
global pressed_keys
if key == '#':
print(pressed_keys)
if pressed_keys == "1":
print("send to grad_month")
print('')
clear_keys()
grad_month()
print('')
clear_keys()
admin_menu_2()
print('')
clear_keys()
main_menu()
else:
mylcd.lcd_clear()
print('INVALID ENTRY')
50
print('')
time.sleep(2)
admin_menu_1()
else:
pressed_keys += key
def admin_menu_2():
global fun
clear_keys()
mylcd.lcd_clear()
print('')
def admin_input2(key):
global pressed_keys
if key == '#':
print(pressed_keys)
if pressed_keys == "1":
clear_keys()
unenroll()
51
print("send back to prevous menu")
clear_keys()
admin_menu_1()
else:
mylcd.lcd_clear()
print('INVALID ENTRY')
print('')
time.sleep(2)
admin_menu_2()
else:
pressed_keys += key
def unenroll():
try:
if ( f.verifyPassword() == False ):
except Exception as e:
print('')
52
mylcd.lcd_clear()
mylcd.lcd_display_string('be initialized', 3)
time.sleep(2)
admin_menu_2()
print('')
mylcd.lcd_clear()
time.sleep(2)
try:
mylcd.lcd_clear()
positionNumber = int(positionNumber)
print('')
if ( f.deleteTemplate(positionNumber) == True ):
mylcd.lcd_clear()
print('User Deleted!')
print('')
53
time.sleep(2)
admin_menu_2()
except Exception as e:
print('Operation failed!')
print('')
mylcd.lcd_clear()
time.sleep(2)
admin_menu_2()
def grad_month():
global fun
mylcd.lcd_clear()
mylcd.lcd_display_string('1. IT 2. FIN', 2)
print('YOUR DEPARTMENET')
def month_input(key):
global pressed_keys
global month
54
if key == '#':
months = {
if pressed_keys in months:
month = months[pressed_keys]
clear_keys()
grad_year()
else:
mylcd.lcd_clear()
print("INCORRECT SELECTION")
print('')
time.sleep(2)
clear_keys()
grad_month()
else:
pressed_keys = key # Update to assign the current key rather than appending it
def grad_year():
global fun
mylcd.lcd_clear()
55
mylcd.lcd_display_string(' JOINING YEAR', 2)
print('')
def year_input(key):
global pressed_keys
global year
if key == '#':
if len(pressed_keys) != 2:
clear_keys()
mylcd.lcd_clear()
print("INCORRECT FORMAT")
print('')
time.sleep(2)
clear_keys()
stnum()
else:
year = pressed_keys
clear_keys()
stnum()
else:
pressed_keys += key
def stnum():
56
global fun
mylcd.lcd_clear()
print('Employee Number')
print('(Four Digits)')
print('')
def stnum_entry(key):
global pressed_keys
global employee_number
if key == '#':
if len(pressed_keys) != 4:
clear_keys()
mylcd.lcd_clear()
print('INVALID ENTRY')
print('')
time.sleep(2)
stnum()
else:
employee_number = pressed_keys
clear_keys()
confirm()
57
else:
pressed_keys += key
def confirm():
global fun
global employee
mylcd.lcd_clear()
mylcd.lcd_display_string('1. Confirm', 3)
mylcd.lcd_display_string('2. Cancel', 4)
print("ID:", employee)
print("1 : Confirm")
print("2 : Cancel")
print('')
def confirm_entry(key):
global pressed_keys
global employee
global first_initial
global last_initial
global employee_number
global month
58
global year
if key == '#':
if pressed_keys == '1':
clear_keys()
enroll()
clear_keys()
main_menu()
else:
clear_keys()
mylcd.lcd_clear()
print('INVALID ENTRY')
print('')
time.sleep(2)
confirm()
else:
pressed_keys += key
59
# Checking db to see if ID already taken
def enroll():
global employee
global r
print(employee)
r = employee
print('employee ID:', r)
print('')
conn = pymysql.connect(
host='192.168.8.101',
user='rpi_fp',
password='1234567890',
db='payroll',
charset='utf8mb4',
cursorclass=pymysql.cursors.DictCursor
try:
result = cursor.fetchone()
if result:
mylcd.lcd_clear()
60
print('')
time.sleep(2)
main_menu()
else:
try:
if not f.verifyPassword():
print('Contact Admin')
print('')
time.sleep(2)
except Exception as e:
mylcd.lcd_clear()
print('Contact Admin')
print('')
time.sleep(2)
print('')
main_menu()
print('')
61
try:
while True:
mylcd.lcd_clear()
mylcd.lcd_display_string('*Place Finger*', 2)
print('*Place Finger*')
print('')
pass
f.convertImage(0x01)
mylcd.lcd_clear()
mylcd.lcd_display_string('*Remove Finger*', 2)
print('*Remove Finger*')
print('')
time.sleep(2)
mylcd.lcd_clear()
print('')
pass
f.convertImage(0X02)
62
if f.compareCharacteristics() != 0:
mylcd.lcd_clear()
mylcd.lcd_display_string('Fingerprint Matched', 2)
print('Fingerprint Matched')
print('')
time.sleep(2)
f.createTemplate()
positionNumber = f.storeTemplate()
f.loadTemplate(positionNumber, 0X01)
characteristics = str(f.downloadCharacteristics(0x01)).encode('utf-8')
cre_hash = hashlib.sha256(characteristics).hexdigest()
conn.commit()
mylcd.lcd_clear()
mylcd.lcd_display_string('Fingerprint Registered', 2)
print('')
time.sleep(2)
admin_menu_1()
break
else:
mylcd.lcd_clear()
63
mylcd.lcd_display_string('Fingers Do Not Match', 2)
print('')
time.sleep(2)
except Exception as e:
print('')
main_menu()
finally:
conn.close()
# Keypad stuff
KEYPAD = [
factory = rpi_gpio.KeypadFactory()
64
# Try keypad = factory.create_4_by_4_keypad() #for reasonable defaults
col_pins=COL_PINS)
def printkey(key):
print(key)
keypad.registerKeyPressHandler(printkey)
def clear_keys():
global pressed_keys
def store_key(key):
global pressed_keys
if key == '#':
print(pressed_keys)
if pressed_keys == "1":
clear_keys()
finger()
print("send to pwd")
clear_keys()
password()
print("send to shutdown")
65
clear_keys()
shutdownmenu()
else:
mylcd.lcd_clear()
print('INVALID ENTRY')
print('')
time.sleep(2)
main_menu()
else:
pressed_keys += key
# initial options
def boot_sequence():
mylcd.lcd_clear()
mylcd.lcd_display_string(' BOOTING', 1)
mylcd.lcd_display_string(' [ ] ', 3)
time.sleep(.1)
mylcd.lcd_display_string(' [ * ] ', 3)
time.sleep(.1)
time.sleep(.1)
time.sleep(.1)
66
time.sleep(.1)
main_menu()
def main_menu():
global fun
clear_keys()
mylcd.lcd_clear()
print('')
boot_sequence()
def keyHandler(key):
if fun == 'main_menu':
store_key(key)
password_input(key)
admin_input(key)
admin_input2(key)
67
elif fun == 'confirm_del':
delete_db(key)
year_input(key)
month_input(key)
stnum_entry(key)
confirm_entry(key)
confirm_shutdown(key)
keypad.registerKeyPressHandler(keyHandler)
try:
while (True):
time.sleep(0.2)
except:
keypad.cleanup()
68