Biometric Attendance System With Automatic Voice Messages Using Arduino Report
Biometric Attendance System With Automatic Voice Messages Using Arduino Report
By
AMSHUMAN G 18BEC1075
J KIRON 18BEC1150
B VISWESHWARAN 18BEC1152
BONAFIDE CERTIFICATE
Certified that this project report entitled “Biometric Attendance System with
Automatic Voice Messages using Arduino” is a bonafide work of
AMSHUMAN G (18BEC1075), MAHESH JAYARAMAN (18BEC1143), J
KIRON (18BEC1150) and B VISWESHWARAN (18BEC1152) who carried
out the Project work under my supervision and guidance for ECE4003:
Embedded System Design.
Prof. B. CHANTHINI
Associate Professor
ABSTRACT
ACKNOWLEDGEMENT
We wish to express our sincere thanks and deep sense of gratitude to our project
guide, Prof. B. Chanthini, Associate Professor, School of Electronics
Engineering, for her consistent encouragement and valuable guidance offered to
us in a pleasant manner throughout the course of the project work.
We express our thanks to our Head of the Department Dr. Vetrivelan. P for his
support throughout the course of this project. We also take this opportunity to
thank all the faculty of the school for their support and their wisdom imparted to
us throughout the course.
We thank our parents, family, and friends for bearing with us throughout the
course of our project and for the opportunity they provided us in undergoing this
course in such a prestigious institution.
TABLE OF CONTENTS
1 INTRODUCTION 6
2 DESIGN 7-14
2.1 BLOCK DIAGRAM 7
2.2 CIRCUIT DIAGRAM 8
2.3 HARDWARE ANALYSIS 8-14
CHAPTER 1
INTRODUCTION
CHAPTER 2
DESIGN
The three main features of the basic block diagram (given below) are
- Arduino UNO
- 16x2 LCD
- Fingerprint module
- Speaker
Each of the above units may consist of the sensory units, communication
modules, etc.
The circuit diagram of the system has been depicted in Figure 2. It was designed
using Proteus.
Pin Configuration
LED pin: D13 Inbuilt LED which glows when the digita pin
becomes high
Fingerprint sensor module captures finger’s print image and then converts it into
the equivalent template and saves them into its memory as per selected ID by
Arduino. All the process is commanded by Arduino like taking an image of
finger’s print, convert it into templates and storing as ID etc. can check some
more projects using fingerprint module.
Pin Configuration
Pin
Name
No. Function
RS (Register
4 Selects command register when low, and data register when high
Select )
5 Low to write to the register; High to read from the register Read/write
Sends data to data pins when a high to low pulse is given; Extra voltage
push is required to execute the instruction and EN(enable) signal is
6 used for this purpose. Usually, we make it en=0 and when we want to Enable
execute the instruction we make it high en=1 for some milliseconds.
After this we again make it ground that is, en=0.
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-
Table 2: Pin configuration of LCD
13
Real Time Clock modules are simple TIME and DATE remembering systems.
They have battery setup which in the absence of external power keeps the
module running. This keeps the TIME and DATE up to date.
2.3.5 Buzzer
The buzzer produces the same noise sound irrespective of the voltage variation
applied to it. It consists of piezo crystals between two conductors, when a
potential is applied across these crystals, they push on one conductor and pull
on the other. This, push and pull action, results in a sound wave. Most buzzers
produce sound in the range of 2 to 4kHz.
2.3.6 Speaker
The ISD1820 recording module voice board is a way to add voice recording.
The module can be operated directly by using the 3 Push-Buttons or with every
microcontroller.
CHAPTER 3
IMPLEMENTATION & RESULTS
The software used to complete the project is Arduino IDE, Proteus Simulator and
EasyEDA.
#include "Adafruit_Fingerprint.h"
uint8_t id;
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&fingerPrint);
#define enroll A0
#define del A1
#define up A2
#define down A3
#define indFinger 7
int Contrast = 60;
#define buzzer 9
#define records 4 // 5 for 5 user
int user1,user2,user3,user4,user5;
void setup()
{
delay(1000);
analogWrite(6, Contrast);
lcd.begin(16,2);
Serial.begin(9600);
pinMode(enroll, INPUT_PULLUP);
pinMode(up, INPUT_PULLUP);
pinMode(down, INPUT_PULLUP);
pinMode(del, INPUT_PULLUP);
pinMode(buzzer, OUTPUT);
pinMode(indFinger, OUTPUT);
16
digitalWrite(buzzer, LOW);
if(digitalRead(enroll) == 1)
{
digitalWrite(buzzer, HIGH);
delay(500);
digitalWrite(buzzer, LOW);
lcd.clear();
lcd.print("Please wait");
lcd.setCursor(0,1);
lcd.print("Downloading Data");
Serial.println("Please wait");
Serial.println("Downloding Data..");
Serial.println();
Serial.print("S.No. ");
for(int i=0;i<records;i++)
{
digitalWrite(buzzer, HIGH);
delay(500);
digitalWrite(buzzer, LOW);
Serial.print(" User ID");
Serial.print(i+1);
Serial.print(" ");
}
Serial.println();
int eepIndex=0;
for(int i=0;i<30;i++)
{
if(i+1<10)
Serial.print('0');
Serial.print(i+1);
Serial.print(" ");
eepIndex=(i*7);
download(eepIndex);
eepIndex=(i*7)+210;
download(eepIndex);
eepIndex=(i*7)+420;
download(eepIndex);
eepIndex=(i*7)+630;
download(eepIndex);
// eepIndex=(i*7)+840; // 5th user
// download(eepIndex);
Serial.println();
}
}
if(digitalRead(del) == 1)
{
lcd.clear();
lcd.print("Please Wait");
17
lcd.setCursor(0,1);
lcd.print("Reseting.....");
for(int i=1000;i<1005;i++)
EEPROM.write(i,0);
for(int i=0;i<841;i++)
EEPROM.write(i, 0xff);
lcd.clear();
lcd.print("System Reset");
delay(1000);
}
lcd.clear();
lcd.print(" Attendance ");
lcd.setCursor(0,1);
lcd.print(" System ");
delay(2000);
digitalWrite(buzzer, HIGH);
delay(500);
digitalWrite(buzzer, LOW);
for(int i=1000;i<1000+records;i++)
{
if(EEPROM.read(i) == 0xff)
EEPROM.write(i,0);
}
finger.begin(57600);
Serial.begin(9600);
lcd.clear();
lcd.print("Finding Module");
lcd.setCursor(0,1);
delay(1000);
if (finger.verifyPassword())
{
Serial.println("Found fingerprint sensor!");
lcd.clear();
lcd.print("Found Module ");
delay(1000);
}
else
{
Serial.println("Did not find fingerprint sensor :(");
lcd.clear();
lcd.print("module not Found");
lcd.setCursor(0,1);
lcd.print("Check Connections");
while (1);
}
if (! rtc.begin())
18
if (! rtc.isrunning())
{
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
// This line sets the RTC with an explicit date & time, for example to set
// January 21, 2014 at 3am you would call:
// rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
}
user1=EEPROM.read(1000);
user2=EEPROM.read(1001);
user3=EEPROM.read(1002);
user4=EEPROM.read(1003);
user5=EEPROM.read(1004);
lcd.clear();
digitalWrite(indFinger, HIGH);
void loop()
{
lcd.clear();
now = rtc.now();
//rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
//rtc.adjust(DateTime(now.unixtime()+10));
//rtc.adjust(DateTime(__DATE__, __TIME__));
//DateTime t = DateTime(rtc.now().unixtime()+7);
//rtc.adjust(t);
lcd.print("Time->");
lcd.print(now.hour(), DEC);
lcd.print(':');
lcd.print(now.minute(), DEC);
lcd.print(':');
lcd.print(now.second(), DEC);
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print("Date->");
lcd.print(now.day(), DEC);
lcd.print('/');
lcd.print(now.month(), DEC);
lcd.print('/');
lcd.print(now.year(), DEC);
lcd.print(" ");
delay(500);
int result=getFingerprintIDez();
19
if(result>0)
{
digitalWrite(indFinger, LOW);
digitalWrite(buzzer, HIGH);
delay(100);
digitalWrite(buzzer, LOW);
lcd.clear();
lcd.print("ID:");
lcd.print(result);
lcd.setCursor(0,1);
lcd.print("Please Wait....");
delay(1000);
attendance(result);
lcd.clear();
lcd.print("Attendance ");
lcd.setCursor(0,1);
lcd.print("Registered");
startPlayback(sample, sizeof(sample));
delay(1000);
digitalWrite(indFinger, HIGH);
return;
}
checkKeys();
delay(300);
}
// dmyyhms - 7 bytes
void attendance(int id)
{
int user=0,eepLoc=0;
if(id == 1)
{
eepLoc=0;
user=user1++;
}
else if(id == 2)
{
eepLoc=210;
user=user2++;
}
else if(id == 3)
{
eepLoc=420;
user=user3++;
}
else if(id == 4)
{
eepLoc=630;
20
user=user4++;
}
/*else if(id == 5) // fifth user
{
eepLoc=840;
user=user5++;
}*/
else
return;
int eepIndex=(user*7)+eepLoc;
EEPROM.write(eepIndex++, now.hour());
EEPROM.write(eepIndex++, now.minute());
EEPROM.write(eepIndex++, now.second());
EEPROM.write(eepIndex++, now.day());
EEPROM.write(eepIndex++, now.month());
EEPROM.write(eepIndex++, now.year()>>8 );
EEPROM.write(eepIndex++, now.year());
EEPROM.write(1000,user1);
EEPROM.write(1001,user2);
EEPROM.write(1002,user3);
EEPROM.write(1003,user4);
// EEPROM.write(4,user5); // figth user
}
void checkKeys()
{
if(digitalRead(enroll) == 0)
{
lcd.clear();
lcd.print("Please Wait");
delay(1000);
while(digitalRead(enroll) == 0);
Enroll();
}
else if(digitalRead(del) == 0)
{
lcd.clear();
lcd.print("Please Wait");
delay(1000);
delet();
}
}
void Enroll()
{
int count=1;
lcd.clear();
21
while(1)
{
lcd.setCursor(0,1);
lcd.print(count);
if(digitalRead(up) == 0)
{
count++;
if(count>records)
count=1;
delay(500);
}
else if(digitalRead(down) == 0)
{
count--;
if(count<1)
count=records;
delay(500);
}
else if(digitalRead(del) == 0)
{
id=count;
getFingerprintEnroll();
for(int i=0;i<records;i++)
{
if(EEPROM.read(i) != 0xff)
{
EEPROM.write(i, id);
break;
}
}
return;
}
else if(digitalRead(enroll) == 0)
{
return;
}
}
}
void delet()
{
int count=1;
lcd.clear();
lcd.print("Enter Finger ID");
while(1)
22
{
lcd.setCursor(0,1);
lcd.print(count);
if(digitalRead(up) == 0)
{
count++;
if(count>records)
count=1;
delay(500);
}
else if(digitalRead(down) == 0)
{
count--;
if(count<1)
count=records;
delay(500);
}
else if(digitalRead(del) == 0)
{
id=count;
deleteFingerprint(id);
for(int i=0;i<records;i++)
{
if(EEPROM.read(i) == id)
{
EEPROM.write(i, 0xff);
break;
}
}
return;
}
else if(digitalRead(enroll) == 0)
{
return;
}
}
}
uint8_t getFingerprintEnroll()
{
int p = -1;
lcd.clear();
lcd.print("finger ID:");
lcd.print(id);
lcd.setCursor(0,1);
lcd.print("Place Finger");
delay(2000);
while (p != FINGERPRINT_OK)
23
{
p = finger.getImage();
switch (p)
{
case FINGERPRINT_OK:
Serial.println("Image taken");
lcd.clear();
lcd.print("Image taken");
break;
case FINGERPRINT_NOFINGER:
Serial.println("No Finger");
lcd.clear();
lcd.print("No Finger");
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
lcd.clear();
lcd.print("Comm Error");
break;
case FINGERPRINT_IMAGEFAIL:
Serial.println("Imaging error");
lcd.clear();
lcd.print("Imaging Error");
break;
default:
Serial.println("Unknown error");
lcd.clear();
lcd.print("Unknown Error");
break;
}
}
// OK success!
p = finger.image2Tz(1);
switch (p) {
case FINGERPRINT_OK:
Serial.println("Image converted");
lcd.clear();
lcd.print("Image converted");
break;
case FINGERPRINT_IMAGEMESS:
Serial.println("Image too messy");
lcd.clear();
lcd.print("Image too messy");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
lcd.clear();
lcd.print("Comm Error");
24
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println("Could not find fingerprint features");
lcd.clear();
lcd.print("Feature Not Found");
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println("Could not find fingerprint features");
lcd.clear();
lcd.print("Feature Not Found");
return p;
default:
Serial.println("Unknown error");
lcd.clear();
lcd.print("Unknown Error");
return p;
}
Serial.println("Remove finger");
lcd.clear();
lcd.print("Remove Finger");
delay(2000);
p = 0;
while (p != FINGERPRINT_NOFINGER) {
p = finger.getImage();
}
Serial.print("ID "); Serial.println(id);
p = -1;
Serial.println("Place same finger again");
lcd.clear();
lcd.print("Place Finger");
lcd.setCursor(0,1);
lcd.print(" Again");
delay(1000);
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
Serial.println("Image taken");
break;
case FINGERPRINT_NOFINGER:
Serial.print(".");
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
break;
case FINGERPRINT_IMAGEFAIL:
Serial.println("Imaging error");
break;
default:
25
Serial.println("Unknown error");
return;
}
}
// OK success!
p = finger.image2Tz(2);
switch (p) {
case FINGERPRINT_OK:
Serial.println("Image converted");
break;
case FINGERPRINT_IMAGEMESS:
Serial.println("Image too messy");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println("Could not find fingerprint features");
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println("Could not find fingerprint features");
return p;
default:
Serial.println("Unknown error");
return p;
}
// OK converted!
Serial.print("Creating model for #"); Serial.println(id);
p = finger.createModel();
if (p == FINGERPRINT_OK) {
Serial.println("Prints matched!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Communication error");
return p;
} else if (p == FINGERPRINT_ENROLLMISMATCH) {
Serial.println("Fingerprints did not match");
return p;
} else {
Serial.println("Unknown error");
return p;
}
lcd.clear();
lcd.print("Stored!");
delay(2000);
lcd.clear();
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Communication error");
return p;
} else if (p == FINGERPRINT_BADLOCATION) {
Serial.println("Could not store in that location");
return p;
} else if (p == FINGERPRINT_FLASHERR) {
Serial.println("Error writing to flash");
return p;
}
else {
Serial.println("Unknown error");
return p;
}
}
int getFingerprintIDez()
{
uint8_t p = finger.getImage();
if (p != FINGERPRINT_OK)
return -1;
p = finger.image2Tz();
if (p != FINGERPRINT_OK)
return -1;
p = finger.fingerFastSearch();
if (p != FINGERPRINT_OK)
{
lcd.clear();
lcd.print("Finger Not Found");
lcd.setCursor(0,1);
lcd.print("Try Later");
delay(2000);
return -1;
}
// found a match!
Serial.print("Found ID #");
Serial.print(finger.fingerID);
return finger.fingerID;
}
lcd.clear();
lcd.print("Please wait");
p = finger.deleteModel(id);
if (p == FINGERPRINT_OK)
{
Serial.println("Deleted!");
lcd.clear();
lcd.print("Finger Deleted");
lcd.setCursor(0,1);
lcd.print("Successfully");
delay(1000);
}
else
{
Serial.print("Something Wrong");
lcd.clear();
lcd.print("Something Wrong");
lcd.setCursor(0,1);
lcd.print("Try Again Later");
delay(2000);
return p;
}
}
if(EEPROM.read(eepIndex) != 0xff)
{
Serial.print("T->");
if(EEPROM.read(eepIndex)<10)
Serial.print('0');
Serial.print(EEPROM.read(eepIndex++));
Serial.print(':');
if(EEPROM.read(eepIndex)<10)
Serial.print('0');
Serial.print(EEPROM.read(eepIndex++));
Serial.print(':');
if(EEPROM.read(eepIndex)<10)
Serial.print('0');
Serial.print(EEPROM.read(eepIndex++));
Serial.print(" D->");
if(EEPROM.read(eepIndex)<10)
Serial.print('0');
Serial.print(EEPROM.read(eepIndex++));
Serial.print('/');
if(EEPROM.read(eepIndex)<10)
Serial.print('0');
Serial.print(EEPROM.read(eepIndex++));
28
Serial.print('/');
Serial.print(EEPROM.read(eepIndex++)<<8 | EEPROM.read(eepIndex++));
}
else
{
Serial.print("---------------------------");
}
Serial.print(" ");
}
29
CHAPTER 4
CONCLUSION AND FUTURE WORK
4.1 Conclusion
1. The Infrared sensor can be used for mapping of the environment and detect
objects.
2. The sensor can be used for vehicles as parking sensors which can be used
for detecting walls and other vehicles.
3. The sensor can also be used as a radar of the environment to detect
movements and can also be placed in safe places of the pipelines to detect
any leaks in the pipeline.
4. Ships can use more accurate and bigger sensors to gain vision deep inside
the ocean. Enemy Submarines can also be detected using this sensor.
5. It can also be used as a home theft alert system as the two sensors can be
used to detect a person entering the room and vice -versa.
35
CHAPTER 5
REFERENCES