Wireless Biometric Fingerprint Attendance System Using Arduino and MySQL Database

Fingerprints are considered to be the best and fastest method for checking attendance. They are secured to use, unique to every person, and do not change in one’s lifetime barring accident. The objective of this paper was to improve on the fingerprint identification system for implementation on a large database. The main objective of this paper was to design and construct an attendance system using a fingerprint module. In this system, Arduino Wemos D1 R2 ESP8266 (microcontroller) and Adafruit fingerprint reader are the main components used to insert records into a database


INTRODUCTION
Many organizations are adopting biometric and time to check attendance improve in employee productivity, efficiency, and labor management. Without biometric identification systems, companies continue to rely on manual methods for payroll calculation, which are not only extremely time consuming, but also have high error rates. Compared to these manual methods, biometric attendance systems are error free, easy to install, user friendly and highly accurate.
In developing countries, many educational institutions and governmental organizations still use paper-based attendance methods to record and store attendance. It is expensive for most institutions in these countries to procure biometric attendance authentication systems. On the other hand, organizations that have been able to purchase biometric attendance authentication systems are not able to fully customize them to meet their needs because all the biometric systems available on the Ghanaian market are imported and are application specific; therefore, users are limited in their usage.
This project seeks to design and develop a finger print-based biometric attendance system to address the limitation and challenges with paper based authentication systems, and as well, be easy to customize.

Fingerprint Recognition
A biometric system is a computer system that implements biometric recognition algorithms. A typical biometric system consists of sensing, feature extraction, and matching modules. Depending on the application context, biometric systems may operate in two modes: verification mode and identification mode [1]. Through verification mode, the biometric sensors capture or scan the biometric trait of an individual to produce its digital representation. A quality check is generally performed to ensure that the acquired biometric sample can be reliably processed by the subsequent feature extraction and matching modules. The feature extraction module discards the unnecessary and extraneous information from the acquired samples, and extracts salient and discriminatory information called features that are generally used for matching. In identification mode, the query biometric sample is matched with the reference information stored in the databases to establish the identity associated with the query. [2] Fingerprint Recognition includes taking a fingerprint image of a person and recording its features like arches, whorls, and loops along with the outlines of edges, minutiae and furrows. Matching of the fingerprint can be attained in three ways, such as minutiae, correlation and ridge [3].
Fingerprint Readers are manufactured with pre-programmed sets of information embedded in them. The reader identifies the individual fingerprint by their templates stored in the reader's memory [4]. To read the data on the fingertip, the reader reflects infrared light to the fingertip to capture the ridge and minutiae of the fingerprint and store it as a template into the reader's memory. Figure 1 shows the operation of a fingerprint reader

PROJECT DESCRIPTION
In this paper an Arduino based fingerprint attendance authentication system is designed. Fingerprint readers and Arduino Wemos D1 R2 are used to enroll, verify and check attendance. The construction of the device begins with the connection of Arduino Wemos and a fingerprint sensor to the MySQL database via a wireless connection. MySQL is an Open Source Relational SQL Database Management System. In the identification phase, as soon as a user's fingerprint is scanned on the fingerprint sensor, it reads the fingerprint and then the associated user's information is displayed on an LCD screen. For this system, user name, fingerprint ID and other information are stored in an attendance table in the MySQL database on the server. The PHP script is a useful tool to connect the Arduino Wemos with a database. The overall block diagram is shown in Figure 2.

Arduino Wemos D1 R2 Microcontroller
The Arduino WeMos D1 R2 is an ESP8266 Wi-Fi based board that uses the Arduino layout with an operating voltage of 3.3V-5V. The board, as shown in Figure 3, is controlled by the ESP8266 chip (a 32-Bit processor) and has a larger flash memory compared to an Arduino Uno. It consists of 11 digital I/O pins and 1 analogue (input) pin. The board can be connected using a Micro-B type USB cable. The board's specifications are shown in Table  1.

Adafruit Fingerprint Reader DY50
The Adafruit Fingerprint Reader DY50, as shown in Figure 4,was selected because it has a Serial Peripheral Interface (SPI) communication with other hardware [6]. It also supports encryption in Read/Write mode and has a short fingerprint imaging time of 1.0 second.

Connectivity
The Wi-Fi connectivity device is embedded in Arduino Wemos D1 R2. The Wi-Fi is powered by ESP8266MOD. This supports the standard Wi-Fi (802.11 b/g/n) frequency of 2.4GHz and 5GHz. The connectivity is used as the medium to send and receive information from the database wirelessly.

Database
A database management system is a software package for creating and managing databases. Many different types of database systems exist based on how they manage the database structure. In this project, MySQL was used. MySQL is an Oracle-backed open source relational database management system (RDBMS) based on Structured Query Language (SQL). MySQL runs on virtually all platforms, including Linux, Mac OS and Windows [7]. Although it can be used in a wide range of applications, MySQL is often associated with web applications and online publishing. It is a component of XAMPP, an open source enterprise stack for web development that uses Linux as the operation system and Apache as the webserver.

PRINCIPLE OF OPERATION OF THE FINGERPRINT SYSTEM
During enrollment, the fingerprint of a user is captured and the minutiae data are extracted and stored in a reader memory as a template (user's fingerprint ID). This displays the fingerprint ID on a serial monitor ( Figure 5). Figure 6 shows the block diagram of the operation. During authentication, the fingerprint of the user is recaptured by a microcontroller and then the extracted features are compared with the ones already existing in the reader memory to determine the identity of the user in the database. When it successfully matches the fingerprint, the user's name and telephone number linked to the fingerprint ID in the database are retrieved after which a welcome note is displayed on the LCD display as shown in figure 7.  Arduino WeMos D1 R2 is the controller behind the whole system. When initially powered, it loads the declaration variables and the basic input/output instructions, which initialize the connected devices. It accepts the data received from the fingerprint reader and processes it according to the sketches (code) uploaded on it.
When the controller has successfully connected to a Wi-Fi network, it calls for the PHP script responsible for connecting the database and activates it. The code responsible is given below.

client.stop(); }
The data extracted from the fingerprint reader is then sent to another PHP script. The PHP script compares the extracted data with information stored in the database. If the data matches with information on the database, it will input the correspondent data into the 'Attendance' table and trigger the buzzer for one second to indicate that a member is present. But when it finds no match, it triggers the buzzer for two seconds. The PHP codes are given below. When the system is running, the LCD monitors the communication between the database and the Arduino WeMos, and displays the correspondent information on the screen as shown in

CONSTRUCTION OF THE FINGERPRINT SYSTEM
The fingerprint reader communicates with other hardware through the software serial. The connections are done using the WeMos D1 R2 standard communication protocol GPIO 13 and GPIO 15, using the code below; SoftwareSerial mySerial(13, 15); Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); Serial.begin(115200); finger.begin(57600); int printID; printID=getFingerprintIDez(); if (printID != -1) { Serial.println("Waiting for a good fingerprint ..."); } The fingerprint reader VCC, RX, TX and GND terminals were connected to the 3.3V, GPIO 15, GPIO13 and GND pins of the Arduino WeMos respectively. An LCD display was attached to the Arduino WeMos. The LCD display uses an I2C backpack that was connected to the analog pins SCL and SDA. Figure 9 shows the physical connection of the fingerprint reader, Arduino WeMos and the LCD display.

TESTING OF THE FINGERPRINT SYSTEM
The Arduino WeMos was tested with a simple code to blink the internal LED on pin 13. The fingerprint reader was also tested by uploading a sample code (enroll) from the fingerprint library. After uploading the sample code, the serial monitor was opened and a fingertip was scanned on the reader to register the fingerprint template.
The database, PHP and HTML forms were created after the installation of the XAMPP bundle. The database was tested by running the PHP connect script. When the script was able to access the database, sample data were keyed into the HTML form and submitted to the database by running the embedded PHP script.

COMPLETE SYSTEM TEST
All components were tested to verify that they were working effectively. After the individual components were tested, the system was completely assembled. All the components were connected to access the database through Wi-Fi. The HTML index file was opened and home page loaded. The fingertips were scanned and the device was able to identify the individual fingerprint IDs and displayed the corresponding data in the database.

CONCLUSION
A wireless biometric fingerprint attendance system is discussed in this paper. In the project,a fingerprint reader and Arduino Wemos D1 R2 were used to enroll, verify and check attendance. The construction of the device began with the connection of the Arduino Wemos and the fingerprint reader to MySQL database via a wireless connection. After the individual components were tested, the system was completely assembled. All the components were connected to access the database through Wi-Fi. To test the complete system, fingertips were scanned and the system was able to identify the individual fingerprint IDs and displayed the corresponding data in the database. This system will improve the ability of organizations to identify their members and keep track of their working hours or attendance at work. Additionally, the proposed system can be easily customized for different organizational needs.