Professional Documents
Culture Documents
Rfid Book
Rfid Book
B.Sc. Project
By
ID: 17114
ID: 153
ID: 171
1
Certificate
The project titled “GSM Based RFID Attendance System “submitted by
has been accepted as satisfactory in partial fulfillment of the requirement for the
degree of Bachelor of Science in Electrical and Electronic Engineering on August,
2019.
Supervisor
……………….
Md. Ziaul Islam
Lecturer,
Department of Electrical and Electronic Engineering (EEE),
City University, Bangladesh
2
Declaration
This is to certify that the project titled “GSM Based RFID Attendance System” is the
result of our study in partial fulfillment of the B.Sc. Engineering degree under the
supervision of Md. Ziaul Islam, Lecturer, Department of Electrical and
Electronic Engineering (EEE), City University, Bangladesh. It is also hereby declared
that this project or any part of it has not been submitted elsewhere for the award of
any degree.
……………………………..
Name:
ID No: 171143539
Department of Electrical and Electronic Engineering,
City University, Bangladesh
……………………………
Name:
ID No: 153103305
Department of Electrical and Electronic Engineering,
City University, Bangladesh
……………………………
Name:
ID No: 171143513
Department of Electrical and Electronic Engineering,
City University, Bangladesh
3
Acknowledgement
First, we would like to say thanks to almighty “ALLAH” for giving us the strength to
finish the project as a partial fulfillment for the requirements for the Degree of B. Sc.
In Electrical and Electronic Engineering. We would like to express our gratitude and
appreciation to our supervisor, Md. Ziaul Islam, Lecturer, Department of Electrical
and Electronic Engineering of City University for the guidance and enthusiasm
extended throughout the progress of this work. We would like to say Special thanks to
the acting head of our department Md. Humayun Kabir Khan, Assistant Professor,
Department of Electrical and Electronic Engineering of City University for his
precious advises with fruitful suggestions and coordination. We are also grateful to all
the faculties of the Department of Electrical and Electronic Engineering of City
University, Bangladesh for giving us the opportunity to complete the work and
necessary support during the period. This thesis work would not have been possible
without the encouragement, logical help and advice from our friends. We are grateful
to them. Finally, we must acknowledge with due respect the constant support and
patience of our parents.
4
Abstract
Nowadays, with the advancement of the technologies and the craze of internet in the
present era, students are less motivated to attend the lecture. This project is to simplify
attendance recorder system by using Radio Frequency Identification (RFID)
technology. This will require a product, which has can distinguishing different person.
This can be made possible with the technology of RFID (Radio Frequency
Identification). This report will provide a clear picture of hardware and software used
in the system. It will also provide an overall view of its operation and working.
5
Contents
Name of Contents Page
No.
Title of the Project…………………………………………………………….. I
Certificate …………………… ………………………………………………. II
Declaration …………………………………………………………………… III
Acknowledgement ……………………………………………………………. IV
Abstract ………………………………………………………………………. V
Contents………………………………………………………………………... VI
Figure of contents …………………………………………………………… VIII
Table of contents ……………………………………………………………... IX
Chapter 1: Introduction ……………………………………………………… 1
1.1 Introduction……………………………………………………………….. 1
1.2 What is IoT? ……………… ……………………………………………… 2
1.3 What is GSM? ….………………………………………………………… 2
1.4 What is Gas Detector? ………………………………………………… 3
1.5 What is IoT and GSM Based Gas Detector ……………………………..... 3
1.6 Objective of the project ………... ………………………………………... 4
1.7 Organization of the Project Book …………………………………………. 4
6
2.3.8.3 LCD Display ………………………………………………………….. 20
2.3.8.4 I2C Interface ………………………………………………………….. 21
2.3.8.5 I2C Module Connection……………………………………………….. 21
2.3.9 Connecting Wire …………………………………………………........... 22
2.3.10 Bread Board …………………………………………………………… 22
2.3.11.1 Sim800L GSM Module ……….…………………………………….. 23
2.3.11.2 Features ……………………………………………………………… 23
2.3.12 Power Supply ………………………………………………………….. 24
2.3.13.1 Flame Sensor ………………………………………………………… 25
2.3.13.2 Pins of Flame Sensor ………………………………………………… 25
2.3.13.3 Features & Specifications ………………………………………….... 26
2.3.14 Buzzer …………………………………………………………………. 26
References.………………………………………………………………........... 34
Appendix ……………………………………………..….……………………. 35
Programming Code for Arduino ……………….………….…………………… 33
Programming Code for NodeMCU ………....……………...…………………… 35
7
Figure of Contents
Figure No. Page No.
Figure 1.1 IoT ………………………………………………………….. 2
Figure 1.2 GSM ………. ………………………………………………. 2
Figure 1.3 Gas Detector ……………………………………………….. 3
Figure 2.1 Block Diagram ……………………………………………... 5
Figure 2.2 MQ2 Sensor ………………………………………………..... 6
Figure 2.3 MQ3 Sensor ………………………………………………..... 8
Figure 2.4 MQ4 Sensor ………………………………………………..... 9
Figure 2.5 MQ7 Sensor ………………………………………………..... 11
Figure 2.6 MQ8 Sensor ………………………………………………..... 12
Figure 2.7 Arduino Uno R3 ……………………………………………. 14
Figure 2.8 NodeMCU ……………….. ………………………………... 16
Figure 2.9 Pins Of NodeMCU ...……………………………………….. 17
Figure 2.10 Communication Pins of NodeMCU ……………………...… 19
Figure 2.11 20*4 LCD With I2C Module…………..…………………… 20
Figure 2.12 LCD And I2C Connection ….……………………………… 21
Figure 2.13 Connecting Wire …... ……………………………………. 22
Figure 2.14 Bread Board ……………………………………………….. 22
Figure 2.15 Sim800L GSM Module ……………………….…………… 23
Figure 2.16 12V Power Supply ………………………………………..... 24
Figure 2.17 5V Power Supply …………… …………………………….. 24
Figure 2.18 Flame Sensor ……………………………………………….. 25
Figure 2.19 Buzzer ……………………………………………………… 26
Figure 3.1 Program installation Process-1 …………………………….... 28
Figure 3.2 Program installation Process-2 …………………………….... 28
Figure 33 Blynk Android App ………………………………………….. 30
Figure 3.4 Flowchart of the compiling process ………………………... 30
Figure 3.5 Circuit Diagram ………………..………….………………... 29
8
Table of Contents
Table No. Page No.
Table 2.1 Pins of MQ2 Sensor …………………………………………... 7
Table 2.2 Pins of MQ3 Sensor …………………………………………... 8
Table 2.3 Pins of MQ4 Sensor …………………………………………... 10
Table 2.4 Pins of MQ7 Sensor …………………………………………... 11
Table 2.5 Pins of MQ8 Sensor …………………………………………... 12
Table 2.6 Specification of Arduino .………….……...………………….. 15
Table 2.7 Pins of NodeMcu ………….………………….………………. 16
Table 2.8 Pins of Flame Sensor ……..…...……………………………… 25
Table 4.1 Cost Analysis of this project …….………….………………… 32
9
Chapter 1: Introduction
1.1 Introduction
1
1.2 What is RFID?
Passive tags are powered by energy from the RFID reader's interrogating radio waves.
Active tags are powered by a battery and thus can be read at a greater range from the
RFID reader; up to hundreds of meters. Unlike a barcode, the tag doesn't need to be within the
line of sight of the reader, so it may be embedded in the tracked object. RFID is one method
of automatic identification and data capture (AIDC).[1]
RFID tags are used in many industries. For example, an RFID tag attached to an automobile
during production can be used to track its progress through the assembly line; RFID-tagged
pharmaceuticals can be tracked through warehouses; and implanting RFID microchips in livestock
and pets enables positive identification of animals.
Since RFID tags can be attached to cash, clothing, and possessions, or implanted in animals and
people, the possibility of reading personally-linked information without consent has raised serious
privacy concerns.[2] These concerns resulted in standard specifications development addressing
privacy and security issues. ISO/IEC 18000 and ISO/IEC 29167 use on-
chip cryptography methods for untrace ability, tag and reader authentication, and over-the-air
privacy. ISO/IEC 20248 specifies a digital signature data structure for RFID
and barcodes providing data, source and read method authenticity. This work is done
within ISO/IEC JTC 1/SC 31 Automatic identification and data capture techniques. Tags can also
be used in shops to expedite checkout, and to prevent theft by customers and employees.
In 2014, the world RFID market was worth US$8.89 billion, up from US$7.77 billion in 2013 and
US$6.96 billion in 2012. This figure includes tags, readers, and software/services for RFID cards,
labels, fobs, and all other form factors. The market value is expected to rise from US$12.08 billion
in 2020 to US$16.23 billion by 2029
2
GSM is a mobile communication modem; it is stands for global system for mobile
communication (GSM). GSM is an open and digital cellular technology used for
transmitting mobile voice and data services operates at the 850MHz, 900MHz,
1800MHz and 1900MHz frequency bands.
3
tremendously as it comes closer to electronic devices. In, an automatic attendance
system using fingerprint verification technique was proposed. The fingerprint
technique verification was achieved using extraction of abnormal point on the ridge of
user’s fingerprint or minutiae technique. The verification confirms the authenticity of
an authorized user by performing one to one comparison of a captured fingerprint
templates against the stored templates in the database. The proposed automatic
attendance system signals either true or false based on logical result of previous one to
one verification of person’s authenticity. Authors in also reviewed and proposed
biometric system using fingerprint identification for attendance automation of
employees in an organization. Consequently, authors in proposed student wolf pack
club tracking system to simplify and speed up the process of student wolf pack club
ticket distribution for athletic event. Our proposition emphasizes a simple, reliable
and cost effective model for face classrooms’ attendance management that uses
existing student ID card chip as the passive tag with additional short message services
to parents as weekly summary.
4
1.6 Objective of this Project
This section describes previous work done regarding attendance system. Attendance
records are necessary to conclude and authenticate students as well as employees of
organization. Therefore, many researches have been done research in this area to
improve and replace the traditional system of attendance by RFID technology
[1] describes the integration of mobile device with software for recording
examination attendance is sufficient. In a test, it was found that it reduces time,
manpower, cost (printing and paper), and eases the examination procedures
[2] Tells the establishment of remote monitoring platform based on a GSM short
message mode that can monitor and control the remote communication between the
central monitoring station and remote monitoring stations. The remote monitoring
station can send the short message because GSM network can interconnect and roam
all over the country, and its network ability is very strong; the user will no need
another network.
[3] Proposed a system which utilizes the GSM short message service and
microcontroller to achieve remote real-time data monitoring. The PC server program
written in VB language performs real-time data processing and control and records
monitoring results into database.
[4] Expressed low cost RFID Based Attendance System prototype, the system
provides several advantages over conventional method of taking attendance in class.
The prototype developed in this project is compact and light weight. Besides, it can
run using power adapter or battery power. Therefore, it is very portable and can be
carried to the class for taking the attendance.
[5] Designed a wireless fingerprint-based attendance system to record and obtain the
attendance data using finger prints or known as biometric.
[6] Designed a time management and access monitoring system using microprocessor
card to monitor students‟ or staffs‟ movement with the records that are kept in the
database for administrator reference in campus, office or certain area. All data
captured by this system could be accessed by teachers; headmaster and parents.
5
Chapter2: Focuses on hardware we used, their theoretical background and
applications.
6
Chapter 2: Hardware Description
1. ATMEGA328 PU
2. RFID Receiver
3. RFID Tag
4. SIM800L GSM Module
5. 16 MHz Crystal Oscillator
6. 16*2 LCD
7. Buzzer
8. LM7805 IC
9. 12V or 5V Power Supply
10. CCB
7
2.3 Description of the Components
ATmega328 Features
No. of Pins 28
8
ATmega328 Features
ADC 10-Bit
PWM Pins 6
Comparator 1
Oscillator up to 20 MHz
I/O Pins 23
Manufacturer Microchip
SPI Yes
I2C Yes
9
2.3.1.3 Pin Description of ATMEGA 328P
Functions associated with the pins must be known in order to use the device.
Appropriately.ATmega-328 pins are divided into different ports which are given in
detail below.
VCC is a digital voltage supply.AVCC is a supply voltage pin for analog to digital
converter.GND denotes Ground and it has a 0V.Port A consists of the pins
from PA0 to PA7. These pins serve as analog input to analog to digital converters. If
analog to digital converter is not used, port A acts as an eight (8) bit bidirectional
input/output port.Port B consists of the pins from PB0 to PB7. This port is an 8 bit
bidirectional port having an internal pull-up resistor.Port C consists of the pins
from PC0 to PC7. The output buffers of port C has symmetrical drive characteristics
with source capability as well high sink.Port D consists of the pins
from PD0 to PD7. It is also an 8 bit input/output port having an internal pull-up
resistor.
If you have a new ATmega328P (or ATmega168), you'll need to burn the bootloader
onto it. You can do this using an Arduino board as an in-system program (ISP). If
the microcontroller already has the bootloader on it (e.g. because you took it out of
an Arduino board or ordered an already-bootloaded ATmega), you can skip this
section.
1. Upload the ArduinoISP sketch onto your Arduino board. (You'll need to
select the board and serial port from the Tools menu that correspond to your
10
board.)
2. Wire up the Arduino board and microcontroller as shown in the diagram to
the right.
3. Select "Arduino Duemilanove or Nano w/ ATmega328" from the Tools >
Board menu. (Or "ATmega328 on a breadboard (8 MHz internal clock)" if
using the minimal configuration described below.)
4. Select "Arduino as ISP" from Tools > Programmer
5. Run Tools > Burn Bootloader
You should only need to burn the bootloader once. After you've done so, you can
remove the jumper wires connected to pins 10, 11, 12, and 13 of the Arduino board.
Once your ATmega328P has the Arduino bootloader on it, you can upload programs
to it using the USB-to-serial convertor (FTDI chip) on an Arduino board. To do, you
remove the microcontroller from the Arduino board so the FTDI chip can talk to the
microcontroller on the breadboard instead. The diagram at right shows how to
connect the RX and TX lines from the Arduino board to the ATmega on the
breadboard. To program the microcontroller, select "Arduino Duemilanove or Nano
w/ ATmega328" from the the Tools > Board menu (or "ATmega328 on a breadboard
(8 MHz internal clock)" if you're using the minimal configuration described below).
Then upload as usual.
11
location you can find in the Arduino preferences dialog). If you've previously
installed support for additional hardware configuration, you may already
have a "hardware" folder in your sketchbook.
3. Move the breadboard folder from the zip archive to the "hardware" folder of
your Arduino sketchbook.
4. Restart the Arduino software.
5. You should see "ATmega328 on a breadboard (8 MHz internal clock)" in the
Tools > Board menu.
Once you've done this, you can burn the bootloader and upload programs onto your
ATmega328P as described above. Be sure to select "ATmega328 on a breadboard (8
MHz internal clock)" when burning the bootloader. (If you select the wrong item
and configure the microcontroller to use an external clock, it won't work unless you
connect one.)
UART
UART stands for Universal Asynchronous Reception and Transmission and is a
simple communication protocol that allows the NodeMCU to communicate with serial
devices. The UART system communicates with digital pin 0 (RX), digital pin 1 (TX),
and with another computer via the USB port.
This peripheral, found on all NodeMCU boards, allows the NodeMCU to directly
communicate with a computer thanks to the fact that the Arduino has an onboard
USB-to-Serial converter. Therefore, programs written on a Windows, Mac, or Linux
OS can be used with an NodeMCU connected to a USB port as if it was a serial port
(serial port communication is trivial compared to USB communication).
I2C
I2C, which stands for inter-integrated-circuit, is a serial communications protocol
specially designed for microcontrollers.
When connecting two circuits to one another, think of the main device as the “master”
12
and the connected devices—such as sensors, pin expansions, and drivers—as “slaves”.
I2C makes it possible to connect multiple masters and slaves to your board while
maintaining a clear communication pathway.
SPI
SPI stands for Serial Peripheral Interface. Like I2C, SPI is a different form of serial-
communications protocol specially designed for microcontrollers to talk to each other.
However, it has some key differences from its I2C counterpart.
14
2.3.2.3 What is the difference between RFID and barcode technology?
Barcode and RFID share similar functionalities, but they have one distinct difference:
human intervention, or “line of sight.” This refers to the distance between the operator
of the data collection device (barcode scanner or RFID reader) and the labeled or
tagged item — in other words, whether or not they are close enough to the item to see
it.
To get a good barcode read, operators must position their handheld scanner within the
line of sight of the item. To collect data using RFID technology, operators are not as
limited — they simply need to be within the range of the tag. This means that
employees can collect data for any item within the read range without physically
moving from shelf to shelf. This also means that more than one item can be read at
once. For those reasons, many companies are looking to RFID to add even more value
to their operations.
With RFID, supply chain businesses can track the movement of their inventory items
and assets. By eliminating labor-intensive inventory tracking processes that require
human intervention and increasing visibility of your items and assets, RFID can help
businesses cut costs related to manufacturing, distribution, inventory management,
and asset tracking.
RFID automates your data collection process so that your employees can eliminate
time-consuming procedures and spend more time on what’s important: customer
service, shipping, and picking.
An automated data collection system — especially one that does not require human
intervention — improves speed and accuracy so that employees can get more done in
a shorter amount of time (and get it done right the first time). Because of this, RFID
allows businesses to decrease their labor costs. And with improved accuracy,
businesses can also increase their throughput, and therefore reduce their inventory
carrying costs as well.
Not to mention, improved accuracy can yield even more benefits. When shipments
arrive on time and in the right quantities, customers are bound to be more satisfied
with your service.
15
2.3.3.1 Definition of RFID Tags
RFID tags are a type of tracking system that uses smart barcodes in order to identify
items. RFID is short for “radio frequency identification,” and as such, RFID tags
utilize radio frequency technology. These radio waves transmit data from the tag to a
reader, which then transmits the information to an RFID computer program. RFID
tags are frequently used for merchandise, but they can also be used to track vehicles,
pets, and even patients with Alzheimer’s disease. An RFID tag may also be called an
RFID chip.
16
plastic or metal. Active RFID tags use one of two main frequencies — either 433
MHz or 915 MHz — to transmit information. They contain three main parts,
including a tag, antenna, and interrogator. The battery in an active RFID tag should
supply enough power to last for 3-5 years. When it dies, the unit will need replaced,
as the batteries are not currently replaceable. There are two main kinds of active RFID
tags: beacons and transponders. Beacons send out an information ping every few
seconds, and their signal is readable from several hundreds of feet away. Because they
are sending out data so frequently, their battery tends to deplete quicker. Like passive
RFID tags, transponders require the use of a reader to transmit information. When
within range of one another, a reader first sends out a signal to the transponder, which
then pings back with the relevant information. Because they only activate when near a
reader, transponders are much more battery-efficient than beacons.
17
increase in time and labor also means an increase in cost. These types of
disadvantages are often avoided with the use of barcodes, which is why they are still a
popular data collection and inventory control choice for many businesses.
2.3.4.2 Specification
18
Supported frequencies: Quad Band (850 / 950 / 1800 /1900 MHz)
Antenna connector: IPX
Status signaling: LED
Working temperature range: -40 do + 85 ° C
19
LCD modules are very commonly used in most embedded projects, the reason being
its cheap price, availability and programmer friendly. Most of us would have come
across these displays in our day to day life, either at PCO’s or calculators. The
appearance and the pinouts have already been visualized above now let us get a bit
technical.
16×2 LCD is named so because; it has 16 Columns and 2 Rows. There are a lot of
combinations available like, 8×1, 8×2, 10×2, 16×1, etc. but the most used one is the
16×2 LCD. So, it will have (16×2=32) 32 characters in total and each character will
be made of 5×8 Pixel Dots. Now, we know that each character has (5×8=40) 40 Pixels
and for 32 Characters we will have (32×40) 1280 Pixels. Further, the LCD should
also be instructed about the Position of the Pixels. Hence it will be a hectic task to
handle everything with the help of MCU, hence an Interface IC like HD44780is used,
which is mounted on the backside of the LCD Module itself. The function of this IC is
to get the Commands and Data from the MCU and process them to display
meaningful information onto our LCD Screen. You can learn how to interface an
LCD using the above mentioned links. If you are an advanced programmer and would
like to create your own library for interfacing your Microcontroller with this LCD
module then you have to understand the HD44780 IC is working and commands
which can be found its datasheet.
20
2 Vdd (+5 Powers the LCD with +5V (4.7V – 5.3V)
Volt)
7 Data Pin 0
Data pins 0 to 7 forms a 8-bit data line. They can be
connected to Microcontroller to send 8-bit data.
These LCD’s can also operate on 4-bit mode in such
case Data pin 4,5,6 and 7 will be left free.
8 Data Pin 1
9 Data Pin 2
10 Data Pin 3
11 Data Pin 4
12 Data Pin 5
13 Data Pin 6
14 Data Pin 7
21
16 LED Backlight LED pin negative terminal
Negative
2.3.7 Buzzer
22
LM7805 is a voltage regulator IC. This IC belongs to LM78XX series. This series of
fixed-voltage integrated-circuit voltage regulators is designed for a wide range of
applications. These applications include on-card regulation for elimination of noise
and distribution problems associated with single-point regulation. Each of these
regulators can deliver up to 1.5 A of output current. The internal current-limiting and
thermal-shutdown features of these regulators essentially make them immune to
overload. In addition to use as fixed-voltage regulators, these devices can be used
with external components to obtain adjustable output voltages and currents, and also
can be used as the power-pass element in precision regulators.
23
The input capacitor 0.33uF is a ceramic capacitor that deals with input inductance problem and the
output capacitor 0.1uF is also a ceramic capacitor that adds to the stability of the circuit. These
capacitors should be placed close to the terminals for them to work effectively. Also they should
be of ceramic type, since ceramic capacitors are faster than electrolytic.
Here, the input voltage can be anywhere between 9V-25V, and the output voltage can be adjusted
using the value of resistance R1 and R2. The value can be calculated using the below formulae.
Constant +5V output regulator to power microcontrollers and sensors in most of the
projects
Adjustable Output Regulator
Current Limiter for certain applications
Regulated Dual Supply
Output Polarity-Reversal-Protection Circuit
24
2.3.8.6 Pin Configuration
25
With the development of small, light, thin, multi-functional and high-density
electronic products, the integration and assembly density of components on the boards
are more and more high, as well as power dissipation is more and more large, so the
heat dissipation has a great demand on PCB substrates. There will be overheated for
the components on the board if the substrates have a poor dissipation, which will lead
to the unreliability of whole machine. So the PCB substrate come into being.
Copper clad laminate (CCL), the PCB substrates in PCB manufacturing, which is the
most widely and importantly used to fabricate the boards. And the copper clad
laminate is a kind of material that soak in resin with the electronic glass fiber or other
reinforcing material to make with copper clad on either one side or both sides. what's
26
2) Glass fiber cloth base CCL (such as FR-4, FR-5)
3) Compound CCL ( such as CEM-1, CEM-3)
4) Special material base CCL (such as metal-base CCL, ceramic-base CCL and so on)
1) Phenolic resin CCL (such as XPC, XXXPC, FR-1, FR-2 and so on)
2) Epoxy resin CCL (FR-3)
3) Polyester resin CCL
3. Classified by performance:
27
Chapter 3: System Design
To complete our project, we need many types of software, most important of them are
following
1. Arduino IDE-1.8.9
3.2 Software
The software that is used to program the microcontroller is open-source-software and
can be downloaded for free on www.arduino.cc. With this “Arduino software” we can
write little programs with the microcontroller. These programs are called “Sketch”.
In the end the sketches are transferred to the microcontroller by USB cable. More on
that later on the subject “programming”.
28
Fig. 3.1: Program installation process -1
At the moment the Arduino wasn’t connected to the PC. If we now choose “Port”,
under the field “Tool”, we will already see one or more ports here (COM1/ COM2/
COM3…). The quantity of the shown ports doesn't depend on the quantity of the USB
ports on the computer. When the board gets connected to the computer, we will find
one more port.
29
Fig. 3.2: Program installation process -2
30
3.3 Programming
Compile: Compile means to translate the sketch into machine language, also known
as object.
Code Run: Arduino sketch is executed as soon as terminates the step of uploading on
the board.
31
3.4 Hardware Implementation
1st we programed our circuit and then we connect as like the circuit diagram. Where
LCD is connected to A0-A5 and GSM is connected to D3 and D4 and RFID Receiver
is connected to D9 to D12 and a buzzer is connected to pin D5 through a transistor.
32
Chapter 4: Conclusion
Equipment Price
Crystal Oscillator 40
Buzzer 20
CCB 160
Others 500
33
4.3 Advantages
4.4 Conclusion
34
References
[1] Chitresh, S and Amit K (2010),”An efficient Automatic Attendance Using
Fingerprint Verification Technique ”,International Journal on Computer Science and
Engineering (IJCSE),Vol. 2 No. 2,pp 264-269.
[5] Nambiar A.N. (2009),” A supply chain perspective of RFID Systems”, World
Academy of Science, Engineering and Technology Journal, Volume 6,pp1-5.
[7] Dawes A.T. (2004),”Is RFID Right for Your Library”, Journal of Access Services,
Volume 2(4), pp 7-13.
35
Appendix
Programming Code
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
#include <SPI.h>
#include <MFRC522.h>
String msgs[] = {
"Dear parents, your child is present in school.",
"Dear parents, your child is absent for last 2days.",
};
// ---------------------------------------------------
String numbers[TOTAL_ID] = {
"01738462211",
"01768077482",
"01773115252",
};
byte cardID[TOTAL_ID][4] = {
{0x73, 0xC1, 0x66, 0x1B,},
{0x73, 0xC1, 0x34, 0x1B,},
{0x72, 0xC1, 0xCE, 0x1F,},
};
// ---------------------------------------------------
byte newCard[4];
byte dayCount;
byte absentCount[TOTAL_ID];
36
bool presentCount[TOTAL_ID];
bool smsFlag[TOTAL_ID];
bool smsFlag2[TOTAL_ID];
long ct;
void setup() {
Serial.begin(9600);
gsm.begin(9600);
SPI.begin();
rfid.PCD_Init();
lcd.begin(16, 2);
pinMode(buzz, OUTPUT);
lcd.clear();
GSMinit();
ct = millis();
}
void loop() {
int ID = checkRFID();
if (ID == -2) {
lcd.setCursor(0, 1);
lcd.print(F("Unauthorised!! "));
delay(1500);
}
else if (ID != -1) {
lcd.setCursor(0, 1);
lcd.print(names[ID]);
if (!presentCount[ID]) {
presentCount[ID] = 1;
if (!smsFlag[ID]) {
sendSMS(numbers[ID], msgs[0]);
smsFlag[ID] = 1;
}
}
else delay(1500);
}
else {
lcd.setCursor(0, 1);
lcd.print(F("Put your ID card"));
}
lcd.setCursor(0, 0);
lcd.print(F("RFID Attandance "));
37
for (byte i = 0; i < 4; i++) newCard[i] = 0;
Serial.print(F("ABSENT: "));
for (byte i = 0; i < TOTAL_ID; i++) {
if (presentCount[i] == 0) absentCount[i]++;
Serial.print(absentCount[i]);
Serial.print(' ');
if (absentCount[i] == ABSENT_SMS_DAY && !smsFlag2[i]) {
sendSMS(numbers[i], msgs[1]);
smsFlag2[i] = 1;
}
presentCount[i] = 0;
smsFlag[i] = 0;
}
Serial.println();
dayCount++;
if (dayCount == ABSENT_SMS_DAY) {
dayCount = 0;
for (byte i = 0; i < TOTAL_ID; i++) {
absentCount[i] = 0;
smsFlag2[i] = 0;
}
}
ct = millis();
}
}
int checkRFID() {
int found = -1;
if (!rfid.PICC_IsNewCardPresent()) return -1;
if (!rfid.PICC_ReadCardSerial()) return -1;
beep(100);
// matching IDs
for (byte i = 0; i < TOTAL_ID; i++) {
if (newCard[0] == cardID[i][0] && newCard[1] == cardID[i][1] && newCard[2]
== cardID[i][2] && newCard[3] == cardID[i][3]) {
38
found = i;
break;
}
else found = -2;
}
}
else Serial.println(F("PREVIOUS CARD!"));
rfid.PICC_HaltA();
rfid.PCD_StopCrypto1();
return found;
}
void GSMinit() {
lcd.print("Connecting GSM..");
delay(5000);
gsm.println("AT");
delay(1000);
gsm.println("ATE0");
delay(1000);
gsm.println("AT+CMGF=1");
delay(1000);
gsm.println("AT+CNMI=1,2,0,0,0");
delay(1000);
lcd.clear();
}
void beep(int d) {
digitalWrite(buzz, 1);
delay(d);
39
digitalWrite(buzz, 0);
}
40