Sie sind auf Seite 1von 31

Project Report

On
RFID Based Attendance Management System

Report submitted in partial fulfilmentof the requirements


for the Degree of
Bachelor of Technology

Enrolment No. : 14102137


Name of student : Vikas Singh
Name of supervisor : Mrs. Reema Buddhiraja

DEPARTMENT OF ELECTONICS AND COMMUNICATION


JAYPEE INSTITUTE OF INFORMATION TECHNOLOGY,
SECTOR-62, NOIDA, INDIA

1
CERTIFICATE

This is to certify that RFID Based Attendance Management System submitted by VIKAS
SINGH (14102137) in partial fulfilment for the award of degree of B.tech of Jaypee Institute of
Information Technology, Noida Sec-62 has been carried out under my supervision. This work
has not been submitted partially or wholly to any other University or Institute for the award of
this or any other degree or diploma.

Head of Department Prof. RC JAIN

Signature of Supervisor ..

Name of Supervisor Mrs. REEMA BUDDHIRAJA

Designation Assistant Professor (Grade-II)

Date ..

2
ACKNOWLEDGEMENT

I have taken efforts in this project. However, it would not have been possible without the kind
support and help of many individuals and the institute. I would like to extend my sincere thanks
to all of them.

I am highly thankful to my supervisor Mrs. REEMA BUDDHIRAJA for her guidance, constant
supervision and for providing necessary information regarding the project and for conducting
weekly project meetings which kept me going. I would like to express our gratitude towards my
parents & faculty members of the institute for their kind co-operation and encouragement which
helped me in completion of this project.

My thanks and appreciations also go to my friends in developing the project and people who
have willingly helped me out with their abilities.

Signature of the student ..

Name of Student: VIKAS SINGH (14102137)

Date ..

3
TABLE OF CONTENTS

TOPIC PAGE

1. ABSTRACT..............................................................................3
2. OBJECTIVE ............................................................................4
3. INTRODUCTION OF RFID......................................................4
4. LIST& DESCRIPTION OF COMPONENTS.............................5

5. LIST &DESCRIPTION OF SOFTWARES................................9


6. DESIGN...................................................................................1
6.1 Block Diagram
6.2 Circuit Design

7. IMPLEMENTATION.....................................................................17
7.1 Function of the Project
7.2 Complete Code for ATmega328P-PU
7.3 Interfacing Microcontroller with PC
7.4 Database Management using Gobetwino 0.5
7.5 Working

8. APPLICATIONS, LIMITATIONS & FUTURE SCOPE


9. CONCLUSION

4
1. ABSTRACT

In recent years, there have been rise in the number of applications based on Radio Frequency
Identification (RFID) systems and have been successfully applied to different areas as diverse
as transportation, health-care, agriculture, and hospitality industry to name a few. RFID
technology facilitates automatic wireless identification using electronic passive and active tags
with suitable readers.

Radiofrequency identification (RFID) is a technology that uses communication via


electromagnetic waves to exchange data between a terminal and an electronic tag attached to
an object, for the purpose of identification and tracking. Some tags can be read from several
meters away and beyond the line of sight of the reader.

Radio-frequency identification involves interrogators (also known as readers), and tags (also
known as labels). Most RFID tags contain at least two parts. One is an integrated circuit for
storing and processing information, modulating and demodulating a radio frequency (RF)
signal, and other specialized functions. The other is an antenna for receiving and transmitting
the signal.

In all aspects of our life, we encounter event recording applications very often. Recording of any
entity be it sound, pictures, events etc. is very useful as it enables us to manipulate data to our
requirements. One can exploit the full potential of the recorded information for specific user
defined purposes. Keeping in mind the significance of event recorders in todays world, we
arrived at a common decision of making Attendance Management System using RFID.

5
2. OBJECTIVE

In this Project, we develop a RFID Based Attendance Management System for daily employee
attendance in companies. Employees proper attendance management is till date a critical issue
in many companies. Attendance plays a vital role in managing salaries of employees and also
intracking the regularity & sincerity of employees towards their occupation. The process
of tracking attendance manually using pen and paper has become an out dated approach. Itnot
only involves fake entries by employees but even sometimes lead to improper evaluation of
attendance. There always exist a threat of records/register getting misplaced or may get
damage due to unfavorable circumstances. To overcome all these drawbacks and many more
than that we intend to develop a system which not only removes the tedious task of tracking
attendance manually but also helps in maintaining a system which will help an organization in
proper & appropriate evaluation of salary, regularity & even punctuality of an employee based
on attendance.

The purpose of developing attendance management system is to computerized the tradition


way of taking attendance. The attendance of the employee will be taken by RFID tags and will
automatically get stored in the database.The system records details such as arrival and
departure of employees besides maintaining information regarding their personal and official
profiles. Official employee information such as designation, department, shift, location, leaves
status, compensation, etc. can be linked to any payroll software to automate the complete
process.

3. INTRODUCTION OF RFID

6
History
Charles Walton, the man behind the radio frequency identification technology (RFID).Since his
first patent aboutit in 1973, Walton, collected about $3 million from royalties coming from his
patents. Unfortunately for him, his latest patent about RFID expired in the mid-1990s.So he will
not make any money from the billions of RFID tags that will appear in the yearsto come. But he
continues to invent and his latest patent about a proximity card within corporate PIN code
protection was granted in June 2004.

What is RFID?
RFID is short for Radio Frequency Identification. Generally a RFID system consists of 2 parts
viz a reader, and one or more Transponders, also known as tags. RFID systems evolved from
barcode labels as a means to automatically identify and track products and people.

RFID is short for Radio Frequency Identification. Generally, a RFID system consists of 2 parts
viz a reader, and one or more Transponders, also known as tags. RFID systems evolved from
barcode labels as a means to automatically identify and track products and people. You will be
familiar with RFID systems generally seen in:

Access Control
RFID Readers placed at entrances that require a person to pass their proximity card(RF tag) to
be read before the access can be made.

Contactless Payment System


RFID tags used to carry payment information. RFIDs are particular suited toelectronic Toll
connection systems. Tags attached to vehicles, or carried by people transmit payment
information to a fixed reader attached to a Toll station. Payments are then routinely deducted
from a users account, or information is changed directly on the RFID tag.

Product Tracking and Inventory Control


RFID systems are commonly used to track and record the movement of ordinaryitems such as
library books, clothes, factory pallets, electrical goods and numerous items.

How RFID works?


A basic RFID system consists of three components: antenna, transceiver, transponder (RF tag)

In every RFID system, the transponder tags containinformation. This information can be as little
as a single binary bit, or be a large array of bits representing such things as an identity code,
personal medical information, or literally any type of information that can be stored in digital
binary format.

7
Shown is a RFID transceiver that communicates with a passive Tag. Passive tags have
nopower source of their own and instead they derive power from the incident
electromagneticfield. Commonly the heart of each tag is a microchip.When the tag enters the
generated RF field it is able to draw enough power from the field toaccess its internal memory
and transmit its stored information.When the transponder Tag draws power in this way the
resultant interaction of the RF fields causes the voltage at the transceiver antenna to drop in
value. This effect is utilized by the Tag to communicate its information to the reader. The Tag is
able to control the amount of power drawn from the field and by doing so it can modulate the
voltage sensed at theTransceiver according to the bit pattern it wishes to transmit.

Components of RFID
A basic RFID system consists of three components:

An antenna or a coil

A transceiver

A transponder (RF tag)

These are described below:

1. Antenna
The antenna emits radio signals to activate the tag and read and write data to it.Antennas are
the conduits between the tag and the transceiver, which controls thesystem's data acquisition
and communication. Antennas are available in a variety of shapes and sizes; they can be built
into a door frame to receive tag data from personsor things passing through the door, or
mounted on an interstate tollbooth to monitor traffic passing by on a freeway. The
electromagnetic field produced by an antenna canbe constantly present when multiple tags are
expected continually. If constant interrogation is not required, a sensor device can activate the
field. Often the antenna is packaged with the transceiver and decoder to become a reader
(a.k.a. interrogator), which can be configured either as a handheld or a fixed-mount device. The
reader emits radio waves in ranges of anywhere from one inch to 100 feet or more, depending
upon its power output and the radio frequency used. When an RFID tag passes through the
electromagnetic zone, it detects the reader's activation signal. The reader decodes the data
8
encoded in the tag's integrated circuit (silicon chip) and the data is passed to the host computer
for processing.

2. Transceiver
The RF transceiver is the source of the RF energy used to activate and power the passiveRFID
tags. The RF transceiver may be enclosed in the same cabinet as the reader or itmay be a
separate piece of equipment. When provided as a separate piece of equipment, the transceiver
is commonly referred to as an RF module. The RF transceiver controls and modulates the radio
frequencies that the antenna transmits and receives. The transceiver filters and amplifies
the back scatter signal from a passive RFID tag.

3. Transponder
An RFID tag is comprised of a microchip containing identifying information and anantenna that
transmits this data wirelessly to a reader. At its most basic, the chip will contain a serialized
identifier, or license plate number, that uniquely identifies that item, similar to the way many bar
codes are used today. A key difference, however is that RFID tags have a higher data capacity
than their bar code counterparts. This increases the options for the type of information that can
be encoded on the tag, including the manufacturer, batch or lot number, weight, ownership,
destination and history (such as the temperature range to which an item has been exposed). In
fact, an unlimited list of other types of information can be stored on RFID tags, depending on
application needs. An RFID tag can be placed on individual items, cases or pallets for
identification purposes, as well as on fixed assets such as trailers, containers, totes, etc.

Applications
The RFID tag can be affixed to an object and used to track and manage inventory, assets,
people, etc. For example, it can be affixed to cars, computer equipment, books, mobile phones,
etc.
RFID can be used in a variety of applications, such as:

Access management
Tracking of goods
Tracking of persons and animals
Toll collection and contactless payment
Machine readable travel documents
Smartdust (for massively distributed sensor networks)
Tracking sports memorabilia to verify authenticity
Airport baggage tracking logistics
Timing sporting events
Tracking and billing processes

Advantages

Scanning Range

9
An RFID reader can scan a tag as long as it is within frequency range. It does not have any
line-of-sight limitations. RFID systems can automatically pick up tag IDs from a distance and, in
some cases, through obstacles between the tag and the reader.

RFID Capabilities
RFID systems can scan multiple items simultaneously. For example, you could scan incoming
goods in your warehouse in the box, allowing you to check all contents at once without having
to run individual barcode scans on each item. Other ID systems typically have a single or
limited identifier for each object -RFID tags can contain more information. Some are also read-
write, allowing you to add or change data.

Speed and Convenience


RFID readers can scan tags in milliseconds and work automatically. Optical scanning systems
may need manual operation and may work less quickly, since the operator has to align the
reader and code exactly to scan it successfully. The speed of operation also has convenience
benefits in services such as cashless payments.

RFID Costs
Although RFID technology has been around since the 1970s, its initial high costs restricted
usage to larger businesses, many of whom developed proprietary systems. Although costs are
falling, RFID systems are still typically more expensive to set up and use than alternative
systems such as optical scanning. However, RFID systems bring their own cost benefits, such
as reduced labour costs and improved efficiency.

Disadvantages

Scanning Issues
Despite their reliability, RFID systems can still have problems. Although readers can scan
through most non-metallic materials, they have problems with metal and water. The fact that
you can scan multiple objects in a range is a benefit, but also comes with possible issues that
can cause malfunctions. Tag collision may occur if a reader picks up signals from multiple tags
at the same time. Reader collision may be an issue if two readers interfere with each other's
signals.

RFID Security and Privacy Concerns


RFID also brings up some security issues. Unauthorized devices may be able to read and even
change data on tags without the knowledge of the person who owns the object. Side-channel
attacks can pick up RFID data as it passes from a tag to a reader, which could give the attacker
access to passwords or information that should be secure. Some states have privacy statutes
to restrict activities that might use RFID technology to collect personal information.

Exploitation
As Technica reported in March 2006 an RFID buffer overflow bug that could infect airport
terminal RFID databases for baggage, and also passport databases to obtain confidential
information on the passport holder.
Global standardization
The frequencies used for UHF RFID in the USA are currently incompatible with those of Europe
or Japan. Furthermore, no emerging standard has yet become as universal as the barcode. To
address international trade concerns, it is necessary to use a tag that is operational within all of
the international frequency domains.

10
4. LIST & DESCRIPTION OF COMPONENTS

List of Components Used:


1) RFID RC522 Reader and RFID Tags
2) ATmega328P-PU Micro-controller
3) PL2303HX USB to TTL Converter
4) RTC DS1307 IC
5) LCD 16x2
6) Buzzer& LED
7) Breadboard & connecting wires

Description of components:

1) RFID RC522 Reader and RFID Tags

Mifare RC522 is the high integrated RFID card reader which works on contactless
communication at 13.56Mhz, is designed by NXP as a low power consumption, low cost and
compact size read and write chip, is the best choice in the development of smart meters and
portable hand-held devices.MIFARE is the NXP Semiconductors-owned trademark of a series
of chips widely used in contactless smart cards and proximity cards. The microcontroller and
card reader uses SPI for communication.Serial peripheral interface (SPI) is an interface that
enables the serial (one bit at a time) exchange of data between two devices, one called a
master and the other called a slave. An SPI operates in full duplex mode.

This module can fit directly in hand held devices for mass production. Module use 3.3V power
supply, and can communicate directly with any CPU board by connecting through SPI protocol,
which ensure reliable work, high reading distance.

11
2) ATmega328P-PU Micro-controller

The Atmel AVR core combines a rich instruction set with 32 general purpose working registers.
All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two
independent registers to be accessed in a single instruction executed in one clock cycle. The
resulting architecture is more code efficient while achieving throughputs up to ten times faster
than conventional CISC microcontrollers.The Atmel AVR core combines a rich instruction set
with 32 general purpose working registers. All the 32 registers are directly connected to the
Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in a single
instruction executed in one clock cycle. The resulting architecture is more code efficient while
achieving throughputs up to ten times faster than conventional CISC microcontrollers.

The ATmega328/P provides the following features: 32Kbytes of In-System Programmable Flash
with Read-While-Write capabilities, 1Kbytes EEPROM, 2Kbytes SRAM, 23 general purpose I/O
lines, 32general purpose working registers, Real Time Counter (RTC), three flexible
Timer/Counters with compare modes and PWM, 1 serial programmable USARTs , 1 byte-
oriented 2-wire Serial Interface (I2C), a 6-channel 10-bit ADC (8 channels in TQFP and
QFN/MLF packages), a programmable Watchdog Timer with internal Oscillator, an SPI serial
port, and six software selectable power saving modes. The Idle mode stops the CPU while
allowing the SRAM, Timer/Counters, SPI port, and interrupt system to continue functioning. The
Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip
functions until the next interrupt or hardware reset. In Power-save mode, the asynchronous
timer continues to run, allowing the user to maintain a timer base while the rest of the device is
sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except
asynchronous timer and ADC to minimize switching noise during ADC conversions. In Standby
mode, the crystal/resonator oscillator is running while the rest of the device is sleeping. This
allows very fast start up combined with low power consumption. In Extended Standby mode,
both the main oscillator and the asynchronous timer continue to run.

The device operates between 1.8-5.5 volts. The device achieves throughput approaching
1 MIPS per MHz.

12
3) PL2303HX USB to TTL Converter

The PL-2303HX is a low cost and high performance USB-to-Serial Bridge Controller. The PL-
2303HX provides a convenient solution for connecting an RS-232 full-duplex asynchronous
serial device to any Universal Serial Bus (USB) capable host. The PL-2303HX highly
compatible drivers could simulate the traditional COM port on most operating systems allowing
the existing applications based on COM port to easily migrate and be made USB ready. The
PL-2303HX is exclusively designed for mobile and embedded solutions in mind, providing a
small footprint that could easily fit in to any connectors and handheld devices. With very small
power consumption in either operating or suspend mode, the PL-2303HX is perfect for bus
power operation with plenty of power left for the attached devices. Flexible signal level
requirement on the RS-232 serial port side also allows the PL-2303HX to connect directly to
3.3V ~ 1.8V devices.
Nowadays it is typical that small embedded platforms and modules offer TTL level (5V or 3.3V)
serial port interfaces in them. The easiest way to interface such port to PC is to use USB to TTL
level serial port converter. The entire board is coated by high quality transparent heat
shrinkable sleeve,making the PCB in insulation state from outside, so that the board wont burnt
down by material short-circuit.

Applications
Programming of Microcontrollers that can be programmed using serial boot loaders at
3.3V or 5.0V logic levels
Data exchange between microcontroller and Desktop or Laptop Computers
Connection with GPS Devices
Connection with various external Phones, or modems, GSM Modules
All other applications requiring USB/Serial/TTL interface.
Simple UART communication, commonly used UART debugging tools in supper terminal
Two data transmission indicator can monitor data transfer status in real time.

13
4) RTC DS1307 IC

The DS1307 serial real-time clock (RTC) is a low-power, full binary-coded decimal (BCD)
clock/calendar plus 56 bytes of NV SRAM. Address and data are transferred serially through an
IC, bidirectional bus. The clock/calendar provides seconds, minutes, hours, day, date, month,
and year information. The end of the month date is automatically adjusted for months with fewer
than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-
hour format with AM/PM indicator. The DS1307 has a built-in power-sense circuit that detects
power failures and automatically switches to the backup supply. Timekeeping operation
continues while the part operates from the backup supply.

Features:

Programmable square wave output signal


Automatic power-fail detect and switch circuitry
Consumes less than 500nA in battery backup mode with oscillator running
Available in 8-pin DIP or SOIC
Underwriters Laboratory (UL) recognized
Real-time clock (RTC) counts seconds, minutes, hours, date of the month, month, day of the
week, and year with leap-year compensation valid up to 2100
56-byte non-volatile RAM for data storage
Two-wire interface (I2C)

14
5. LIST & DESCRIPTION OF SOFTWARES

List of Softwares Used:

1) Arduino IDE

2) Gobetwino 0.5

3) Mysql Server 5.6

1) Arduino IDE

The Arduino project provides the Arduino integrated development environment (IDE), which is
a cross-platform application written in the programming language Java. It originated from the
IDE for the languages Processing and Wiring. It includes a code editor with features such as
text cutting and pasting, searching and replacing text, automatic indenting, brace matching,
and syntax highlighting, and provides simple one-click mechanisms to compile and upload
programs to an Arduino board. It also contains a message area, a text console, a toolbar with
buttons for common functions and a hierarchy of operation menus.

15
A program written with the IDE for Arduino is called a sketch. Sketches are saved on the
development computer as text files with the file extension .ino. Arduino Software (IDE) pre-1.0
saved sketches with the extension .pde.
The Arduino IDE supports the languages C and C++ using special rules of code structuring. The
Arduino IDE supplies a software library from the Wiring project, which provides many common
input and output procedures. User-written code only requires two basic functions, for starting
the sketch and the main program loop, that are compiled and linked with a program
stub main() into an executable cyclic executive program with the GNU toolchain, also included
with the IDE distribution. The Arduino IDE employs the program avrdude to convert the
executable code into a text file in hexadecimal encoding that is loaded into the Arduino board by
a loader program in the board's firmware.

A minimal Arduino C/C++ sketch, as seen by the Arduino IDE programmer, consists of only two
functions:

setup(): This function is called once when a sketch starts after power-up or reset. It is
used to initialize variables, input and output pin modes, and other libraries needed in the
sketch.
loop(): After setup() has been called, function loop() is executed repeatedly in the main
program. It controls the board until the board is powered off or is reset.

2) Gobetwino 0.5

Gobetwino is kind of a genreric proxy for Arduino. Its a program running on a PC (Windows
only ), that will act on behalf of Arduino and do some of the things that Arduino cant do on its
own. So it works like a go between, hence the name Gobetwino.

Gobetwino is not restricted to work with Arduino, the serial port can be configured so it can
work with most devices that can send and receive strings over a serial line.

Gobetwino is listening on the serial port, for commands coming from Arduino, and in response
it will do something for Arduino and possibly return something to Arduino.

Gobetwino defines a set of command types that can be used as templates to create
actual commands. Arduino can ask Gobetwino to execute these commands, and return
something to Arduino.

So what can Gobetwino do? Using the defined command types we can create
commands in Gobetwino that Arduino can ask Gobetwino to execute. With combinations
of commands we can do things like:

Start any program on your PC, either directly or via an associated file type.

Start Excel, send sensor readings from Arduino directly into the Excel sheet, save the
sheet and email it to someone, without touching your PC.

Send e-mails to a POP3 mailbox and have Arduino react to the contents of the emails.

Log data directly to a CSV file on the PC, so the data can be used in spreadsheets or
databases.

16
Download a file from the internet and have Arduino ask for a specific line of data
from the file.

Of course there is no magic involved, and Gobetwino only defines and do things on the PC
side, you have to program anything needed on the Arduino side. But programming Arduino to
send commands to Gobetwino is a matter of sending specially formatted strings over the
serial line, and then wait for responses from Gobetwino.

3) Mysql Server 5.6

MySQL is an open-source relational database management system (RDBMS). Its name is a


combination of "My", the name of co-founder Michael Widenius' daughter, and "SQL", the
abbreviation for Structured Query Language. The MySQL development project has made
its source code available under the terms of the GNU General Public License, as well as under
a variety of proprietary agreements. MySQL was owned and sponsored by a single for-
profit firm, the Swedish company MySQL AB, now owned by Oracle Corporation.[9] For
proprietary use, several paid editions are available, and offer additional functionality.

MySQL is written in C and C++. Its SQL parser is written in yacc, but it uses a home-
brewed lexical analyzer. MySQL works on many system platforms,
including AIX, BSDi, FreeBSD, HP-UX, eComStation, i5/OS, IRIX, Linux, macOS, Microsoft
Windows, NetBSD, Novell NetWare, OpenBSD, OpenSolaris, OS/2 Warp, QNX, Oracle
Solaris, Symbian, SunOS, SCO OpenServer, SCO UnixWare, Sanos and Tru64. A port of
MySQL to OpenVMS also exists.

Command-line interfaces
A command-line interface is a means of interacting with a computer program where the user
issues commands to the program by typing in successive lines of text (command lines). MySQL
ships with many command line tools, from which the main interface is the mysql client.
MySQL Utilities is a set of utilities designed to perform common maintenance and administrative
tasks. Originally included as part of the MySQL Workbench, the utilities are a stand-alone
download available from Oracle.

6. DESIGN

Block Diagram

17
Circuit Diagram

18
7. IMPLEMENTATION
19
7.1 Function of the Project:

This system is connected through mysql database to maintain the records of every employee. It
will also record time of attendance using RTC IC .

There are twobasic users: a) Employee b) Administrator

Employee:
Actor carrying the RFID tag and a member of the organization. He is the front-end user of the
system.

Admin:
System administrator, who looks after the system and has access to all rights and permissions
in the system. He is the back-end user of the system.

Role of Employee:

The employee places his/her card in front of the RFID reader. If the UID of the card matches
with the code stored in the database, his/her attendance is recorded and the LCD displays
present with name of the Employee on the LCD screen in front of Employee, simultaneously a
green led will blink and there be a sound from a buzzer to make sure that attendance of
Employee is successfully recorded. Ifsomehow there is any other RFID tag which work in same
frequency like Employees RFID tag then RFID Reader will read the UID code of RFID tag and
displays on screen that CARD NOT RECOGNISEDbecause that UID is not registered in the
Database of the System.

Role of Admin:

Every user of the software will be an employee of the organization. Admin can view the
attendance of employees. Admin can also search for the employees' information stored in the
organization database. The concerned authorities get a generated report of the attendance of
the employees after a uniform time interval.

7.2 Complete Code for ATmega328P-PU

20
int count =0;
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include <SPI.h>
#include <MFRC522.h>
#include "RTClib.h"
#include<LiquidCrystal.h>
RTC_DS1307 rtc;
LiquidCrystal lcd(7,6,5,4,3,2);
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday"};
#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
int serInLen = 25;
char serInString[25];
int pId =0;
int result;

void setup () {
pinMode(A0,OUTPUT);
pinMode(A1,OUTPUT);
pinMode(A2,OUTPUT);

while (!Serial); // for Leonardo/Micro/Zero


lcd.begin(16,2);
Serial.begin(9600);
SPI.begin(); // Initiate SPI bus
mfrc522.PCD_Init(); // Initiate MFRC522
if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);

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(2017, 5, 3, 12, 57 ,0 ));
}

void loop () {

21
DateTime now = rtc.now();

Serial.print(now.day(), DEC);
lcd.print(now.day(), DEC);
Serial.print('/');
lcd.print('/');
Serial.print(now.month(), DEC);
lcd.print(now.month(), DEC);
Serial.print('/');
lcd.print('/');
Serial.print(now.year(), DEC);
lcd.print(now.year(), DEC);
Serial.print(" (");
lcd.setCursor(10,0);
lcd.print("");
Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
lcd.print(daysOfTheWeek[now.dayOfTheWeek()]);
Serial.print(") ");
lcd.print(" ");
lcd.setCursor(0,1);
Serial.print(now.hour(), DEC);
lcd.print(now.hour(), DEC);
Serial.print(':');
lcd.print(':');
Serial.print(now.minute(), DEC);
lcd.print(now.minute(), DEC);
Serial.print(':');
lcd.print(':');
Serial.print(now.second(), DEC);
lcd.print(now.second(), DEC);
Serial.println();

Serial.println();

delay(1000);
lcd.clear();

if ( ! mfrc522.PICC_IsNewCardPresent())
{

lcd.clear();
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}

22
//Show UID on serial monitor

Serial.print("UID tag :");

String content= "";


byte letter;
for (byte i = 0; i < mfrc522.uid.size; i++)
{
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
lcd.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
lcd.print(mfrc522.uid.uidByte[i], HEX);
content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
content.concat(String(mfrc522.uid.uidByte[i], HEX));
}
Serial.println();
Serial.print("Message : ");

content.toUpperCase();

if (content.substring(1) == "72 8C 2A D5") //change here the UID of the card/cards that you
want to give access
{digitalWrite(A0,HIGH);
delay(750);
digitalWrite(A0,LOW);

Serial.println("S1 PRESENT");
lcd.setCursor(0,1);
lcd.print("VIKAS PRESENT");

char buffer[5];

char nam[]="VIKAS";
char st[]="P";
char id[]="01";
Serial.print("#S|LOGTEST|[");//roll1 is 01 for student 1 with uid 72 8c 2a d5

Serial.print(id);
Serial.print(" ");
Serial.print(nam);
Serial.print(" ");

Serial.print(st);
Serial.print(" ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');

23
Serial.print(now.second(), DEC);

Serial.println("]#");

Serial.println();
delay(1500);
}
else if (content.substring(1) == "6B 91 F1 66") //change here the UID of the card/cards that you
want to give access
{digitalWrite(A0,HIGH);
delay(750);
digitalWrite(A0,LOW);

Serial.println("S1 PRESENT");
lcd.setCursor(0,1);
lcd.print("VINAYAK PRESENT");

char buffer[5];

char nam[]="VINAYAK";
char st[]="P";
char id[]="02";
Serial.print("#S|LOGTEST|[");//roll1 is 01 for student 1 with uid 72 8c 2a d5

Serial.print(id);
Serial.print(" ");
Serial.print(nam);
Serial.print(" ");

Serial.print(st);
Serial.print(" ");

Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);

Serial.println("]#");

Serial.println();
delay(1500);
}

else if (content.substring(1) == "76 25 24 07") //change here the UID of the card/cards that you
want to give access
{digitalWrite(A0,HIGH);
delay(750);
digitalWrite(A0,LOW);

24
Serial.println("S1 PRESENT");
lcd.setCursor(0,1);
lcd.print("SUMIT PRESENT");

char buffer[5];

char nam[]="SUMIT";
char st[]="P";
char id[]="03";
Serial.print("#S|LOGTEST|[");//roll1 is 01 for student 1 with uid 72 8c 2a d5

Serial.print(id);
Serial.print(" ");
Serial.print(nam);
Serial.print(" ");

Serial.print(st);
Serial.print(" ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println("]#");

Serial.println();
delay(1500);
}

else if(content.substring(1) == "8B 2B 08 99" ) {

digitalWrite(A0,HIGH);
delay(750);
digitalWrite(A0,LOW);
char nam[]="DEEPAK";
char st[]="P";
char id[]="04";
char buffer[5];
Serial.println("S2 PRESENT");
lcd.setCursor(0,1);
lcd.print("DEEPAK PRESENT");
Serial.print("#S|LOGTEST|[");

Serial.print(id);
Serial.print(" ");
Serial.print(nam);
Serial.print(" ");

25
Serial.print(st);
Serial.print(" ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);

Serial.println("]#");

delay(1500);

7.3 Interfacing ATmega328P-PU with Arduino IDE

One of the highlights of this project is that we didnt used any Arduino Board or Development
Board, we are specially using PL2303HX USB to TTL Converter which is used to create
an interface between ATmega328P-PU Microcontroller and Arduino IDE, with this
PL2303HX USB to TTL Converter we able to communicate between Atmega328
Microcontroller and pc/laptop. We generally made our own Arduino Board on a
breadboard.

Steps to Programme ATmega328P-PU

26
1) We took a ATmega328PPU Microcontroller which already has a bootloader burned on it and
placed on a breadboard.

2) We used PL2303HX USB to TTL converter and 4 components-


a 16 MHz crystal,
a 100 ohm resistor, and
two 18 to 22 picofarad (ceramic) capacitor

We connected all components as given in the figure given below, now our ATmega328P-PU
microcontroller is ready to be programmed by Arduino IDE.

Now we can upload a sketch from PC using Arduino IDE in ATmega328P-PU Microcontroller
through PL2303HX USB to TTL converter directly without using any arduino board.

7.4 Database Management using Gobetwino 0.5

Communication between Microcontroller and Gobetwino

The communication between Microcontroller and Gobetwino takes place over the usual
serial line. For this to work the serial line has to be configured with the same settings
( i.e. Baud rate and serial port) in Microcontroller and Gobetwino.

All communication is done by sending and receiving strings or single characters. It is up to us to


convert any data we want to send from Microcontroller to Gobetwino to a string, this includes
27
the commands, and any data required as parameters to the commands. The opposite is also
true, you have to convert anything received from Gobetwino to the required data types in your
Arduino sketch.

To use a command that you have created in Gobetwino from your Arduino sketch, you have to
send at string from Arduino to Gobetwino in a special format. This is to ensure that Gobetwino
can make sure that the command received is complete and has all the parameters needed with
it.

The general format of a command string is:

#S|commandname|[parameter1&parameter2&&last parameter]#

Log to file command type (LGFIL)

This command type allows you to log data from Arduino to a file on the PC. If for instance your
Arduino board was set up with some sensors and you want to log the sensor readings on a
regular interval, you could use LGFIL to do the logging for you. Each time the command is
called with some data the data is written to a new line at the end of the log file. It is possible to
have an optional timestamp logged with each piece of data as well.

Parameters:
File Internal parameter. The full path to the file to log data to.
Data External parameter. The data you want to log to he file.
Time stamp Internal parameter. If true, a timestamp is added to each log entry.

Return value:
0 The data was logged to the file.
-1 If the log file does not exist.
-2 If an exception was generated trying to read from the file.
Settings
dependencies:
None.

How to use in Arduino sketch:


Serial.println("#S|NAME|[DATA]#");

Where NAME is the name of the command as entered in the command editor, and DATA
is the data you want to log to the log file.

Sample Aduino sketch:


Logtest.pde

In this way we made a log file in .txt format, once we created a text file from Gobetwino then
we are ready to use Mysql server for storing records of Employees attendance in a Database.

Importing Data in Mysql from a Text file

We have a text file now that contains data (records of Employees Attendance),
the LOAD DATA INFILE statement can be used to import it into MySQL. We now import
data from a text file into a predefined empty table (suppose table1) of Mysql database.

28
As an example, suppose that we have a text file called data.txt in the /tmp directory.
Further that within the file there is one record per line and that the fields of each are
separated by some spaces. Below is what we will enter through the mysql client to
import the data into the table table1:

LOAD DATA LOCAL INFILE '/tmp/data.txt'

INTO TABLE db1.table1

FIELDS TERMINATED BY 'No. of spaces';

7.5 Working

Were starting from uploading the code or sketch from Adruino IDE to ATmega328P-PU
microcontroller using PL2303HX USB to TTL converter

NOTE: After uploading the code in the Microcontroller, we start Gobetwino software in the
background to record the data coming from Microcontroller to PC in text format.

After uploading the code we can see the current date and time on the LCD display. The date
and time is provided by RTC IC DS1307 to Microcontroller through SDA line. Microcontroller
processes the data received from RTC IC and transmits the processed data to LCD registers,
then LCD driver keeps printing the processed data (i.e. Current date and time in a proper
format) on the LCD display.

In next stage, we take an RFID tag, and bring it near to RFID Reader. When an RFID tag
passes through the electromagnetic field of RFID Reader, it detects the reader's activation
signal. The reader decodes the data encoded in the tag's integrated circuit (silicon chip) and the
data is passed to the memory of Microcontroller for processing. The data of RFID tag when
received by Microcontroller will be processed and then processed data will be transmitted to
LCD registers, the LCD driver display the processed data (i.e. Employee is present with their
respective name) with a pop-up for a short time. During this stage, as the data of RFID tag
when received by Microcontroller, an LED will blink and there will be a sound from a buzzer for
short time to confirm that Employee attendance is successfully recorded. Whole process of this
stage will keeps repeating with different RFID tags for a particular interval of time.

Gobetwino Software which was running in the background for an interval of time, in which
different RFID tags were used, now is ready to access the data received from RFID tags in a
particular format as we defined in the Arduino code or sketch. Gobetwino softare used to record
the data which received from RFID tags and transmitted from Microcontroller in text file on the
PC. The data recorded in text file on PC now can be imported to mysql database and everyday
record of the attendance of Employees can remain stored in a database.

8. APPLICATIONS, LIMITATIONS & FUTURE SCOPE


29
Applications of RFID Based Attendance Management System

RFID based attendance system can be used in educational institutions, industries,


anywhere.
RFID is emerging technology and is used in applications where authentication is needed.

Limitations of RFID Based Attendance Management System:

RFID attendance system is secured, but there is a chance of misusing the cards. One
person can give another persons attendance if he/she had RFID card.
If the card was swiped for more than once, there is a chance of giving attendance more
than once a day.
We only allows employee to enter the in-time during attendance marking, we could have
given the option of out-time when employees complete their working hours

Future scope:
A hex key pad can be interfaced to microcontroller board by which user can enter his
password then only the lock can be opened. This ensures even if someone has card
then also without the password he cant get access.

Implementing the security systems with different levels by using different types of mifare
cards.

Study of other RFID techniques for better service and security.

Interfacing the system with a Ethernet Shield so that data can be transmitted wirelessly
to many other PCs.

Range of RFID reader can be further increased so it can detect RFID tag easily by a
distance.

9. Conclusion
In conclusion, the objective to build an RFID based attendance management system was
successfully achieved. In terms of performance and efficiency, this project has provided a
convenient method of attendance marking compared to the traditional method of attendance
system. By using databases, the data is more organized. This system is also a user friendly
system as data manipulation and retrieval can be done via the interface, making it a
universal attendance system. Thus, it can be implemented in either an academic institution
or in organizations.

30
As the RFID technology evolves, more sophisticated applications will use the capability of RFID
to receive, store and forward data to a remote sink source. RFID has many applications as can
be imagined. RFIDs potential benefits are large, and were sure to see many novel applications
n the futuresome of which we cant even begin to imagine. The components that go into RFID
readers and tags are simple radio communications, but their smaller size and broad deployment
enhance the power of the technology and raise concerns about the privacy effects of RFID
deployment. These concerns are often premised on unlikely assumptions about where the
technology will go and how it will be used.

31

Das könnte Ihnen auch gefallen