ARTICLES

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 31

 ARTICLES

 ELECTRONICS CIRCUITS
 ARDUINO PROJECTS
 IOT PROJECTS
 MICROCONTROLLERS
 RASPBERRY PI

Search for

 Home/IoT Projects/IoT Biometric Fingerprint Attendance System using NodeMCU


ESP8266 ProjectsIoT Projects

IoT Biometric Fingerprint


Attendance System using
NodeMCU
Fingerprint Attendance System with ESP8266 & Website Database

 AdminLast Updated: August 22, 2022


73 43,067 5 minutes read

 Share
Facebook Twitter LinkedIn Pinterest Reddit Skype Messenger Share via Email Print

Table of Contents [hide]

 1 Overview

 2 Bill of Materials

 3 R305 Fingerprint Scanner Sensor Module

o 3.1 Introduction

o 3.2 Features

o 3.3 Specifications

 4 0.96″ I2C OLED Display


 5 Circuit Diagram: IOT Based Biometric Fingerprint Attendance System

 6 Setting Up the Website

 7 Source Code/Program

 8 Results

 9 Video Tutorial & Explanation

Overview
In this project IoT Biometric Project, we will learn how to build IoT based

Biometric Fingerprint Attendance System using NodeMCU ESP8266 12E,

0.96” OLED Display & R305 Fingerprint Sensor. The ESP8266 Wi-Fi

Module will collect the fingerprint data from the multiple users and sends it

over the internet to a website. The Enrolment of fingerprints is done on the

Server using R305 or R307 or any other compatible Fingerprint Sensor and

verification is done on the client with the transmission of fingerprint templates

over the network.

The website that is coded in PHP has a database and records of attendance.

By logging into the website, you can collect all the attendance records of each

user including personal details as well as incoming & outgoing timing. The

data can also be downloaded and exported to an excel sheet.


Conventional authentication technologies like RFID tags and authentication

cards have a lot of weaknesses, the biometric method of authentication is a

prompt replacement for this. Biometrics such as fingerprints, voices and ECG

signals are unique human characters that cannot be tampered or replicated.

This facilitates real-time system implementations. Biometric Attendance

systems are commonly used systems to mark the presence in offices and

schools. This project has a wide application in school, college, business

organization, offices where marking of attendance is required accurately with

time. Thus, by using the fingerprint sensor, the system will become more

secure for the users.

You can follow the basic level of the same project here: Arduino Fingerprint

Attendance System. In case if you want a better fingerprint sensor with small

and light weight, you can use GT511C3 fingerprint sensor.


Bill of Materials
The following are the components required to make IoT Based Biometric

Fingerprint Attendance System. All the components can be purchased from

Amazon. The purchase links are given below.

S.N. COMPONENTS QUANTITY PURCHASE LINKS


1 NodeMCU ESP8266 Board 1 Amazon | AliExpress
2 R305/R307 Fingerprint Sensor 1 Amazon | AliExpress
3 0.96" I2C OLED Display 1 Amazon | AliExpress
4 Connecting Wires 10 Amazon | AliExpress
5 Breadboard 1 Amazon | AliExpress

R305 Fingerprint Scanner Sensor Module


Introduction
This is a finger print sensor module with TTL UART interface for direct

connections to microcontroller UART or to PC through MAX232 / USB-Serial

adapter. The user can store the finger print data in the module and can

configure it in 1:1 or 1: N mode for identifying the person.

The Fingerprint module can be directly interfaced with any microcontroller as

well as Arduino Board. This optical biometric fingerprint reader with great

features and can be embedded into a variety of end products like access
control systems, attendance systems, safety deposit boxes, car door locking

systems.

Features
1. Integrated image collecting and algorithm chip together, ALL-in-One

2. The fingerprint reader can conduct secondary development, can be embedded

into a variety of end products

3. Low power consumption, low cost, small size, excellent performance

4. Professional optical technology, precise module manufacturing techniques

5. Good image processing capabilities can successfully capture image up to

resolution 500 dpi

Specifications
1. Fingerprint sensor type: Optical

2. Sensor Life: 100 million times

3. Static indicators: 15KVBacklight: bright green

4. Interface: USB1.1/UART(TTL logical level)

5. RS232 communication baud rate: 4800BPS~115200BPS changeable

6. Dimension: 553221.5mm

7. Image Capture Surface 15—18(mm)


8. Verification Speed: 0.3 sec

9. Scanning Speed: 0.5 sec

10. Character file size: 256 bytes

11. Template size: 512 bytes

12. Storage capacity: 250

13. Security level: 5 (1,2,3,4,5(highest))

14. False Acceptance Rate (FAR) :0.0001%

15. False Rejection Rate (FRR): 0.1%

16. Resolution 500 DPI

17. Voltage :3.6-6.0 VDC

18. Working current: Typical 90 mA, Peak 150mA

19. Matching Method: 1: N

20. Operating Environment Temperature: -20 to 45° centigrades

0.96″ I2C OLED Display


This is a 0.96 inch blue OLED display module. The display module can be

interfaced with any microcontroller using SPI/IIC protocols. It is having a

resolution of 128×64. The package includes display board, display,4 pin male

header pre-soldered to board.


OLED (Organic Light-Emitting Diode) is a self light-emitting technology

composed of a thin, multi-layered organic film placed between an anode and

cathode. In contrast to LCD technology, OLED does not require a backlight.

OLED possesses high application potential for virtually all types of displays and

is regarded as the ultimate technology for the next generation of flat-panel

displays.

Circuit Diagram: IOT Based Biometric Fingerprint


Attendance System
The above circuit diagram shows how an OLED Display & Fingerprint Sensor is

interfaced with NodeMCU ESP8266 12E Board. The I2C pins of OLED Display,

i.e SDA & SCL are connected to NodeMCU D2 & D1 pins respectively.

Similarly, the fingerprint sensor is connected to UART pins D5 & D6. The

fingerprint sensor Tx and Rx wire’s color may vary. In my case, the color is

yellow and blue where yellow is Tx and Blue is Rx. So connect it by finding

appropriate color wires else the module won’t be detected by NodeMCU.

The R305 fingerprint sensor is supplied with 5V through Vin pins of NodeMCU.

In my case, the sensor didn’t work at 3.3V. Similarly, connect OLED Vcc pin to

3.3V of NodeMCU.
Setting Up the Website
Here we can set up a website if you have a website and a server. In case you

don’t wanna spend money on website management, then you can use your

computer IP as a server to store the data locally in localhost.

But in case if you need a website or domain, you can purchase from here at

cheap price: Web Hosting Packages

First Download and install Xampp from the link here: Download XAMPP

Once the download and installation is completed copy the following

folder:Biometricattendance Folder to C:\xampp\htdocs. This is the location of

the website in your C drive.


The website setting process is a little long which is explained in the video

below: You can follow the video to completely set up the website.

Source Code/Program
Below is the source code for IoT Based Biometric Fingerprint Attendance

System. The code credit goes to original author of the code: Electronics Tech

YouTube Channel

Make Sure to change the wifi username and password from this line below:

1 /* Set these to your desired credentials. */


2 const char *ssid = "SSID";  //ENTER YOUR WIFI SETTINGS
3 const char *password = "password";
Also, change the IP Address if you are using Xampp or change the website

server if you are on real website from the line below:

1 String link = "http://YourComputerIP/biometricattendance/getdata.php"; //computer IP or the server domain


Add the following libraries via library manager or simply by adding the

following zip files:

1. OLED GFX Library: Download

2. SSD1306 Library: Download

3. Adafruit Fingerprint Sensor Library: Download

1 //Code Credit to orginal Author:  https://www.youtube.com/ElectronicsTechHaIs


2 //This code created by Electronics Tech channel
3 //*******************************libraries********************************
4 #include <SPI.h>
5 #include <Wire.h>
6 #include <WiFiClient.h>
7 #include <ESP8266WiFi.h>
8 #include <SoftwareSerial.h>
9 #include <ESP8266WebServer.h>
10 #include <ESP8266HTTPClient.h>
11 #include <Adafruit_GFX.h>          //https://github.com/adafruit/Adafruit-GFX-Library
12 #include <Adafruit_SSD1306.h>      //https://github.com/adafruit/Adafruit_SSD1306
13 #include <Adafruit_Fingerprint.h>  //https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library
14 //************************************************************************
15 //Fingerprint scanner Pins
16 #define Finger_Rx 14 //D5
17 #define Finger_Tx 12 //D6
18 // Declaration for SSD1306 display connected using software I2C
19 #define SCREEN_WIDTH 128 // OLED display width, in pixels
20 #define SCREEN_HEIGHT 64 // OLED display height, in pixels
21 #define OLED_RESET     0 // Reset pin # (or -1 if sharing Arduino reset pin)
22 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
23 //************************************************************************
24 SoftwareSerial mySerial(Finger_Rx, Finger_Tx);
25 Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
26 //************************************************************************
27 /* Set these to your desired credentials. */
28 const char *ssid = "SSID";  //ENTER YOUR WIFI SETTINGS
29 const char *password = "password";
30 //************************************************************************
31 String postData ; // post array that will be send to the website
32 String link = "http://YourComputerIP/biometricattendance/getdata.php"; //computer IP or the server domain
33 int FingerID = 0;     // The Fingerprint ID from the scanner
34 uint8_t id;
35 //*************************Biometric Icons*********************************
36 #define Wifi_start_width 54
37 #define Wifi_start_height 49
38 const uint8_t PROGMEM Wifi_start_bits[] = {
39   0x00,0x00,0x00,0x00,0x00,0x00,0x00
40 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00
41 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00
42 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00
43 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00
44 ,0x00,0x00,0x1f,0xf0,0x00,0x00,0x00
45 ,0x00,0x03,0xff,0xff,0x80,0x00,0x00
46 ,0x00,0x1f,0xf0,0x1f,0xf0,0x00,0x00
47 ,0x00,0x7e,0x00,0x00,0xfc,0x00,0x00
48 ,0x01,0xf0,0x00,0x00,0x1f,0x00,0x00
49 ,0x03,0xc0,0x00,0x00,0x07,0xc0,0x00
50 ,0x0f,0x00,0x00,0x00,0x01,0xe0,0x00
51 ,0x1c,0x00,0x00,0x00,0x00,0x70,0x00
52 ,0x38,0x00,0x07,0xc0,0x00,0x38,0x00
53 ,0x70,0x00,0xff,0xfe,0x00,0x1e,0x00
54 ,0xe0,0x03,0xfc,0x7f,0xc0,0x0e,0x00
55 ,0x00,0x1f,0x80,0x03,0xf0,0x00,0x00
56 ,0x00,0x3c,0x00,0x00,0x78,0x00,0x00
57 ,0x00,0xf0,0x00,0x00,0x1c,0x00,0x00
58 ,0x01,0xe0,0x00,0x00,0x0c,0x00,0x00
59 ,0x03,0x80,0x00,0x00,0x00,0x00,0x00
60 ,0x03,0x00,0x00,0x00,0x00,0x00,0x00
61 ,0x00,0x00,0x3f,0xf8,0x07,0x1e,0x00
62 ,0x00,0x00,0xff,0xfe,0x1f,0xbf,0x80
63 ,0x00,0x03,0xe0,0x04,0x7f,0xff,0xc0
64 ,0x00,0x07,0x80,0x00,0xff,0xff,0xe0
65 ,0x00,0x0e,0x00,0x00,0xff,0xff,0xe0
66 ,0x00,0x0c,0x00,0x00,0x7f,0xff,0xc0
67 ,0x00,0x00,0x00,0x00,0xfe,0x07,0xe0
68 ,0x00,0x00,0x00,0x03,0xf8,0x03,0xf8
69 ,0x00,0x00,0x07,0xe7,0xf9,0xf1,0xfc
70 ,0x00,0x00,0x1f,0xe7,0xf1,0xf9,0xfc
71 ,0x00,0x00,0x1f,0xe7,0xf3,0xf9,0xfc
72 ,0x00,0x00,0x3f,0xe7,0xf3,0xf9,0xfc
73 ,0x00,0x00,0x3f,0xe7,0xf1,0xf1,0xfc
74 ,0x00,0x00,0x3f,0xe3,0xf8,0xe3,0xfc
75 ,0x00,0x00,0x3f,0xf3,0xfc,0x07,0xf8
76 ,0x00,0x00,0x1f,0xf0,0x7f,0x0f,0xc0
77 ,0x00,0x00,0x0f,0xe0,0x7f,0xff,0xe0
78 ,0x00,0x00,0x07,0xc0,0xff,0xff,0xe0
79 ,0x00,0x00,0x00,0x00,0x7f,0xff,0xe0
80 ,0x00,0x00,0x00,0x00,0x3f,0xff,0x80
81 ,0x00,0x00,0x00,0x00,0x1f,0xbf,0x00
82 ,0x00,0x00,0x00,0x00,0x03,0x18,0x00
83 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00
84 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00
85 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00
86 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00
87 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00
88 };
89 #define Wifi_connected_width 63
90 #define Wifi_connected_height 49
91 const uint8_t PROGMEM Wifi_connected_bits[] = {
92   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
93 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
94 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
95 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
96 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
97 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
98 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
99 ,0x00,0x00,0x03,0xff,0xff,0x80,0x00,0x00
100 ,0x00,0x00,0x3f,0xff,0xff,0xf8,0x00,0x00
101 ,0x00,0x01,0xff,0xff,0xff,0xff,0x00,0x00
102 ,0x00,0x0f,0xff,0xff,0xff,0xff,0xe0,0x00
103 ,0x00,0x3f,0xff,0xc0,0x07,0xff,0xf8,0x00
104 ,0x00,0xff,0xf8,0x00,0x00,0x3f,0xfe,0x00
105 ,0x03,0xff,0x80,0x00,0x00,0x03,0xff,0x80
106 ,0x07,0xfe,0x00,0x00,0x00,0x00,0xff,0xc0
107 ,0x1f,0xf8,0x00,0x00,0x00,0x00,0x3f,0xf0
108 ,0x3f,0xe0,0x01,0xff,0xff,0x00,0x0f,0xf8
109 ,0x7f,0x80,0x0f,0xff,0xff,0xe0,0x03,0xfc
110 ,0xff,0x00,0x7f,0xff,0xff,0xfc,0x01,0xfe
111 ,0xfc,0x01,0xff,0xff,0xff,0xff,0x00,0x7e
112 ,0x78,0x07,0xff,0xc0,0x07,0xff,0xc0,0x3c
113 ,0x00,0x0f,0xfc,0x00,0x00,0x7f,0xe0,0x00
114 ,0x00,0x1f,0xf0,0x00,0x00,0x1f,0xf0,0x00
115 ,0x00,0x3f,0xc0,0x00,0x00,0x07,0xf8,0x00
116 ,0x00,0x7f,0x00,0x01,0x00,0x01,0xfc,0x00
117 ,0x00,0x7e,0x00,0x7f,0xfc,0x00,0xfc,0x00
118 ,0x00,0x3c,0x03,0xff,0xff,0x80,0x78,0x00
119 ,0x00,0x00,0x07,0xff,0xff,0xc0,0x00,0x00
120 ,0x00,0x00,0x1f,0xff,0xff,0xf0,0x00,0x00
121 ,0x00,0x00,0x3f,0xf0,0x1f,0xf8,0x00,0x00
122 ,0x00,0x00,0x3f,0x80,0x03,0xf8,0x00,0x00
123 ,0x00,0x00,0x3f,0x00,0x01,0xf8,0x00,0x00
124 ,0x00,0x00,0x1c,0x00,0x00,0x70,0x00,0x00
125 ,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00
126 ,0x00,0x00,0x00,0x0f,0xe0,0x00,0x00,0x00
127 ,0x00,0x00,0x00,0x1f,0xf0,0x00,0x00,0x00
128 ,0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00
129 ,0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00
130 ,0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00
131 ,0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00
132 ,0x00,0x00,0x00,0x1f,0xf0,0x00,0x00,0x00
133 ,0x00,0x00,0x00,0x0f,0xe0,0x00,0x00,0x00
134 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
135 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
136 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
137 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
138 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
139 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
140 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
141 };
142 #define FinPr_start_width 64
143 #define FinPr_start_height 64
144 const uint8_t PROGMEM FinPr_start_bits[] = {
145   0x00,0x00,0x00,0x1f,0xe0,0x00,0x00,0x00
146 ,0x00,0x00,0x01,0xff,0xfe,0x00,0x00,0x00
147 ,0x00,0x00,0x03,0xff,0xff,0x80,0x00,0x00
148 ,0x00,0x00,0x0f,0xc0,0x0f,0xe0,0x00,0x00
149 ,0x00,0x00,0x1f,0x00,0x01,0xf8,0x00,0x00
150 ,0x00,0x00,0x3c,0x00,0x00,0x7c,0x00,0x00
151 ,0x00,0x00,0x78,0x00,0x00,0x3e,0x00,0x00
152 ,0x00,0x00,0xf0,0x3f,0xf8,0x0f,0x00,0x00
153 ,0x00,0x01,0xe0,0xff,0xfe,0x07,0x80,0x00
154 ,0x00,0x03,0xc3,0xff,0xff,0x03,0x80,0x00
155 ,0x00,0x03,0x87,0xc0,0x07,0xc3,0xc0,0x00
156 ,0x00,0x07,0x0f,0x00,0x03,0xe1,0xc0,0x00
157 ,0x00,0x0f,0x0e,0x00,0x00,0xe0,0xe0,0x00
158 ,0x00,0x0e,0x1c,0x00,0x00,0xf0,0xe0,0x00
159 ,0x00,0x0c,0x3c,0x1f,0xe0,0x70,0xe0,0x00
160 ,0x00,0x00,0x38,0x3f,0xf0,0x38,0x70,0x00
161 ,0x00,0x00,0x78,0x78,0xf8,0x38,0x70,0x00
162 ,0x00,0x00,0x70,0x70,0x3c,0x18,0x70,0x00
163 ,0x00,0x00,0xe0,0xe0,0x1e,0x1c,0x70,0x00
164 ,0x00,0x03,0xe1,0xe0,0x0e,0x1c,0x70,0x00
165 ,0x00,0x0f,0xc1,0xc3,0x0e,0x1c,0x70,0x00
166 ,0x00,0x3f,0x03,0xc3,0x8e,0x1c,0x70,0x00
167 ,0x00,0x3e,0x03,0x87,0x0e,0x1c,0x70,0x00
168 ,0x00,0x30,0x07,0x07,0x0e,0x18,0xe0,0x00
169 ,0x00,0x00,0x0e,0x0e,0x0e,0x38,0xe0,0x00
170 ,0x00,0x00,0x3e,0x1e,0x1e,0x38,0xe0,0x00
171 ,0x00,0x00,0xf8,0x1c,0x1c,0x38,0xe0,0x00
172 ,0x00,0x03,0xf0,0x38,0x3c,0x38,0xe0,0x00
173 ,0x00,0x3f,0xc0,0xf8,0x78,0x38,0xe0,0x00
174 ,0x00,0x7f,0x01,0xf0,0x70,0x38,0xf0,0x00
175 ,0x00,0x78,0x03,0xe0,0xe0,0x38,0x70,0x00
176 ,0x00,0x00,0x0f,0x81,0xe0,0x38,0x7c,0x00
177 ,0x00,0x00,0x3f,0x03,0xc0,0x38,0x3e,0x00
178 ,0x00,0x00,0xfc,0x0f,0x80,0x38,0x1e,0x00
179 ,0x00,0x07,0xf0,0x1f,0x1c,0x1c,0x04,0x00
180 ,0x00,0x3f,0xc0,0x3e,0x3f,0x1e,0x00,0x00
181 ,0x00,0x7f,0x00,0xf8,0x7f,0x0f,0x00,0x00
182 ,0x00,0x38,0x01,0xf0,0xf7,0x07,0xc0,0x00
183 ,0x00,0x00,0x07,0xe1,0xe3,0x83,0xf8,0x00
184 ,0x00,0x00,0x3f,0x87,0xc3,0xc0,0xfc,0x00
185 ,0x00,0x01,0xfe,0x0f,0x81,0xe0,0x3c,0x00
186 ,0x00,0x0f,0xf8,0x1f,0x00,0xf0,0x00,0x00
187 ,0x00,0x1f,0xc0,0x7c,0x00,0x7c,0x00,0x00
188 ,0x00,0x1e,0x01,0xf8,0x00,0x3f,0x00,0x00
189 ,0x00,0x00,0x07,0xe0,0x78,0x0f,0xc0,0x00
190 ,0x00,0x00,0x3f,0x81,0xfe,0x07,0xf0,0x00
191 ,0x00,0x01,0xfe,0x07,0xff,0x01,0xf0,0x00
192 ,0x00,0x07,0xf8,0x0f,0x87,0x80,0x30,0x00
193 ,0x00,0x07,0xc0,0x3f,0x03,0xe0,0x00,0x00
194 ,0x00,0x06,0x00,0xfc,0x01,0xf8,0x00,0x00
195 ,0x00,0x00,0x03,0xf0,0x00,0x7e,0x00,0x00
196 ,0x00,0x00,0x0f,0xc0,0x00,0x3f,0x80,0x00
197 ,0x00,0x00,0x7f,0x00,0xf8,0x0f,0x80,0x00
198 ,0x00,0x00,0xfc,0x03,0xfe,0x01,0x80,0x00
199 ,0x00,0x00,0xf0,0x1f,0xff,0x80,0x00,0x00
200 ,0x00,0x00,0x00,0x7f,0x07,0xe0,0x00,0x00
201 ,0x00,0x00,0x00,0xfc,0x03,0xf8,0x00,0x00
202 ,0x00,0x00,0x03,0xf0,0x00,0x78,0x00,0x00
203 ,0x00,0x00,0x0f,0xc0,0x00,0x18,0x00,0x00
204 ,0x00,0x00,0x0f,0x01,0xf8,0x00,0x00,0x00
205 ,0x00,0x00,0x00,0x07,0xfe,0x00,0x00,0x00
206 ,0x00,0x00,0x00,0x1f,0xfe,0x00,0x00,0x00
207 ,0x00,0x00,0x00,0x1e,0x0e,0x00,0x00,0x00
208 ,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00
209 };
210 //---------------------------------------------------------------
211 #define FinPr_valid_width 64
212 #define FinPr_valid_height 64
213 const uint8_t PROGMEM FinPr_valid_bits[] = {
214   0x00,0x00,0x03,0xfe,0x00,0x00,0x00,0x00
215 ,0x00,0x00,0x1f,0xff,0xe0,0x00,0x00,0x00
216 ,0x00,0x00,0x7f,0xff,0xf8,0x00,0x00,0x00
217 ,0x00,0x00,0xfc,0x00,0xfe,0x00,0x00,0x00
218 ,0x00,0x03,0xe0,0x00,0x1f,0x00,0x00,0x00
219 ,0x00,0x07,0xc0,0x00,0x07,0x80,0x00,0x00
220 ,0x00,0x0f,0x80,0x00,0x03,0xe0,0x00,0x00
221 ,0x00,0x0e,0x03,0xff,0x01,0xe0,0x00,0x00
222 ,0x00,0x1c,0x1f,0xff,0xe0,0xf0,0x00,0x00
223 ,0x00,0x3c,0x3f,0xff,0xf0,0x78,0x00,0x00
224 ,0x00,0x78,0x7c,0x00,0xf8,0x3c,0x00,0x00
225 ,0x00,0x70,0xf0,0x00,0x3c,0x1c,0x00,0x00
226 ,0x00,0xe1,0xe0,0x00,0x1e,0x1c,0x00,0x00
227 ,0x00,0xe1,0xc0,0x00,0x0f,0x0e,0x00,0x00
228 ,0x00,0xc3,0x81,0xfc,0x07,0x0e,0x00,0x00
229 ,0x00,0x03,0x83,0xff,0x07,0x8e,0x00,0x00
230 ,0x00,0x07,0x07,0x8f,0x83,0x87,0x00,0x00
231 ,0x00,0x0f,0x0f,0x03,0xc3,0x87,0x00,0x00
232 ,0x00,0x1e,0x0e,0x01,0xc3,0x87,0x00,0x00
233 ,0x00,0x3c,0x1c,0x00,0xe1,0x87,0x00,0x00
234 ,0x00,0xf8,0x1c,0x30,0xe1,0x87,0x00,0x00
235 ,0x07,0xf0,0x38,0x70,0xe1,0x86,0x00,0x00
236 ,0x07,0xc0,0x78,0x70,0xe3,0x8e,0x00,0x00
237 ,0x02,0x00,0xf0,0xf0,0xe3,0x8e,0x00,0x00
238 ,0x00,0x01,0xe0,0xe0,0xe3,0x8e,0x00,0x00
239 ,0x00,0x03,0xc1,0xe1,0xc3,0x8e,0x00,0x00
240 ,0x00,0x0f,0x83,0xc3,0xc3,0x8e,0x00,0x00
241 ,0x00,0x7f,0x07,0x83,0x83,0x0e,0x00,0x00
242 ,0x07,0xfc,0x0f,0x07,0x83,0x0e,0x00,0x00
243 ,0x07,0xf0,0x1e,0x0f,0x03,0x0e,0x00,0x00
244 ,0x07,0x80,0x7c,0x1e,0x03,0x07,0x00,0x00
245 ,0x00,0x00,0xf8,0x3c,0x03,0x87,0x80,0x00
246 ,0x00,0x03,0xf0,0x78,0x03,0x83,0xc0,0x00
247 ,0x00,0x1f,0xc0,0xf0,0x02,0x00,0x00,0x00
248 ,0x00,0xff,0x01,0xe1,0xc0,0x0c,0x00,0x00
249 ,0x07,0xfc,0x03,0xc3,0xe1,0xff,0xc0,0x00
250 ,0x07,0xe0,0x0f,0x87,0xc7,0xff,0xf0,0x00
251 ,0x07,0x00,0x3f,0x0f,0x0f,0xff,0xfc,0x00
252 ,0x00,0x00,0x7c,0x3e,0x3f,0xff,0xfe,0x00
253 ,0x00,0x03,0xf8,0x7c,0x3f,0xff,0xff,0x00
254 ,0x00,0x1f,0xe0,0xf0,0x7f,0xff,0xff,0x80
255 ,0x00,0xff,0x83,0xe0,0xff,0xff,0xff,0x80
256 ,0x01,0xfc,0x07,0xc1,0xff,0xff,0xe3,0xc0
257 ,0x01,0xe0,0x1f,0x01,0xff,0xff,0xc3,0xc0
258 ,0x00,0x00,0xfe,0x01,0xff,0xff,0x87,0xe0
259 ,0x00,0x03,0xf8,0x13,0xff,0xff,0x0f,0xe0
260 ,0x00,0x1f,0xe0,0x73,0xff,0xfe,0x1f,0xe0
261 ,0x00,0x7f,0x81,0xf3,0xff,0xfc,0x1f,0xe0
262 ,0x00,0xfc,0x03,0xe3,0xef,0xf8,0x3f,0xe0
263 ,0x00,0x60,0x0f,0xc3,0xc7,0xf0,0x7f,0xe0
264 ,0x00,0x00,0x3f,0x03,0xc3,0xe0,0xff,0xe0
265 ,0x00,0x00,0xfc,0x03,0xc1,0xc1,0xff,0xe0
266 ,0x00,0x07,0xf0,0x13,0xe0,0x83,0xff,0xe0
267 ,0x00,0x0f,0xc0,0x7b,0xf8,0x07,0xff,0xe0
268 ,0x00,0x0f,0x01,0xf9,0xfc,0x0f,0xff,0xc0
269 ,0x00,0x00,0x07,0xf1,0xfe,0x1f,0xff,0xc0
270 ,0x00,0x00,0x1f,0xc0,0xff,0x3f,0xff,0x80
271 ,0x00,0x00,0x7e,0x00,0xff,0xff,0xff,0x80
272 ,0x00,0x00,0xfc,0x00,0x7f,0xff,0xff,0x00
273 ,0x00,0x00,0xf0,0x1f,0x3f,0xff,0xfe,0x00
274 ,0x00,0x00,0x00,0x7f,0x1f,0xff,0xfc,0x00
275 ,0x00,0x00,0x01,0xff,0x8f,0xff,0xf8,0x00
276 ,0x00,0x00,0x03,0xe0,0xe3,0xff,0xe0,0x00
277 ,0x00,0x00,0x01,0x80,0x00,0x7f,0x00,0x00
278 };
279 //---------------------------------------------------------------
280 #define FinPr_invalid_width 64
281 #define FinPr_invalid_height 64
282 const uint8_t PROGMEM FinPr_invalid_bits[] = {
283   0x00,0x00,0x03,0xfe,0x00,0x00,0x00,0x00
284 ,0x00,0x00,0x1f,0xff,0xe0,0x00,0x00,0x00
285 ,0x00,0x00,0x7f,0xff,0xf8,0x00,0x00,0x00
286 ,0x00,0x00,0xfc,0x00,0xfe,0x00,0x00,0x00
287 ,0x00,0x03,0xe0,0x00,0x1f,0x00,0x00,0x00
288 ,0x00,0x07,0xc0,0x00,0x07,0x80,0x00,0x00
289 ,0x00,0x0f,0x80,0x00,0x03,0xe0,0x00,0x00
290 ,0x00,0x0e,0x03,0xff,0x01,0xe0,0x00,0x00
291 ,0x00,0x1c,0x1f,0xff,0xe0,0xf0,0x00,0x00
292 ,0x00,0x3c,0x3f,0xff,0xf0,0x78,0x00,0x00
293 ,0x00,0x78,0x7c,0x00,0xf8,0x3c,0x00,0x00
294 ,0x00,0x70,0xf0,0x00,0x3c,0x1c,0x00,0x00
295 ,0x00,0xe1,0xe0,0x00,0x1e,0x1c,0x00,0x00
296 ,0x00,0xe1,0xc0,0x00,0x0f,0x0e,0x00,0x00
297 ,0x00,0xc3,0x81,0xfc,0x07,0x0e,0x00,0x00
298 ,0x00,0x03,0x83,0xff,0x07,0x8e,0x00,0x00
299 ,0x00,0x07,0x07,0x8f,0x83,0x87,0x00,0x00
300 ,0x00,0x0f,0x0f,0x03,0xc3,0x87,0x00,0x00
301 ,0x00,0x1e,0x0e,0x01,0xc3,0x87,0x00,0x00
302 ,0x00,0x3c,0x1c,0x00,0xe1,0x87,0x00,0x00
303 ,0x00,0xf8,0x1c,0x30,0xe1,0x87,0x00,0x00
304 ,0x07,0xf0,0x38,0x70,0xe1,0x86,0x00,0x00
305 ,0x07,0xc0,0x78,0x70,0xe3,0x8e,0x00,0x00
306 ,0x02,0x00,0xf0,0xf0,0xe3,0x8e,0x00,0x00
307 ,0x00,0x01,0xe0,0xe0,0xe3,0x8e,0x00,0x00
308 ,0x00,0x03,0xc1,0xe1,0xc3,0x8e,0x00,0x00
309 ,0x00,0x0f,0x83,0xc3,0xc3,0x8e,0x00,0x00
310 ,0x00,0x7f,0x07,0x83,0x83,0x0e,0x00,0x00
311 ,0x07,0xfc,0x0f,0x07,0x83,0x0e,0x00,0x00
312 ,0x07,0xf0,0x1e,0x0f,0x03,0x0e,0x00,0x00
313 ,0x07,0x80,0x7c,0x1e,0x03,0x07,0x00,0x00
314 ,0x00,0x00,0xf8,0x3c,0x03,0x87,0x80,0x00
315 ,0x00,0x03,0xf0,0x78,0x03,0x83,0xc0,0x00
316 ,0x00,0x1f,0xc0,0xf0,0x02,0x00,0x00,0x00
317 ,0x00,0xff,0x01,0xe1,0xc0,0x00,0x00,0x00
318 ,0x07,0xfc,0x03,0xc3,0xe1,0xff,0xc0,0x00
319 ,0x07,0xe0,0x0f,0x87,0xc7,0xff,0xf0,0x00
320 ,0x07,0x00,0x3f,0x0f,0x0f,0xff,0xf8,0x00
321 ,0x00,0x00,0x7c,0x3e,0x1f,0xff,0xfe,0x00
322 ,0x00,0x03,0xf8,0x7c,0x3f,0xff,0xff,0x00
323 ,0x00,0x1f,0xe0,0xf0,0x7f,0xff,0xff,0x00
324 ,0x00,0xff,0x83,0xe0,0xfe,0xff,0xbf,0x80
325 ,0x01,0xfc,0x07,0xc0,0xfc,0x7f,0x1f,0xc0
326 ,0x01,0xe0,0x1f,0x01,0xf8,0x3e,0x0f,0xc0
327 ,0x00,0x00,0xfe,0x01,0xf8,0x1c,0x07,0xe0
328 ,0x00,0x03,0xf8,0x13,0xf8,0x00,0x0f,0xe0
329 ,0x00,0x1f,0xe0,0x73,0xfc,0x00,0x1f,0xe0
330 ,0x00,0x7f,0x81,0xf3,0xfe,0x00,0x3f,0xe0
331 ,0x00,0xfc,0x03,0xe3,0xff,0x00,0x7f,0xe0
332 ,0x00,0x60,0x0f,0xc3,0xff,0x80,0xff,0xe0
333 ,0x00,0x00,0x3f,0x03,0xff,0x00,0x7f,0xe0
334 ,0x00,0x00,0xfc,0x03,0xfe,0x00,0x3f,0xe0
335 ,0x00,0x07,0xf0,0x13,0xfc,0x00,0x1f,0xe0
336 ,0x00,0x0f,0xc0,0x79,0xf8,0x08,0x0f,0xe0
337 ,0x00,0x0f,0x01,0xf9,0xf8,0x1c,0x0f,0xc0
338 ,0x00,0x00,0x07,0xf1,0xfc,0x3e,0x1f,0xc0
339 ,0x00,0x00,0x1f,0xc0,0xfe,0x7f,0x3f,0x80
340 ,0x00,0x00,0x7e,0x00,0xff,0xff,0xff,0x80
341 ,0x00,0x00,0xfc,0x00,0x7f,0xff,0xff,0x00
342 ,0x00,0x00,0xf0,0x1f,0x3f,0xff,0xfe,0x00
343 ,0x00,0x00,0x00,0x7f,0x1f,0xff,0xfc,0x00
344 ,0x00,0x00,0x01,0xff,0x8f,0xff,0xf8,0x00
345 ,0x00,0x00,0x03,0xe0,0xe3,0xff,0xe0,0x00
346 ,0x00,0x00,0x01,0x80,0x00,0x7f,0x00,0x00
347 };
348 //---------------------------------------------------------------
349 #define FinPr_failed_width 64
350 #define FinPr_failed_height 64
351 const uint8_t PROGMEM FinPr_failed_bits[] = {
352 0x00,0x00,0x3f,0xe0,0x00,0x00,0x00,0x00
353 ,0x00,0x01,0xff,0xfe,0x00,0x00,0x00,0x00
354 ,0x00,0x0f,0xc0,0x1f,0x80,0x00,0x00,0x00
355 ,0x00,0x1e,0x00,0x03,0xc0,0x00,0x00,0x00
356 ,0x00,0x78,0x00,0x00,0xf0,0x00,0x00,0x00
357 ,0x00,0xe0,0x00,0x00,0x38,0x00,0x00,0x00
358 ,0x01,0xc0,0x00,0x00,0x1c,0x00,0x00,0x00
359 ,0x03,0x80,0x00,0x00,0x0e,0x00,0x00,0x00
360 ,0x07,0x00,0x7f,0xe0,0x07,0x00,0x00,0x00
361 ,0x06,0x01,0xff,0xf8,0x03,0x00,0x00,0x00
362 ,0x0c,0x03,0xc0,0x3c,0x03,0x80,0x00,0x00
363 ,0x1c,0x0f,0x00,0x0e,0x01,0x80,0x00,0x00
364 ,0x18,0x0c,0x00,0x03,0x00,0xc0,0x00,0x00
365 ,0x18,0x18,0x00,0x01,0x80,0xc0,0x00,0x00
366 ,0x30,0x38,0x00,0x01,0xc0,0xe0,0x00,0x00
367 ,0x30,0x30,0x0f,0x00,0xc0,0x60,0x00,0x00
368 ,0x30,0x30,0x3f,0xc0,0xe0,0x60,0x00,0x00
369 ,0x70,0x60,0x78,0xe0,0x60,0x60,0x00,0x00
370 ,0x60,0x60,0x60,0x60,0x60,0x70,0x00,0x00
371 ,0x60,0x60,0x60,0x60,0x60,0x30,0x00,0x00
372 ,0x60,0x60,0x60,0x60,0x30,0x30,0x00,0x00
373 ,0x60,0x60,0x60,0x30,0x30,0x20,0x00,0x00
374 ,0x60,0x60,0x60,0x30,0x30,0x01,0xe0,0x00
375 ,0x60,0x60,0x60,0x30,0x30,0x0f,0xfc,0x00
376 ,0x60,0x60,0x60,0x30,0x30,0x3f,0xff,0x00
377 ,0x60,0x60,0x60,0x30,0x18,0x78,0x03,0x80
378 ,0x60,0x60,0x60,0x30,0x1c,0x60,0x01,0x80
379 ,0x60,0x60,0x30,0x38,0x0c,0xc0,0x00,0xc0
380 ,0x00,0x60,0x30,0x18,0x00,0xc0,0x00,0xc0
381 ,0x00,0x60,0x30,0x18,0x00,0xc0,0x00,0xc0
382 ,0x00,0xe0,0x30,0x0c,0x01,0xc0,0x00,0xe0
383 ,0x00,0xc0,0x18,0x0e,0x01,0xc0,0x00,0xe0
384 ,0x60,0xc0,0x18,0x07,0x01,0xc0,0x00,0xe0
385 ,0x01,0xc0,0x1c,0x03,0x81,0xc0,0x00,0xe0
386 ,0x01,0x80,0x0c,0x01,0xc1,0xc0,0x00,0xe0
387 ,0x03,0x80,0x0e,0x00,0xf1,0xc0,0x00,0xe0
388 ,0x0f,0x00,0x06,0x00,0x01,0xc0,0x00,0xe0
389 ,0x3e,0x01,0x03,0x00,0x01,0xc0,0x00,0xe0
390 ,0x30,0x03,0x83,0x80,0x1f,0xff,0xff,0xfe
391 ,0x00,0x03,0x81,0xc0,0x3f,0xff,0xff,0xff
392 ,0x00,0x07,0xc0,0xe0,0x30,0x00,0x00,0x03
393 ,0x00,0x0e,0xc0,0x78,0x30,0x00,0x00,0x03
394 ,0x00,0x3c,0x60,0x1e,0x30,0x00,0x00,0x03
395 ,0x00,0x78,0x70,0x0f,0x30,0x00,0x00,0x03
396 ,0x03,0xe0,0x38,0x03,0x30,0x00,0x00,0x03
397 ,0x07,0x80,0x1c,0x00,0x30,0x00,0x00,0x03
398 ,0xc0,0x00,0x0f,0x00,0x30,0x00,0x00,0x03
399 ,0xc0,0x00,0x03,0x80,0x30,0x01,0xe0,0x03
400 ,0x00,0x18,0x01,0xe0,0x30,0x03,0xf0,0x03
401 ,0x00,0x18,0x00,0x7c,0x30,0x07,0x38,0x03
402 ,0x00,0x0c,0x00,0x1f,0x30,0x06,0x18,0x03
403 ,0x18,0x0e,0x00,0x07,0x30,0x06,0x18,0x03
404 ,0x0c,0x07,0x80,0x00,0x30,0x07,0x38,0x03
405 ,0x0e,0x03,0xc0,0x00,0x30,0x03,0x30,0x03
406 ,0x07,0x00,0xf0,0x00,0x30,0x03,0x30,0x03
407 ,0x03,0x00,0x7e,0x00,0x30,0x03,0x30,0x03
408 ,0x01,0x80,0x1f,0xc0,0x30,0x03,0x30,0x03
409 ,0x01,0xc0,0x03,0xe1,0x30,0x07,0xf8,0x03
410 ,0x00,0xf0,0x00,0x01,0x30,0x03,0xf0,0x03
411 ,0x00,0x38,0x00,0x00,0x30,0x00,0x00,0x03
412 ,0x00,0x1e,0x00,0x00,0x30,0x00,0x00,0x03
413 ,0x00,0x07,0xc0,0x00,0x30,0x00,0x00,0x03
414 ,0x00,0x01,0xff,0x80,0x3f,0xff,0xff,0xff
415 ,0x00,0x00,0x3f,0x80,0x1f,0xff,0xff,0xfe
416 };
417 //---------------------------------------------------------------
418 #define FinPr_scan_width 64
419 #define FinPr_scan_height 64
420 const uint8_t PROGMEM FinPr_scan_bits[] = {
421   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
422 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
423 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
424 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
425 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
426 ,0x00,0x00,0x00,0x1f,0xf8,0x00,0x00,0x00
427 ,0x00,0x00,0x00,0x7f,0xff,0x00,0x00,0x00
428 ,0x00,0x00,0x01,0xfc,0x7f,0xc0,0x00,0x00
429 ,0x00,0x00,0x03,0xc0,0x03,0xe0,0x00,0x00
430 ,0x00,0x00,0x07,0x80,0x00,0xf0,0x00,0x00
431 ,0x00,0x00,0x0e,0x00,0x00,0x3c,0x00,0x00
432 ,0x00,0x00,0x1c,0x1f,0xfc,0x1c,0x00,0x00
433 ,0x00,0x00,0x38,0x7f,0xfe,0x0e,0x00,0x00
434 ,0x00,0x00,0x78,0xf8,0x0f,0x87,0x00,0x00
435 ,0x00,0x00,0x71,0xe0,0x03,0xc7,0x00,0x00
436 ,0x00,0x00,0xe3,0x80,0x01,0xc3,0x80,0x00
437 ,0x00,0x00,0xc3,0x83,0xc0,0xe3,0x80,0x00
438 ,0x00,0x00,0xc7,0x0f,0xf0,0x71,0x80,0x00
439 ,0x00,0x00,0x06,0x1f,0xf8,0x71,0xc0,0x00
440 ,0x00,0x00,0x0e,0x1c,0x3c,0x31,0xc0,0x00
441 ,0x00,0x00,0x1c,0x38,0x1c,0x31,0xc0,0x00
442 ,0x00,0x00,0x38,0x70,0x0e,0x39,0xc0,0x00
443 ,0x00,0x01,0xf0,0x71,0x8e,0x39,0xc0,0x00
444 ,0x00,0x03,0xe0,0xe1,0x86,0x31,0xc0,0x00
445 ,0x00,0x03,0x81,0xe3,0x8e,0x31,0x80,0x00
446 ,0x00,0x00,0x03,0xc3,0x8e,0x33,0x80,0x00
447 ,0x00,0x00,0x07,0x87,0x0c,0x73,0x80,0x00
448 ,0x00,0x00,0x1f,0x0e,0x1c,0x73,0x80,0x00
449 ,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xfe
450 ,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
451 ,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
452 ,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xfe
453 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
454 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
455 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
456 ,0x00,0x03,0xf0,0x1e,0x3e,0x1c,0x00,0x00
457 ,0x00,0x03,0x80,0x7c,0x77,0x0f,0x00,0x00
458 ,0x00,0x00,0x01,0xf0,0xe3,0x07,0xc0,0x00
459 ,0x00,0x00,0x07,0xe3,0xc3,0x81,0xf0,0x00
460 ,0x00,0x00,0x3f,0x87,0x81,0xc0,0x60,0x00
461 ,0x00,0x01,0xfc,0x1f,0x00,0xf0,0x00,0x00
462 ,0x00,0x01,0xe0,0x3c,0x00,0x7c,0x00,0x00
463 ,0x00,0x00,0x00,0xf8,0x78,0x1f,0x00,0x00
464 ,0x00,0x00,0x07,0xe0,0xfc,0x0f,0xc0,0x00
465 ,0x00,0x00,0x3f,0x83,0xef,0x03,0xc0,0x00
466 ,0x00,0x00,0xfc,0x0f,0x87,0x80,0x00,0x00
467 ,0x00,0x00,0x70,0x1f,0x03,0xe0,0x00,0x00
468 ,0x00,0x00,0x00,0x7c,0x00,0xf8,0x00,0x00
469 ,0x00,0x00,0x01,0xf0,0x00,0x3e,0x00,0x00
470 ,0x00,0x00,0x0f,0xc0,0xf8,0x0f,0x00,0x00
471 ,0x00,0x00,0x1f,0x03,0xfe,0x02,0x00,0x00
472 ,0x00,0x00,0x0c,0x0f,0x8f,0x80,0x00,0x00
473 ,0x00,0x00,0x00,0x3f,0x03,0xe0,0x00,0x00
474 ,0x00,0x00,0x00,0xf8,0x00,0xf0,0x00,0x00
475 ,0x00,0x00,0x01,0xe0,0x00,0x30,0x00,0x00
476 ,0x00,0x00,0x01,0xc0,0xf8,0x00,0x00,0x00
477 ,0x00,0x00,0x00,0x07,0xfe,0x00,0x00,0x00
478 ,0x00,0x00,0x00,0x0f,0x8e,0x00,0x00,0x00
479 ,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00
480 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
481 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
482 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
483 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
484 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
485 };
486 //************************************************************************
487 void setup() {
488  
489   Serial.begin(115200);
490   
491   //-----------initiate OLED display-------------
492   
493   // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
494   if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
495     Serial.println(F("SSD1306 allocation failed"));
496     for(;;); // Don't proceed, loop forever
497   }
498   // Show initial display buffer contents on the screen --
499   // the library initializes this with an Adafruit splash screen.
500   // you can delet these three lines if you don't want to get the Adfruit logo appear
501   display.display();
502   delay(2000); // Pause for 2 seconds
503   display.clearDisplay();
504   
505   //---------------------------------------------
506   
507   connectToWiFi();
508   
509   //---------------------------------------------
510   
511   // set the data rate for the sensor serial port
512   finger.begin(57600);
513   Serial.println("\n\nAdafruit finger detect test");
514  
515   if (finger.verifyPassword()) {
516     Serial.println("Found fingerprint sensor!");
517     display.clearDisplay();
518     display.drawBitmap( 34, 0, FinPr_valid_bits, FinPr_valid_width, FinPr_valid_height, WHITE);
519     display.display();
520   } else {
521     Serial.println("Did not find fingerprint sensor :(");
522     display.clearDisplay();
523     display.drawBitmap( 32, 0, FinPr_failed_bits, FinPr_failed_width, FinPr_failed_height, WHITE);
524     display.display();
525     while (1) { delay(1); }
526   }
527   //---------------------------------------------
528   
529   finger.getTemplateCount();
530   Serial.print("Sensor contains "); Serial.print(finger.templateCount); Serial.println(" templates");
531   Serial.println("Waiting for valid finger...");
532   
533   //------------*test the connection*------------
534   
535   //SendFingerprintID( FingerID );
536   
537 }
538 //************************************************************************
539 void loop() {
540  
541   //check if there's a connection to WiFi or not
542   if(WiFi.status() != WL_CONNECTED){
543     connectToWiFi();
544   }
545   //---------------------------------------------
546   //If there no fingerprint has been scanned return -1 or -2 if there an error or 0 if there nothing, The ID start form 1 to 127
547   FingerID = getFingerprintID();  // Get the Fingerprint ID from the Scanner
548   delay(50);            //don't need to run this at full speed.
549   
550   //---------------------------------------------
551   
552   DisplayFingerprintID();
553   
554   //---------------------------------------------
555  
556   ChecktoAddID();
557  
558   //---------------------------------------------
559   
560   ChecktoDeleteID();
561  
562   //---------------------------------------------
563 }
564 //************Display the fingerprint ID state on the OLED*************
565 void DisplayFingerprintID(){
566   //Fingerprint has been detected
567   if (FingerID > 0){
568     display.clearDisplay();
569     display.drawBitmap( 34, 0, FinPr_valid_bits, FinPr_valid_width, FinPr_valid_height, WHITE);
570     display.display();
571     
572     SendFingerprintID( FingerID ); // Send the Fingerprint ID to the website.
573         
574   }
575   //---------------------------------------------
576   //No finger detected
577   else if (FingerID == 0){
578     display.clearDisplay();
579     display.drawBitmap( 32, 0, FinPr_start_bits, FinPr_start_width, FinPr_start_height, WHITE);
580     display.display();
581   }
582   //---------------------------------------------
583   //Didn't find a match
584   else if (FingerID == -1){
585     display.clearDisplay();
586     display.drawBitmap( 34, 0, FinPr_invalid_bits, FinPr_invalid_width, FinPr_invalid_height, WHITE);
587     display.display();
588   }
589   //---------------------------------------------
590   //Didn't find the scanner or there an error
591   else if (FingerID == -2){
592     display.clearDisplay();
593     display.drawBitmap( 32, 0, FinPr_failed_bits, FinPr_failed_width, FinPr_failed_height, WHITE);
594     display.display();
595   }
596 }
597 //************send the fingerprint ID to the website*************
598 void SendFingerprintID( int finger ){
599   
600   HTTPClient http;    //Declare object of class HTTPClient
601   //Post Data
602   postData = "FingerID=" + String(finger); // Add the Fingerprint ID to the Post array in order to send it
603   // Post methode
604  
605   http.begin(link); //initiate HTTP request, put your Website URL or Your Computer IP
606   http.addHeader("Content-Type", "application/x-www-form-urlencoded");    //Specify content-type header
607   
608   int httpCode = http.POST(postData);   //Send the request
609   String payload = http.getString();    //Get the response payload
610   
611   Serial.println(httpCode);   //Print HTTP return code
612   Serial.println(payload);    //Print request response payload
613   Serial.println(postData);   //Post Data
614   Serial.println(finger);     //Print fingerprint ID
615  
616   if (payload.substring(0, 5) == "login") {
617     String user_name = payload.substring(5);
618 //  Serial.println(user_name);
619     
620     display.clearDisplay();
621     display.setTextSize(2);             // Normal 2:2 pixel scale
622     display.setTextColor(WHITE);        // Draw white text
623     display.setCursor(15,0);             // Start at top-left corner
624     display.print(F("Welcome"));
625     display.setCursor(0,20);
626     display.print(user_name);
627     display.display();
628   }
629   else if (payload.substring(0, 6) == "logout") {
630     String user_name = payload.substring(6);
631 //  Serial.println(user_name);
632     
633     display.clearDisplay();
634     display.setTextSize(2);             // Normal 2:2 pixel scale
635     display.setTextColor(WHITE);        // Draw white text
636     display.setCursor(10,0);             // Start at top-left corner
637     display.print(F("Good Bye"));
638     display.setCursor(0,20);
639     display.print(user_name);
640     display.display();
641   }
642   delay(1000);
643   
644   postData = "";
645   http.end();  //Close connection
646 }
647 //********************Get the Fingerprint ID******************
648 int getFingerprintID() {
649   uint8_t p = finger.getImage();
650   switch (p) {
651     case FINGERPRINT_OK:
652       //Serial.println("Image taken");
653       break;
654     case FINGERPRINT_NOFINGER:
655       //Serial.println("No finger detected");
656       return 0;
657     case FINGERPRINT_PACKETRECIEVEERR:
658       //Serial.println("Communication error");
659       return -2;
660     case FINGERPRINT_IMAGEFAIL:
661       //Serial.println("Imaging error");
662       return -2;
663     default:
664       //Serial.println("Unknown error");
665       return -2;
666   }
667   // OK success!
668   p = finger.image2Tz();
669   switch (p) {
670     case FINGERPRINT_OK:
671       //Serial.println("Image converted");
672       break;
673     case FINGERPRINT_IMAGEMESS:
674       //Serial.println("Image too messy");
675       return -1;
676     case FINGERPRINT_PACKETRECIEVEERR:
677       //Serial.println("Communication error");
678       return -2;
679     case FINGERPRINT_FEATUREFAIL:
680       //Serial.println("Could not find fingerprint features");
681       return -2;
682     case FINGERPRINT_INVALIDIMAGE:
683       //Serial.println("Could not find fingerprint features");
684       return -2;
685     default:
686       //Serial.println("Unknown error");
687       return -2;
688   }
689   // OK converted!
690   p = finger.fingerFastSearch();
691   if (p == FINGERPRINT_OK) {
692     //Serial.println("Found a print match!");
693   } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
694     //Serial.println("Communication error");
695     return -2;
696   } else if (p == FINGERPRINT_NOTFOUND) {
697     //Serial.println("Did not find a match");
698     return -1;
699   } else {
700     //Serial.println("Unknown error");
701     return -2;
702   }  
703   // found a match!
704   //Serial.print("Found ID #"); Serial.print(finger.fingerID);
705   //Serial.print(" with confidence of "); Serial.println(finger.confidence);
706  
707   return finger.fingerID;
708 }
709 //******************Check if there a Fingerprint ID to delete******************
710 void ChecktoDeleteID(){
711  
712   HTTPClient http;    //Declare object of class HTTPClient
713   //Post Data
714   postData = "DeleteID=check"; // Add the Fingerprint ID to the Post array in order to send it
715   // Post methode
716  
717   http.begin(link); //initiate HTTP request, put your Website URL or Your Computer IP
718   http.addHeader("Content-Type", "application/x-www-form-urlencoded");    //Specify content-type header
719   
720   int httpCode = http.POST(postData);   //Send the request
721   String payload = http.getString();    //Get the response payload
722  
723   if (payload.substring(0, 6) == "del-id") {
724     String del_id = payload.substring(6);
725     Serial.println(del_id);
726     deleteFingerprint( del_id.toInt() );
727   }
728   
729   http.end();  //Close connection
730 }
731 //******************Delete Finpgerprint ID*****************
732 uint8_t deleteFingerprint( int id) {
733   uint8_t p = -1;
734   
735   p = finger.deleteModel(id);
736  
737   if (p == FINGERPRINT_OK) {
738     //Serial.println("Deleted!");
739     display.clearDisplay();
740     display.setTextSize(2);             // Normal 2:2 pixel scale
741     display.setTextColor(WHITE);        // Draw white text
742     display.setCursor(0,0);             // Start at top-left corner
743     display.print(F("Deleted!\n"));
744     display.display();
745   } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
746     //Serial.println("Communication error");
747     display.clearDisplay();
748     display.setTextSize(1);             // Normal 1:1 pixel scale
749     display.setTextColor(WHITE);        // Draw white text
750     display.setCursor(0,0);             // Start at top-left corner
751     display.print(F("Communication error!\n"));
752     display.display();
753     return p;
754   } else if (p == FINGERPRINT_BADLOCATION) {
755     //Serial.println("Could not delete in that location");
756     display.clearDisplay();
757     display.setTextSize(1);             // Normal 1:1 pixel scale
758     display.setTextColor(WHITE);        // Draw white text
759     display.setCursor(0,0);             // Start at top-left corner
760     display.print(F("Could not delete in that location!\n"));
761     display.display();
762     return p;
763   } else if (p == FINGERPRINT_FLASHERR) {
764     //Serial.println("Error writing to flash");
765     display.clearDisplay();
766     display.setTextSize(1);             // Normal 1:1 pixel scale
767     display.setTextColor(WHITE);        // Draw white text
768     display.setCursor(0,0);             // Start at top-left corner
769     display.print(F("Error writing to flash!\n"));
770     display.display();
771     return p;
772   } else {
773     //Serial.print("Unknown error: 0x"); Serial.println(p, HEX);
774     display.clearDisplay();
775     display.setTextSize(2);             // Normal 2:2 pixel scale
776     display.setTextColor(WHITE);        // Draw white text
777     display.setCursor(0,0);             // Start at top-left corner
778     display.print(F("Unknown error:\n"));
779     display.display();
780     return p;
781   }  
782 }
783 //******************Check if there a Fingerprint ID to add******************
784 void ChecktoAddID(){
785  
786   HTTPClient http;    //Declare object of class HTTPClient
787   //Post Data
788   postData = "Get_Fingerid=get_id"; // Add the Fingerprint ID to the Post array in order to send it
789   // Post methode
790  
791   http.begin(link); //initiate HTTP request, put your Website URL or Your Computer IP
792   http.addHeader("Content-Type", "application/x-www-form-urlencoded");    //Specify content-type header
793   
794   int httpCode = http.POST(postData);   //Send the request
795   String payload = http.getString();    //Get the response payload
796  
797   if (payload.substring(0, 6) == "add-id") {
798     String add_id = payload.substring(6);
799     Serial.println(add_id);
800     id = add_id.toInt();
801     getFingerprintEnroll();
802   }
803   http.end();  //Close connection
804 }
805 //******************Enroll a Finpgerprint ID*****************
806 uint8_t getFingerprintEnroll() {
807  
808   int p = -1;
809   display.clearDisplay();
810   display.drawBitmap( 34, 0, FinPr_scan_bits, FinPr_scan_width, FinPr_scan_height, WHITE);
811   display.display();
812   while (p != FINGERPRINT_OK) {
813     p = finger.getImage();
814     switch (p) {
815     case FINGERPRINT_OK:
816       //Serial.println("Image taken");
817       display.clearDisplay();
818       display.drawBitmap( 34, 0, FinPr_valid_bits, FinPr_valid_width, FinPr_valid_height, WHITE);
819       display.display();
820       break;
821     case FINGERPRINT_NOFINGER:
822       //Serial.println(".");
823       display.setTextSize(1);             // Normal 2:2 pixel scale
824       display.setTextColor(WHITE);        // Draw white text
825       display.setCursor(0,0);             // Start at top-left corner
826       display.print(F("scanning"));
827       display.display();
828       break;
829     case FINGERPRINT_PACKETRECIEVEERR:
830       display.clearDisplay();
831       display.drawBitmap( 34, 0, FinPr_invalid_bits, FinPr_invalid_width, FinPr_invalid_height, WHITE);
832       display.display();
833       break;
834     case FINGERPRINT_IMAGEFAIL:
835       Serial.println("Imaging error");
836       break;
837     default:
838       Serial.println("Unknown error");
839       break;
840     }
841   }
842  
843   // OK success!
844  
845   p = finger.image2Tz(1);
846   switch (p) {
847     case FINGERPRINT_OK:
848       display.clearDisplay();
849       display.drawBitmap( 34, 0, FinPr_valid_bits, FinPr_valid_width, FinPr_valid_height, WHITE);
850       display.display();
851       break;
852     case FINGERPRINT_IMAGEMESS:
853       display.clearDisplay();
854       display.drawBitmap( 34, 0, FinPr_invalid_bits, FinPr_invalid_width, FinPr_invalid_height, WHITE);
855       display.display();
856       return p;
857     case FINGERPRINT_PACKETRECIEVEERR:
858       Serial.println("Communication error");
859       return p;
860     case FINGERPRINT_FEATUREFAIL:
861       Serial.println("Could not find fingerprint features");
862       return p;
863     case FINGERPRINT_INVALIDIMAGE:
864       Serial.println("Could not find fingerprint features");
865       return p;
866     default:
867       Serial.println("Unknown error");
868       return p;
869   }
870   display.clearDisplay();
871   display.setTextSize(2);             // Normal 2:2 pixel scale
872   display.setTextColor(WHITE);        // Draw white text
873   display.setCursor(0,0);             // Start at top-left corner
874   display.print(F("Remove"));
875   display.setCursor(0,20);
876   display.print(F("finger"));
877   display.display();
878   //Serial.println("Remove finger");
879   delay(2000);
880   p = 0;
881   while (p != FINGERPRINT_NOFINGER) {
882     p = finger.getImage();
883   }
884   Serial.print("ID "); Serial.println(id);
885   p = -1;
886   display.clearDisplay();
887   display.drawBitmap( 34, 0, FinPr_scan_bits, FinPr_scan_width, FinPr_scan_height, WHITE);
888   display.display();
889   while (p != FINGERPRINT_OK) {
890     p = finger.getImage();
891     switch (p) {
892     case FINGERPRINT_OK:
893       //Serial.println("Image taken");
894       display.clearDisplay();
895       display.drawBitmap( 34, 0, FinPr_valid_bits, FinPr_valid_width, FinPr_valid_height, WHITE);
896       display.display();
897       break;
898     case FINGERPRINT_NOFINGER:
899       //Serial.println(".");
900       display.setTextSize(1);             // Normal 2:2 pixel scale
901       display.setTextColor(WHITE);        // Draw white text
902       display.setCursor(0,0);             // Start at top-left corner
903       display.print(F("scanning"));
904       display.display();
905       break;
906     case FINGERPRINT_PACKETRECIEVEERR:
907       Serial.println("Communication error");
908       break;
909     case FINGERPRINT_IMAGEFAIL:
910       Serial.println("Imaging error");
911       break;
912     default:
913       Serial.println("Unknown error");
914       break;
915     }
916   }
917  
918   // OK success!
919  
920   p = finger.image2Tz(2);
921   switch (p) {
922     case FINGERPRINT_OK:
923       //Serial.println("Image converted");
924       display.clearDisplay();
925       display.drawBitmap( 34, 0, FinPr_valid_bits, FinPr_valid_width, FinPr_valid_height, WHITE);
926       display.display();
927       break;
928     case FINGERPRINT_IMAGEMESS:
929       Serial.println("Image too messy");
930       return p;
931     case FINGERPRINT_PACKETRECIEVEERR:
932       Serial.println("Communication error");
933       return p;
934     case FINGERPRINT_FEATUREFAIL:
935       Serial.println("Could not find fingerprint features");
936       return p;
937     case FINGERPRINT_INVALIDIMAGE:
938       Serial.println("Could not find fingerprint features");
939       return p;
940     default:
941       Serial.println("Unknown error");
942       return p;
943   }
944   
945   // OK converted!
946   Serial.print("Creating model for #");  Serial.println(id);
947   
948   p = finger.createModel();
949   if (p == FINGERPRINT_OK) {
950     //Serial.println("Prints matched!");
951     display.clearDisplay();
952     display.drawBitmap( 34, 0, FinPr_valid_bits, FinPr_valid_width, FinPr_valid_height, WHITE);
953     display.display();
954   } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
955     Serial.println("Communication error");
956     return p;
957   } else if (p == FINGERPRINT_ENROLLMISMATCH) {
958     Serial.println("Fingerprints did not match");
959     return p;
960   } else {
961     Serial.println("Unknown error");
962     return p;
963   }  
964   
965   Serial.print("ID "); Serial.println(id);
966   p = finger.storeModel(id);
967   if (p == FINGERPRINT_OK) {
968     //Serial.println("Stored!");
969     display.clearDisplay();
970     display.drawBitmap( 34, 0, FinPr_valid_bits, FinPr_valid_width, FinPr_valid_height, WHITE);
971     display.display();
972     confirmAdding();
973   } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
974     Serial.println("Communication error");
975     return p;
976   } else if (p == FINGERPRINT_BADLOCATION) {
977     Serial.println("Could not store in that location");
978     return p;
979   } else if (p == FINGERPRINT_FLASHERR) {
980     Serial.println("Error writing to flash");
981     return p;
982   } else {
983     Serial.println("Unknown error");
984     return p;
985   }  
986 }
987 //******************Check if there a Fingerprint ID to add******************
988 void confirmAdding(){
989  
990   HTTPClient http;    //Declare object of class HTTPClient
991   //Post Data
992   postData = "confirm_id=" + String(id); // Add the Fingerprint ID to the Post array in order to send it
993   // Post methode
994  
995   http.begin(link); //initiate HTTP request, put your Website URL or Your Computer IP
996   http.addHeader("Content-Type", "application/x-www-form-urlencoded");    //Specify content-type header
997   
998   int httpCode = http.POST(postData);   //Send the request
999   String payload = http.getString();    //Get the response payload
1000  
1001   display.clearDisplay();
1002   display.setTextSize(1.5);             // Normal 1:1 pixel scale
1003   display.setTextColor(WHITE);        // Draw white text
1004   display.setCursor(0,0);             // Start at top-left corner
1005   display.print(payload);
1006   display.display();
1007   delay(1000);
1008   Serial.println(payload);
1009   
1010   http.end();  //Close connection
1011 }
1012 //********************connect to the WiFi******************
1013 void connectToWiFi(){
1014     WiFi.mode(WIFI_OFF);        //Prevents reconnection issue (taking too long to connect)
1015     delay(1000);
1016     WiFi.mode(WIFI_STA);
1017     Serial.print("Connecting to ");
1018     Serial.println(ssid);
1019     WiFi.begin(ssid, password);
1020  
1021     display.clearDisplay();
1022     display.setTextSize(1);             // Normal 1:1 pixel scale
1023     display.setTextColor(WHITE);        // Draw white text
1024     display.setCursor(0, 0);             // Start at top-left corner
1025     display.print(F("Connecting to \n"));
1026     display.setCursor(0, 50);  
1027     display.setTextSize(2);          
1028     display.print(ssid);
1029     display.drawBitmap( 73, 10, Wifi_start_bits, Wifi_start_width, Wifi_start_height, WHITE);
1030     display.display();
1031     
1032     while (WiFi.status() != WL_CONNECTED) {
1033       delay(500);
1034       Serial.print(".");
1035     }
1036     Serial.println("");
1037     Serial.println("Connected");
1038     
1039     display.clearDisplay();
1040     display.setTextSize(2);             // Normal 1:1 pixel scale
1041     display.setTextColor(WHITE);        // Draw white text
1042     display.setCursor(8, 0);             // Start at top-left corner
1043     display.print(F("Connected \n"));
1044     display.drawBitmap( 33, 15, Wifi_connected_bits, Wifi_connected_width, Wifi_connected_height, WHITE);
1045     display.display();
1046     
1047     Serial.print("IP address: ");
1048     Serial.println(WiFi.localIP());  //IP address assigned to your ESP
1049  
1050 }
Results
Once the Code is uploaded the NodeMCU will boot up with the Adafruit logo.

And then it will try the connection to the wifi. Once it gets Connected it will

display Connected. This log can be viewed on Serial Monitor as well as in

OLED Display

So now you can start registering the user using the website. The whole process

of registration is explained in the video below. You can follow the video for the

registration process. The user fingerprint is taken twice and stored in the

EEPROM of the Fingerprint Sensor. It is to be noted that only 127 fingerprints

can be stored in this R305/R307 module.


So once the fingerprint of multiple users is stored, you can start scanning and

registering the attendance. In case the fingerprint is not matched it will display

an error message as shown in the figure below.

When a registered user scans his finger for the first time it will display the

welcome message.
When a registered user scans his finger for the second time it will display the

Good-Bye message.

Finally you can see the entire data of the users on the website as shown below:
For understanding the whole process: how to add, update and remove the

users from the database follow the video tutorial below.

Video Tutorial & Explanation


IoT Based Biometric Fingerprint Attendance System with NodeMCU ESP8266

Watch this video on YouTube.

You can also follow the advanced version of the Biometric Attendance System

project called as Face Recognition Attendance System project designed

using ESP32 Camera Module.

You might also like