Chapter Four
Chapter Four
Chapter Four
The fingerprint capturing system has a power supply section that is designed to operate
on a 3.7V battery. The system operates with a 5V supply. The fingerprint sensor and the esp32
module have an operating voltage of 5V. The power supply section has the following output
1. Output Voltage- 5V
2. Output Current- 2A
The power supply section is designed to operate on a 3.7V supply voltage from the battery, this
battery voltage is boosted to 5V to meet the voltage requirement of the microcontroller and
fingerprint module using the MT3608 boost DC-DC converter. The MT3608 DC-DC boost
converter is a user adjustable step up DC-DC converter module and it input voltage can vary
between 2V to 24VDC, while it output voltage is adjustable between 5VDC to 28VDC. In this
project the output voltage has been set to 5VDC with the input voltage of 3.7V which is the
battery voltage
The MT3608 module is using very less amount of components and the main component of the
module is MT3608 IC. MT3608 is a highly efficient voltage booster IC with many built in
features like over heat protection, low quiescent current, soft start function, low external
components, overheat shutdown etc. Other components used in this module are two ceramic
capacitors, one variable resistor, one resistor and one schottky diode and a 22uH inductor which
prevent a failure or shutdown of the system due to low battery voltage. The charging of the
battery is achieved using a charging module namely TP4056. The TP4056 is 1A Standalone
Linear Li-lon Battery Charger with Thermal Regulation and two LED Indication in case SOIC-
single cell lithium-ion (Li-Ion) batteries. It has the following output specifications
2. Output current – 1A
The fingerprint Capturing system incorporates a fingerprint module that captures the fingerprint
image when a finger is placed on it, the fingerprint image is captured and converted to a binary
file containing a stream of 1’s and 0’s which is sent over the internet to an email. The resultant
binary file is converted to a bitmap image using a python script. Figure 4.1 and 4.2 respectively
shows the fingerprint capturing process when a fingerprint image is placed on the sensor and the
The fingerprint capturing system incorporates a power supply section which has a battery and a
DC-DC boost converter module. The specification of the battery used are given below
The DC-DC boost converter module MT3608 has the following input specification
1. Input Voltage- 2VDC- 24VDC
The system incorporates a battery charging module to keep the battery charged so as to ensure
that the system does not shutdown. The battery charging module used is TP4056 which has the
The system can be charged using a regular phone battery charger. It has a LED indicator to
indicate state of charge of the battery; when the battery is charging, a red LED is lit and when the
battery is fully charged, a green led is lit which indicates that the battery is fully charged. The
Lithium-ion battery charging and discharging module which supports a constant current –
Over-discharge protection feature which prevents the battery from being discharged
below 2.4V by cutting off output power until the battery is recharged above 3V.
The 5V input voltage is applied through micro USB or solder pads IN+ and IN-.
from the battery. This happens in a case when the discharge rate becomes greater than
3A.
The TP4056 charging module as shown in the figure below has six terminals which are as
described below:
Pin#1 OUT+
This is the output pin which supplies the positive voltage of a battery. It is connected to the
circuit which needs power from a battery, in this case, it is connected to the MT3608 positive
input terminal.
Pin#2 B+
Connect the Positive terminal of lithium battery with this pin using a battery connector.
Pin#3 B-
Connect the Negative terminal of lithium battery with this pin using a battery connector.
Pin#4 OUT-
This the output pin which supplies the negative voltage of the battery. It is connected to the
circuit which needs power from a battery, in this case it is connected to MT3608 negative input.
when you don’t have a USB cable. Otherwise, you can directly charge from USB supply by
The fingerprint module FPM10A used for this project has the following technical specifications:
13. The communication baud rate (UART): (9600 x N) BPS where N=1 ~ 12 (the default
The project file contains all the necessary file needed for the device operation and the
ESP32
Image_2_buffer.ino
Getimage
Getimage.py
Image.bin
Image.bmp
The charging section design is achieved using a TP4056 charging module which provides the
The power supply section is achieved using a DC-DC step up converter module namely MT3608
which converts the batter voltage of 3.7V- 4.2VDC to a sufficiently high voltage of 5VDC for
The fingerprint module is connected to the ESP32 module through the UART interface at a baud
rate of 57600 and a voltage level of 3.3V- 3.7V. The RX of the fingerprint module FPM10A is
connected to the TX pin of the ESP32 and the TX pin of the fingerprint module is connected to
the RX pin of the ESP32 module and the connection is as shown in the figure 3.
If the pins are not properly connected, communication between the two modules will not be
possible.
This project makes use of an ESP32 module which serves as the central processing unit of the
project. ESP32 is a low-powered, low-cost microcontroller (MCU) board, with both Wi-Fi and
ESP32 module used for this project was programmed using the Arduino C in the Arduino
In order to run a program on the ESP32 Development Board, we will need to write our
program into the flash memory of the development board. Since it is easy to write code
and flash programs with Arduino IDE , it is a good tool to use with the ESP32
A big advantage of ESP32 is that it is readily supported by Arduino IDE as a “shield” which can
be accessed from Board Manager. One can easily use functions from the FreeRTOS libraries
Arduino software uses Arduino Programming language which is C based to write the code. Since
the programming language is C based, the difficulty of writing the program in assembly
language is removed. As the software coverts the C based program into assembly code internally
and then uploads it to the board. Along with the code editor, the software also consists of a
programming language to convert the binary image file sent over the internet to the email to a
Python provides many useful features which make it popular and valuable from the other
approaches and provides dynamic memory allocation. Listed below are a few essential features
to support the use of python for the binary file conversion to bitmap
straightforward and much the same as the English language. There is no use of the semicolon or
curly-bracket, the indentation defines the code block. It is the recommended programming
2) Expressive Language
Python can perform complex tasks using a few lines of code. A simple example, the hello world
program you simply type print("Hello World"). It will take only one line to execute, while Java
3) Interpreted Language
Python is an interpreted language; it means the Python program is executed one line at a time.
The advantage of being interpreted language, it makes debugging easy and portable.
4) Cross-platform Language
Python can run equally on different platforms such as Windows, Linux, UNIX, and Macintosh,
etc. So, we can say that Python is a portable language. It enables programmers to develop the
website www.python.org. It has a large community across the world that is dedicatedly working
towards make new python modules and functions. Anyone can contribute to the Python
community. The open-source means, "Anyone can download its source code without paying any
penny."
6) Object-Oriented Language
Python supports object-oriented language and concepts of classes and objects come into
procedure helps to programmer to write reusable code and develop applications in less code.
7) Extensible
It implies that other languages such as C/C++ can be used to compile the code and thus it can be
used further in our Python code. It converts the program into byte code, and any platform can use
It provides a vast range of libraries for the various fields such as machine learning, web
developer, and also for the scripting. There are various machine learning libraries, such as
Tensor flow, Pandas, Numpy, Keras, and Pytorch, etc. Django, flask, pyramids are the popular
The minimum system requirements to run the project software are given below:
1. Windows 7 or higher
2. 4gb Ram
3. 1.6ghz speed
5.1 SUMMARY
In today's life use of the vehicle is an important part of life and along with its safety concerns are
also very important. To increase the safety of vehicle different type of security systems are
available in the market out of which the most common are beepers, fire alarms, security cameras,
and personal safety products, but, the issue with this is that automobiles loaded with all the above
facilities comes with a high price. To overcome this problem in this work Biometric system is
used as security for vehicles. Biometric System is the combination of two different technologies
which are Embedded systems and biometrics. Fingerprint proves one of the best recognition
systems. The security system implemented using ESP32 and fingerprint module is presented in
this project and this can be incorporated in any vehicle irrespective of model. The project
provides the user or car owner with real-time information on intruders trying to access the
vehicle irrespective of the user’s location by capturing the intruder’s fingerprint and sending it
over email. All records of the captured fingerprint can be retrieved from the user’s email and in
the event of a car. The fingerprint captured can be used by security agencies to locate the
2. The fingerprint sensor should cleaned with a neat and dust free fabric
3. The device should be handled with care to avoid damage to the internal circuitry
4. The device should be switched off when not in use to avoid draining of the battery.
5.3 SUGGESTED AREAS FOR FURTHER STUDIES
This project has proposed a security system for vehicles using fingerprint capturing
system, which captures and send the fingerprint of any intruder to the user’s email and the
fingerprint image can further be used for security reasons in the case of a car theft. This system
1. GSM Module to also alert the user by SMS whenever a fingerprint is detected, for
additional safety so that if an unauthorized person tries to access the vehicle, SMS is sent
2. The present module can be extended to include a GPS module for additional safety so
that if a vehicle is stolen, by GPS module we can track the location of the vehicle
3. A camera module can also be used with this security device to take a picture of the
The user should take note of the following in order to use the device:
1. Set Up the dedicated on your phone or your handheld device with following details
Fingerprintproject@yahoo.com
Password: Fingerprint22
After the fingerprint is successfully captured, the green LED goes off.
If the fingerprint is not successfully captured, the green LED flickers five times
The green LED comes on again after about 5 seconds indicating the image is
Once the image is sent to the mail successfully, the green LED goes off.
APPENDIX
//#include "Arduino.h"
#include <HardwareSerial.h>
#include <FPM.h>
#include "ESP32_MailClient.h"
#include <FS.h>
#include <SPIFFS.h>
#include <WiFi.h>
//#include <ESP_Mail_Client.h>
/* select UART1 */
/*
* Insert your network credentials in the following variables:
*/
int LED = 4;
const char* ssid = "MTN_4G_0A77A4";
const char* password = "75818080";
/*
* Type the email sender account on the emailSenderAccount variable and
* its password on the emailSenderPassword variable.
*/
#define emailSenderAccount "fingerprintproject@yahoo.com"
#define emailSenderPassword "dfcepkzyvhcwhjho"
/*
* wfikbgxqlhcysfnp
* Insert the recipient’s email. This is the email that will receive the emails sent by the ESP32:
*/
HardwareSerial fserial(1);
FPM finger(&fserial);
FPM_System_Params params;
void setup(void) {
// Connect to Wi-Fi
Serial.begin(57600);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
Serial.print("Connecting to WiFi...");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
/*
* Initialize SPIFFS (SPI Flash File System) to save the file
*/
if (!SPIFFS.begin(true)) {
Serial.println("An Error has occurred while mounting SPIFFS");
ESP.restart();
}
else {
delay(500);
Serial.println("SPIFFS mounted successfully");
}
void loop() {
stream_image();
yield();
}
#define IMAGE_SZ 36864UL
uint8_t image_buffer[IMAGE_SZ];
void stream_image(void) {
if (!set_packet_len_128()) {
Serial.println("Could not set packet length");
return;
}
delay(100);
int16_t p = -1;
Serial.println("Waiting for a finger...");
digitalWrite(LED,HIGH);
while (p != FPM_OK) {
p = finger.getImage();
switch (p) {
case FPM_OK:
Serial.println("Image taken");
digitalWrite (LED, LOW);
break;
case FPM_NOFINGER:
break;
case FPM_PACKETRECIEVEERR:
Serial.println("Communication error");
break;
case FPM_IMAGEFAIL:
Serial.println("Imaging error");
break;
default:
Serial.println("Unknown error");
break;
}
yield();
}
p = finger.downImage();
switch (p) {
case FPM_OK:
Serial.println("Starting image stream...");
break;
case FPM_PACKETRECIEVEERR:
Serial.println("Communication error");
return;
case FPM_UPLOADFAIL:
Serial.println("Cannot transfer the image");
return;
}
/* flag to know when we're done */
bool read_finished;
/* indicate the max size to read, and also returns how much was actually read */
uint16_t readlen = IMAGE_SZ;
uint16_t pos = 0;
int16_t count = 0;
while (true) {
bool ret = finger.readRaw(FPM_OUTPUT_TO_BUFFER, image_buffer + pos, &read_finished,
&readlen);
if (ret) {
count++;
pos += readlen;
readlen = IMAGE_SZ - pos;
if (read_finished){
digitalWrite(LED, HIGH);
storeInSPIFFS(image_buffer, IMAGE_SZ);
sendemail();
delay(1000);
digitalWrite (LED, LOW);
delay(1000);
break;
}
}
else {
Serial.print("\r\nError receiving packet ");
Serial.println(count);
return;
}
yield();
}
Serial.println();
Serial.print(count * FPM::packet_lengths[params.packet_len]); Serial.println(" bytes read.");
Serial.println("Image stream complete.");
}
return (p == FPM_OK);
}
//Check if the file was successfully created. If not, print an error message.
if (!file) {
Serial.println("Failed to open file in writing mode");
}
else{
Serial.println("file opened");
Serial.printf("Start Position = %u \n", file.position()); // Prints what position in the file we're in
Serial.print(F("SizePayload: "));
Serial.println(length);
}
// for (int i = 0; i < length; i++) { // for debug purposes check the content of the payload
// Serial.print((byte)payload[i]); // DEBUG
// Serial.print(":"); // DEBUG
// } // DEBUG
Serial.println(""); // DEBUG
file.write(payload, length);
file.close();
}
smtpData.setSender("ESP32", emailSenderAccount);
smtpData.setPriority("High");
smtpData.setSubject(emailSubject);
//set the recipient email. This is the email that will receive the messages from the ESP32.
smtpData.addRecipient(emailRecipient);
//Then, to attach a file, you just need to call the addAtatachFile() on the smtpData object and pass as argument
the file path.
smtpData.addAttachFile(FILE_IMAGE, "image/bin");
//Finally, you need to set where your files are saved (SPIFFS or SD card). We’re using SPIFFS:
smtpData.setFileStorageType(MailClientStorageType::SPIFFS);
//Set a callback function that will be called upon sending an email.
smtpData.setSendCallback(sendCallback);
//The sendCallback() function returns whether the email was successfully sent or not.
if (!MailClient.sendMail(smtpData))
Serial.println("Error sending Email, " + MailClient.smtpErrorReason());
//clear all the data from the smtpData object.
smtpData.empty();
}
void sendCallback(SendStatus msg) {
Serial.println(msg.info());
if (msg.success()) {
Serial.println("----------------");
SPIFFS.remove(FILE_IMAGE);
}
}
void ledBLINK(void)
{
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED,LOW);
delay(1000);
}
A python Script was written to convert the binary file to a bitmap image showing the fingerprint image in black
and white
WIDTH = 256
HEIGHT = 288
READ_LEN = int(WIDTH * HEIGHT / 2)
DEPTH = 8
HEADER_SZ = 54
def options():
print("Options:")
print("\tPress 1 to extract and save the fingerprint image as bmp file")
print("\tPress 2 to view help")
print("\tPress 3 to exit")
print()
choice = input(">> ")
print()
return choice
def getPrint():
'''
enter the filename of the image with menu option 2:
>>> Enter filename/path of output file (without extension): myprints
.
.
.
.
.
.
Extracting image...saved as <filename>.bmp
'''
out = open(input("Enter filename/path of output file (without extension): ")+'.bmp', 'wb')
# assemble and write the BMP header to the file
out.write(assembleHeader(WIDTH, HEIGHT, DEPTH, True))
for i in range(256):
# write the colour palette
out.write(i.to_bytes(1,byteorder='little') * 4)
while True:
byte= file.read(1)
if not byte:
#print("Timeout!")
break
# make each nibble a high nibble
out.write((byte[0] & 0xf0).to_bytes(1, byteorder='little'))
out.write(((byte[0] & 0x0f) << 4).to_bytes(1, byteorder='little'))
while True:
chose = options()
if chose == "3":
break
elif chose == "1":
getPrint()
elif chose == "2":
print('================= HELP ==================')
print(getPrint.__doc__)
print('=========================================')