Classroom Monitoring Using RFID
Classroom Monitoring Using RFID
We declare that this project is the original work of us, that has not been done earlier either to this
or any other universities, and all required sources of materials used for the project is fully available
and acknowledged.
This Project has been submitted for examination with approval of a university advisor.
i
Acknowledgment
We are extremely grateful to the faculty of Electrical and Computer Engineering, for giving us the
opportunity to carry out this project, which is taken and considered as one course in the curriculum.
We would like to express our earnest gratitude and regards to our project advisor, Mr. Gashaw
M., lecturer in stream of Communication and Electronics systems Faculty of Electrical and
Computer Engineering, for being the corner stone of our project to reach this simulation result. It
is his continuous encouragement, invaluable supervision, perpetual motivation, guidance and basic
comments from the beginning of the project to reached this last simulation result, and successful
documentation preparation as well as readiness of us for this project presentation.
Finally, we extend our gratefulness to one and all who are directly or indirectly involved in the
successful completion of this project work to this simulation.
ii
Table of Contents
Declaration and Approval of the project ........................................................................................................ i
Acknowledgment .......................................................................................................................................... ii
List of Figure................................................................................................................................................. v
List of Table ................................................................................................................................................. vi
Abstract ....................................................................................................................................................... vii
List of Acronyms ....................................................................................................................................... viii
CHAPTER ONE ........................................................................................................................................... 1
1. INTRODUCTION .................................................................................................................................... 1
1.1 Background Information ..................................................................................................................... 2
1.1.2 RFID Technology Overview .......................................................................................................... 2
1.1.2 Related RFID Applications ............................................................................................................ 5
1.2 Statement of the Problem .................................................................................................................... 6
1.3 Objectives of the Project ..................................................................................................................... 7
1.3.1 General Objective ........................................................................................................................ 7
1.3.2 Specific Objectives ....................................................................................................................... 7
1.4 Methodology Used in this Project ....................................................................................................... 8
1.6 Scope of the Project ............................................................................................................................ 9
CHAPTER TWO ........................................................................................................................................ 10
2. REVIEW OF RELATED LITERATURES ............................................................................................ 10
CHAPTER THREE .................................................................................................................................... 12
3. SYSTEM DESIGN AND ANALYSIS ................................................................................................... 12
3.1 System Components and Operations ................................................................................................ 12
3.1.1 System Components .................................................................................................................. 12
3.1.2 System Operations ..................................................................................................................... 14
3.2. System Design and Analysis ............................................................................................................ 20
3.2.1 Hardware Design and Analysis explanation ............................................................................... 20
3.2.2 Software Program Development Analyses ................................................................................ 23
CHAPTER FOUR....................................................................................................................................... 33
4. RESULTS AND DISCUSSIONS ........................................................................................................... 33
4.1. Software simulation results and discussions .................................................................................... 33
4.2.2 Discussion................................................................................................................................... 42
iii
CHAPTER FIVE ........................................................................................................................................ 43
5. CONNCLUSION AND RECOMMENDATIONS FOR FUTURE WORK .......................................... 43
5.1 Conclusion ........................................................................................................................................ 43
5.2 Recommendations for Future work................................................................................................... 44
REFERENCES ........................................................................................................................................... 45
iv
List of Figure
Figure 1. 1: Passive RFID System .................................................................................................. 3
Figure 3. 3: the circuit diagram of RFID based classroom monitoring system ............................ 20
Figure 3. 4: the IC driver connections with the motor and the microcontroller ........................... 22
Figure 3. 5:flow chart of the program of RFID based classroom monitoring system .................. 23
v
List of Table
Table 1. 1 : RFID System Characteristics ....................................................................................... 4
vi
Abstract
We know in offices, shopping malls and in many other places where only the person with
authorization card is allowed to enter the room. These systems use RFID communication system.
RFID is used in shopping malls to stop theft as the products are tagged with RFID chip and when
a person leaves the building with the RFID chip an alarm is raised automatically. The RFID tag is
designed as small as part of sand. The RFID authentication systems are easy to design and are
cheap in cost. Some schools and colleges nowadays use RFID based attendance systems. In this
project we are going to design a RFID Based Class Room Monitoring System for security
purposes. So, this system open gates and allow people only with the authorized RFID tags. The
authorized tags holder ID’s are programmed in to the ATMEGA Microcontroller and only those
holders are allowed to leave or enter the premises.
vii
List of Acronyms
ASCII............................................American Standards Code Information for Interchange
ATM………..................................Automatic Teller Machine
BiT……….....................................Bahir Dar Institute of Technology
B.Sc.………………………………Bachelor of science
CPU………………………………Central Processor Unit
DC..................................................Direct Current
EEPROM.......................................Electrically Erasable Programmed Read Only Memory
EPC………………………………Electronic Product Code
HEX..............................................Hexadecimal
IC..................................................Integrated Circuit
IDE……………………………. ..Integrated development environment
INSA…………………………….Information Network Security Agency
IR………………………………..Infrared ray
ISP…………………………….....In system Programming
JTAG............................................Joint Test Action Group
LCD……………………………..Liquid Crystal Display
LED……………………………. Light Emitted diode
RAM……………………………Random Accesses Memory
RFID……………………………Radio-Frequency Identification
RS.................................................Register Selection
RXD.............................................Received Data
UHF……………………………..Ultra High Frequency
UPC……………………………..Universal Product Code
viii
ix
x
xi
CHAPTER ONE
1. INTRODUCTION
The last decade has shown an enormous increase in RFID applications and techniques. Fueled by
large retail corporations requiring suppliers to use RFID systems in their supply chains (Weinstein,
2005), the technology is continuously uncovering new purposes and functions. No longer is RFID
just an improvement to bar codes; it is being used to track livestock, indicate when food has gone
bad, and make quick purchases with cell phones.
A Barcode is an optical machine which is a readable representation of data or information and the
information which the Barcode contains is about the object which is attached to the barcode.
Barcode reader uses a laser beam and the reader translates information from the image to digital
data and sends it to the computer. The very first scanning of the Universal Product Code (UPC)
Barcode back in 1974. Barcodes consist of small images of lines or bars affixed on many items in
order to identify a particular product number, person or location.
The RFID device serves the same purpose as a bar code or a magnetic strip on the back of a credit
card or ATM card; it provides a unique identifier for that object. And, just as a bar code or magnetic
strip must be scanned to get the information, the RFID device must be scanned to retrieve the
identifying information.
A significant advantage of RFID devices over the others mentioned above is that the RFID device
does not need to be positioned precisely relative to the scanner. We're all familiar with the
difficulty that store checkout clerks sometimes have in making sure that a barcode can be read.
And obviously, credit cards and ATM cards must be swiped through a special reader.
In contrast, RFID devices will work within a few feet (up to 20 feet for high-frequency devices)
of the scanner. For example, you could just put all of your groceries or purchases in a bag, and set
the bag on the scanner. It would be able to query all of the RFID devices and total your purchase
immediately.
RFID technology has been available for more than fifty years. It has only been recently that the
ability to manufacture the RFID devices has fallen to the point where they can be used as a
"throwaway" inventory or control device.
1
One reason that it has taken so long for RFID to come into common use is the lack of standards in
the industry. Most companies invested in RFID technology only use the tags to track items within
their control; many of the benefits of RFID come when items are tracked from company to
company or from country to country.
RFID stands for Radio-Frequency Identification. The acronym refers to small electronic devices
that consist of a small chip and an antenna. The chip typically is capable of carrying 2,000 bytes
of data or less.
2
Figure 1. 1: Passive RFID System
Similarly, a semi-passive system reflects the signal from the antenna, but the backscatter signal it
sends back is much more powerful because the tag is attached to a small battery. This battery
provides the power to transmit the signal back to the reader, increasing its range.
3
Figure 1. 3: Active RFID System
Since for this project it is necessary to use passive RFID, we concern on it. Within passive RFID
systems, there are three frequency bands available: Low Frequency (LF), High Frequency (HF),
and Ultra High Frequency (UHF). Table 1.1 shows that when compared to semi-passive and active
systems, these three passive systems have much shorter read ranges, ranging from 1 cm to 10 m,
because their backscattered signal is not battery powered. While this is a disadvantage of passive
systems, the pivotal distinction in the comparison of passive and active systems for the purpose of
a classrooms and/dormitories mentoring system is the price of individual tags. An active tag is
generally a magnitude of one hundred times more expensive than a passive tag, usually costing
around $15, compared to a passive tag for $.15. For this project to implement in low cost for
appropriate short distance we use passive LF as RFID system characteristic generalized in table
1.1 below.
4
1.1.2 Related RFID Applications
In addition to the above discussed project, here we are giving some more applications of RFID
system for the reader for understanding purpose.
The system is designed to provide security in an organization by allowing only the authorized
persons to access the secure area. The main priority is the security in any organization. The
authorized persons are assigned with RFID tags that allow them into the secured premises.
The RFID tag consists of an integrated circuit, which is used for storing and processing the data,
modulating and demodulating the radio frequency signal that is to be transmitted. When a person
shows the RFID tag in front of the RFID reader and the reader reads the data and compares the
data stored in the system. If the data matches with the stored data, the system authorizes the person
and allows to enter into the secured area so that the person can take control of various devices. The
system also displays the result on the LCD. If it finds the provided information mismatched then,
it alerts an unauthorized entry with a buzzer sounds as an indication of entering or providing wrong
information.
Searching and arrangement of misplaced books is a difficult task often carried out by the library
personnel. Many times, Librarians busily search the improperly placed books or books wrongly
placed by the library users and students in the library of a school, office or college. And often find
this task very difficult. To overcome this problem, an RFID based intelligent book tracking system
has been developed for monitoring the books in the library through wireless communication
between the RFID reader and the books. This system consists of RFID tag and RFID reader to
detect the information about the books placed in the library.
The proposed system performs the following actions such as detecting, billing and accounting for
vehicles as they pass through a toll gate within the frequency range between 30 kHz and 2.5GHz.
In this system, an RFID tag is programmed with the vehicle owner’s information in the form with
5
an EPC (electronic product code) that can ensure to read the data at certain distances and detects
the vehicle in order to enhance a transaction.
A Passport system can become intelligent enough by the implementation of RFID technology to
it. In this system, passport service issues RFID tag to eligible citizen, which contains passport
details like name, address, nationality, passport number, and other relevant data. During the time
of authentication, the RFID card reader reads that information and compares it with the data stored
in the passport database. If it finds to be matched, then it will allow for further precedence,
otherwise it alerts the authorities as fake details. This is all about the RFID based attendance system
project and RFID based applications.
6
1.3 Objectives of the Project
1.3.1 General Objective
The main goal of this project is: -
to design and develop low cost secured RFID based class rooms and dormitories mentoring
system for BiT.
To know more and get better understanding about RFID based communication and
ATmega32 microcontroller working principles.
7
1.4 Methodology Used in this Project
Experimentation and testing is necessary to evaluate the accuracy and characteristics of each
proposed system. The results from the experiments provide vital information that can be used to
perfect the configuration of each system as well as choose the optimal design for a given
condition.
Step1: Review related literatures: since it is a critical look at the related projects or researches
that is significant to the project that we are carrying out, we were seen and analyze necessary
literatures, some many videos, and many other important references.
Step2:-Design the circuit diagram on the paper: - first we tried to design the circuit on the paper.
Step3: - Analyze the Circuit Diagram: - before design the circuit on a software, we concentrate
on components analysis and their connections as well as their locations on the circuit diagram, and
select appropriate software.
Step 4: - Design the circuit with on the Software: - the schematic capture designed on selected
proteus electronics circuit design software for simulation.
Step 5: - Write C-program code on software: - After selecting appropriate C program and Atmel
studio 6.1 software; we wrote the C-program code on Atmel studio 6.1 software and run it, and
then by taking many correction mechanisms we run it correctly.
Step 6: -Simulate the circuit to check whether it is properly working or not: - since testing is
necessary to evaluate the accuracy and characteristics of each proposed system, by loading the hex
file program on the design circuit we simulated it, and by taking many correction mechanisms we
tried to check its properly working.
8
Step 7: - Future investigation: - even we stop on simulation; we also investigate that, if it is
allowed to do it for final B.Sc. project, by taking some improvement on it to implement practically
for any necessary entrance gates; we will have the following two different approaches to
implement practically this project.
Currently, after developing its C-code program on Atmel studio 6.1 software, and designing the
circuit on Proteus software, this “design and develop low cost secured RFID based classrooms and
dormitories mentoring system for BiT” project is reached at the successes full simulation result.
9
CHAPTER TWO
A number of related works exist in literature, application of RFID Technology to different areas
and specifically to the area of academic attendance monitoring problem.
We develop this project, after analysis deeply explained below related literatures, and other
necessary references; and then relating these to our project idea.
i. In [1], many systems have been developed and tested that are able to construct a prototype
user interface that an instructor can efficiently utilize as a classroom management tool.
ii. In [3], the paper presents the integration of ubiquitous computing systems into classroom
for managing the students’ attendance using RFID technology. RFID technology can be a
powerful tool in helping to manage student’s attendance throughout the working school
day and also enhance classroom security. RFID technology has been applied to solve
problems where it is necessary to take automatically record the movements and locations
of students in a classroom of school/university environment. A real time intelligent system
is implemented in conjunction with RFID hardware to record students’ attendance at
lectures and laboratories in a school/university environment.
iii. In [4], authors designed and implemented a model of a secured and portable embedded
reader system to read the biometric data from the electronic passport. The authors
attempted to solve problems of reliability, security and privacy in E-passports by
authenticating holder online using Global System of Mobile Communications (GSM)
network. The GSM network is the main interface between identification center and the
passport reader. The communication data is protected between server and e-passport reader
by using AES to encrypt data for protection while transferring through GSM network.
iv. Author in [5] reviewed the current research application of RFID to different areas with
emphasis on application for supply chain management and developed a taxonomic
framework to classify literature which enables swift and easy content analysis to help
identify areas for future research.
10
v. In [6], an automated attendance management system was implemented both in electronic
and mobile platform using stationary matrix AR 400 RFID reader with four circulatory
polarized antenna and Symbol MC9000-G handheld RFID reader respectively. In the
electronic platform, the attendance management system depicts a simple client (antennae
placed at classroom entrance) /server (privileged student database) system. Students can
visually see their names as they entered class on the screen and they are assured that their
presence has been entered in the instructor’s database. However, one important drawback
about this system is the RFID tag read rates degrade tremendously as it comes closer to
electronic devices.
11
CHAPTER THREE
ATmega32 microcontroller,
power supply (5v),
AVR-ISP Programmer,
JHD_162ALCD (16x2 LCD module),
100uF capacitor (connected across power supply),
button,
10KΩ resistor,
100nF capacitor,
LED (two pieces),
EM-18 (RFID reader module),
L293D motor driver IC,
5V DC motor,
And gate.
Now, we try to explain more in detail about some of most important components as follows.
A). RF Module Transmitter & Receiver: - RFID stands for Radio-Frequency Identification. The
acronym refers to small electronic devices that consist of a small chip and an antenna. RFID
module have transmitter and receiver modules. The chip typically is capable of carrying 2,000
bytes of data or less.
Generally, the wireless systems designer has two overriding constraints: it must operate over a
certain distance and transfer a certain amount of information within a data rate. The RF modules
are very small in dimension and have a wide operating voltage range i.e. 3V to 12V. Basically the
RF modules are 433 MHz RF transmitter and receiver modules. The transmitter draws no power
when transmitting logic zero while fully suppressing the carrier frequency thus consume
significantly low power in battery operation. When logic one is sent, carrier is fully on to about
4.5mA with a 3volts power supply. The data is sent serially from the transmitter which is received
12
by the tuned receiver. Transmitter and the receiver are duly interfaced to two microcontrollers for
data transfer.
Some features of RF Module: - Receiver has frequency: 433MHz, typical frequency: 105Dbm,
supply current: 3.5mA, low power consumption, receiver operating voltage: 5v, and transmitter
has frequency range: 433.92MHz, supply voltage :3v~6v, and output power 4v~12v.
433MHz RF Transmitter and Receiver: - In many projects, we use RF modules for transmit and
receive the data because it has high volume of applications than IR. RF signals travel in the
transmitter and receiver even when there is an obstruction. It operates at a specific frequency of
433MHz.
RF transmitter receives serial data and transmits to the receiver through an antenna which is
connected to the 4th pin of the transmitter. When logic 0 applied to transmitter then there is no
power supply in transmitter. When logic 1 is applied to transmitter then transmitter is ON and there
is a high-power supply in the range of 4.5mA with 3V voltage supply.
Some features of RF Transmitter and Receiver:- Receiver has frequency: 433MHz, typical
sensitivity: 105Dbm, current supply 3.5mA, operating voltage: 5V, low power consumption, and
transmitter has frequency range: 433.92MHz, supply voltage: 3V~6Vand output power:
4~12Dbm.
It has many applications in various areas like Remote lighting controls, long range RFID, wireless
alarm and security systems, etc.
B). LCD (Liquid Crystal Display): - LCD (Liquid Crystal Display) screen is an electronic display
module and find a wide range of applications. A 16x2 LCD display is very basic module and is
very commonly used in various devices and circuits. These modules are preferred over seven
13
segments and other multi segment LEDs. The reasons being: LCDs are economical; easily
programmable; have no limitation of displaying special & even custom characters (unlike in seven
segments) animations and so on. A 16x2 LCD means it can display 16 characters per line and
there are 2 such lines. In this LCD, each character is displayed in 5x7 pixel matrix. This LCD has
two registers, namely, Command and Data. The command register stores the command instructions
given to the LCD. A command is an instruction given to LCD to do a predefined task like
initializing it, clearing its screen, setting the cursor position, controlling display etc. The data
register stores the data to be displayed on the LCD. The data is the ASCII value of the character
to be displayed on the LCD.
D). L293D IC: - is an H-BRIDGE IC designed for driving low power DC motors and is shown
in figure, this IC consists two h-bridges and so it can drive two DC motors. So, this IC can be
used to drive robot motors from the signals of microcontroller.
LED blinks,
Open the gate (in case motor) if the card is tagged, doesn’t open if the card is not tagged.
14
The simple system operation of our project in simple block diagram is as shown below.
The data sent by the RFID module goes as, RS232 interface format as putted below:
Ten ASCII data (card number) + two ASCII data (XOR result)
1) Data baud rate: 9600BPS
2) Data bit: byte
3) Parity checker: none
4) Stop bit: one bit
For this system, we have used 8bit communication. However, this is not a compulsory and we
can use 4bit communication, but with 4bit communication program becomes a bit complex, so
we preferred 8-bit communication.
The above features are set in the controller registers; we are going to discuss these briefly by
starting from there visualize representation as shown below.
15
Figure 3. 2 :USART Control and Status Register B and C
As their name is putted in right side of each, the above shown are USART control and status
register B-UCSRB and USART control and status register C-UCSRB of the microcontroller 8
bit registers. To see these in detail;
A). RED (RXEN): This bit represents receive data feature. This bit must be set for the data from
the module to be received by the controller. It also enables RXD pin of controller.
B). BROWN (RXCIE): This bit must be set for getting an interrupt after successful data reception.
By enabling this bit, we get to know, right after 8-bit data receive.
C). PINK (URSEL): This bit must be set before enable other bits in UCSRC. After setting, other
needed bits in UCSRC, URSEL must be disabled or put to zero.
D). YELLOW (UCSZ, UCSZ, UCSZ2): These three bits are used for selecting the number of
data bits we are receiving or sending in a single go. There bit setting mechanism is shown below
table 3.1.
16
Table 3. 1: UCSZ Bits Settings
Since the data sent by RFID module is 8bit data type, we have to set UCSZ0, UCSZ1 to one and
UCSZ2 to zero.
E). ORANGE (UMSEL): This bit is set based on whether the system is communicating
asynchronously (both use different clock) or synchronously (both use same clock). Their bit
setting mechanism is shown below table 3.2.
Since module and controller use different clock, this bit must be set to zero or left alone as they
are all set to zero by default.
F). GREEN (UPM1, UPM0): These two bits are adjusted based on bit parity we are using in
communication. Their bit setting mechanism is shown below table 3.3.
17
Table 3. 3:UPM Bits Settings
Since RFID module sends data with no parity, we have set both UPM1, UPM0 to zero or they
can be left alone as all bits in any registers are set to zero by default.
G). BLUE (USBS): This bit is used for choosing the number of stop bits we are using during
communication. Their bit setting mechanism is shown below table 3.4.
Since RFID module sends data with one stop bit, we just have to leave USBS bit alone. Now at
last we need to set the baud rate, from figure above it is clear that the RFID module sends data to
controller with a baud rate of 9600bps (bits per second). The baud rate is set in controller by
choosing the appropriate UBRRH as their visualization view seems like shown below table 3.5.
18
The UBRRH value is chosen by cross referring baud rate and CPU crystal frequency, So by cross
reference UBRR value is seen as ‘6’, and so the baud rate is set as examples of settings for
commonly used oscillator frequencies are shown below table 3.6.
Now as shown in figure 3.4 below, two pins from controller goes to L293D, which is a H-
BRIDGE used to control speed and direction of rotation for low power DC motors.
L293D is an H-BRIDGE IC designed for driving low power DC motors and, this IC consists two
h-bridges and so it can drive two DC motors. So, this IC can be used to drive robot motors from
the signals of microcontroller.
Whenever an authorized card is brought near the module, the LCD display the card number, the
LED blinks and the motor is programmed to move clockwise 90 degree for a second, to show the
classroom gate is opened, and after a second it comes back, telling the room gate is closed.
19
3.2. System Design and Analysis
For easy of design and analysis, we explained separately about hardware design analysis
explanation first, and the about software program development design and analysis in detail.
3.2.1 Hardware Design and Analysis explanation
After understanding the working operation of this project by using different references and
watching video tutorials, we got and choose the following circuit diagram that can be taken for
RFID based classroom monitoring system, and help us for our project hardware design analysis
and to develop the simulation design on Proteus. [8]
20
In System circuit shown above, PORTA of ATMEGA32 is connected to data port of LCD. Here
we should remember to disable the JTAG communication in PORTC to ATMEGA by changing
the fuse bytes, if we want to use the PORTC as a normal communication port.
In 16x2 LCD, there are 16 pins over all if there is a back light, if there is no back light there will
be 14 pins. We can power or leave the back-light pins. Now in the 14 pins there are 8 data pins
(7-14 or D0-D7), 2 power supply pins (1&2 or VSS & VDD or gnd& +5v), 3rd pin for contrast
control (VEE-controls how thick the characters should be shown), 3 control pins (RS & RW &
E). In the circuit, we have only taken two control pins. This gives the flexibility of better
understanding. The contrast bit and READ/WRITE are not often used so they can be shorted to
ground. This puts LCD in highest contrast and read mode. We just need to control ENABLE and
RS pins to send characters and data accordingly.
The connections which are made for LCD are: - PIN1 or VSS to ground, PIN2 or VDD or VCC to
+5v power, PIN3 or VEE to ground (gives maximum contrast best for a beginner), PIN4 or RS
(Register Selection) to
PD6 of MCU, PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the
communication for user), PIN6 or E (Enable) to PD5 of Microcontroller, PIN7 or D0 to PA0, PIN8
or D1 to PA1, PIN9 or D2 to PA2, PIN10 or D3 to PA3, PIN11 or D4 to PA4, PIN12 or D5 to
PA5, PIN13 or D6 to PA6, and PIN14 or D7 to PA7.
In the circuit, we have used 8bit communication (D0-D7). However, this is not a compulsory
and we can use 4bit communication (D4-D7) but with 4-bit communication program becomes a
bit complex, so we preferred 8-bit communication. So, from mere observation we are connecting
10 pins of LCD to controller in which 8 pins are data pins and 2 pins for control.
Now for the RFID module interface, the following features are required:
2. Since the communication is serial we need to know whenever the data byte is received, so that
we can stop the program until complete byte is received. This is done by enabling a data receive
complete interrupt.
3. RFID sends data to controller in 8bit mode. So, two characters will be sent to the controller at
a time.
21
4. From above figure 3.3, there are no parity bits, one stop bit in the data sent by the module.
Now as discussed before that IC driver has ability to change the direction of rotation of DC motor.
This is achieved by controlling the voltage levels at INPUT1 and INPUT2 as the analysis is show
below table 3.7.
So as shown in above table 3.7, for clock wise rotation 2A should be high and 1A should be low.
Similarly, for anti-clockwise 1A should be high and 2A should be low.
Figure 3. 4: the IC driver connections with the motor and the microcontroller
L293D is an H-BRIDGE IC designed for driving low power DC motors and is shown in figure
3.4 above, this IC consists two h-bridges and so it can drive two DC motors. So, this IC can be
used to drive robot motors from the signals of microcontroller.
22
3.2.2 Software Program Development Analyses
In the development cycle of the system, decisions were made on the parts of the system to be
realized in the hardware design and the parts to be implemented in software. The software is
decomposed into modules so that each module can be individually tested as a unit and debugged
before the modules are integrated and tested as a software system in order to ensure that the
software design meets its specification. The program was written in C programming language
Atmel studio. The program was developed first by developing the flow chart of the program by
analyzing the working principle of the system.
Figure 3. 5:flow chart of the program of RFID based classroom monitoring system
23
By analyzing the above developed flow chart (shown in figure 3.5), we developed the appropriate
C-program code on selected Atmel studio 6.1 software. The reason that why we select this C-
program code and Atmel studio 6.1 software is that after we tried to use some program codes and
softwares; we got these (C-program code and Atmel studio 6.1 software) simple for us and run
our developed program correctly after some try and correction processes.
Now, first we put the final developed program code that runs correctly on Atmel studio 6.1
software , and then we try to the explain how this program works.
#include <avr/io.h>
#define F_CPU 1000000
#include <util/delay.h>
#include <stdlib.h>
#define enable 5
#define registerselection 6
int main(void)
{
DDRA = 0xFF;
DDRB = 0b11111111;
PORTB|=(1<<PINB0)|(1<<PINB1);
DDRD = 0b11111110;
_delay_ms(50);
UCSRB |=(1<<RXEN)|(1<<RXCIE);
UCSRC |=(1<<URSEL)|(1<<UCSZ0)|(1<<UCSZ1);
UCSRC &=~(1<<UMSEL);
UBRRH &=~(1<<URSEL);
UBRRL=6;
char ADMIT [5][4]={{(0x26),(0x66),(0x26),(0x26)},{(0x66),(0x62),(0x66),(0x66)}};
24
int16_t COUNTA = 0;
char SHOWA [4];
int i=0;
25
COUNTA=UDR;
itoa(COUNTA,SHOWA,16);
send_a_string(SHOWA);
MEM[2]=COUNTA;
while(!(UCSRA&(1<<RXC)));
{
}
COUNTA=UDR;
itoa(COUNTA,SHOWA,16);
send_a_string(SHOWA);
MEM[3]=COUNTA;
send_a_string(" ");
send_a_command(0x80 + 0x40 + 0);
UCSRB &=~(1<<RXEN);
for (i=0;i<2;i++)
{
if
((MEM[0]==ADMIT[i][0])&(MEM[1]==ADMIT[i][1])&(MEM[2]==ADMIT[i][2])&(MEM[
3]==ADMIT[i][3]))
{
PORTB|=(1<<PINB3);
PORTB&=~(1<<PINB0);
_delay_ms(460);
PORTB|=(1<<PINB0);
PORTB&=~(1<<PINB1);
_delay_ms(460);
PORTB&=~(1<<PINB3);
PORTB|=(1<<PINB1);
}
}
UCSRB |=(1<<RXEN);
26
}
}
B). Developed C-Code Program working explanation: - The working principle of RFID based
classroom and dormitories monitoring system that we designed is best explained in step by step
of C-code program give below. We put the line to line explanation for the code of this RFID
27
based classroom and dormitories monitoring system. This helps to easily understand the concept
and working principle of this project by reading the code given below, for any other reader of this
document. This C- Code program with each line by line explanation seems like as follows;
For Practical implementation, the cards are tagged and controlled by the program. To see some
examples how cards tagged on the program;
28
1).If we want to authorizing only five cards, and these can be changed to any number code seems
like put shown.
char ADMIT
[5][4]={{(0x97),(0xa1),(0x90),(0x92)},{(0x97),(0xa1),(0x90),(0x93)},{(0x97),(0xa1),(0x9
0),(0x94)},{(0x97),(0xa1),(0x90),(0x95)},{(0x97),(0xa1),(0x90),(0x96)}};
After this default program is dumped in the controller, we get the cards which should be
authorized. Place one after other near module, we get the ID for each one as xxxxxxxx
(907a4F87),
2). If we want to 7 tags we will have 7 eight-bit ID. */ , and the code is;
29
COUNTA=UDR; // UDR stores the eight-bit data received and is taken into an integer.
MEM [0] =COUNTA; // first two characters are updated to memory
Iota (COUNTA, SHOWA,16); //command for putting variable number in LCD(variable
number, in which character to replace, which base is variable(ten here as we are counting
number in base10))
Send a string (SHOWA); // telling the display to show character (replaced by variable
number) of second person after positioning the courser on LCD
While (! (UCSRA&(1<<RXC))) ;//wait till second eight bit data is received
{
}
COUNTA=UDR;
Ito a (COUNT A, SHOWA,16);
send_ a_ string(SHOWA);
MEM [1]=COUNTA; // third and fourth characters are updated to memory
while(!(UCSRA&(1<<RXC))); // wait till third eight bit data is received
{
}
COUNTA=UDR;
Itoa (COUNTA, SHOWA,16);
Send a string(SHOWA);
MEM [2] =COUNTA;// fifth and sixth characters are updated to memory
While (! (UCSRA&(1<<RXC))); //wait till fourth eight-bit data is received
{
}
COUNTA=UDR;
itoa (COUNTA, SHOWA,16);
Send a string(SHOWA);
MEM [3]=COUNTA;// seventh and eight characters are updated to memory
send a string (" ");
send a command (0x80 + 0x40 + 0);
30
UCSRB &=~(1<<RXEN);//disabling the receive data until the tag ID is checked
for authorization
for (i=0; i<5;i++)
{
If
((MEM[0]==ADMIT[i][0])&(MEM[1]==ADMIT[i][1])&(MEM[2]==ADMIT[i][2])&(MEM[3]
==ADMIT[i][3]))
{ // checking for authorization buy comparing two characters at a time with the characters in the
memory
PORTB|=(1<<PINB3); // if authorized turn the LED ON
PORTB&=~(1<<PINB0); // motor moves clockwise
_delay ms (220);//delay
_delay_ms(220);
_delay_ms(220);
_delay_ms(220);
_delay_ms(220);
_delay_ms(220);
PORTB|=(1<<PINB0);//motor clockwise movement stop
PORTB&=~(1<<PINB1);//motor anti clockwise movement start
_delay_ms(220);
_delay_ms(220);
_delay_ms(220);
_delay_ms(220);
_delay_ms(220);
_delay_ms(220);
PORTB&=~(1<<PINB3); //motor anti clockwise rotation stop
PORTB|=(1<<PINB1); //authorization LED off }
}
UCSRB |=(1<<RXEN); // enabling receive data from module
31
}
}
void send_a_command(unsigned char command)
{
PORTA = command;
PORTD &= ~ (1<<RS); // putting 0 in RS to tell lcd we are sending command
PORTD |= 1<<E; // telling lcd to receive commata at the port
_delay ms(50);
PORTD &= ~1<<E; // telling lcd we completed sending data
PORTA= 0;
}
void send_a character(unsigned char character)
{
PORTA= character;
PORTD |= 1<<RS; // telling LCD we are sending data not commands
PORTD |= 1<<E;//telling LCD to start receiving command/data
_delay_ms(50);
PORTD &= ~1<<E;//telling lcd we completed sending data/command
PORTA = 0;
}
void send_a_string(char *string_of_characters)
{
while(*string_of_characters> 0)
{
send_a_character(*string_of_characters++); }
}
32
CHAPTER FOUR
1.Selecting Parts from the Library: - The first thing we need to do is to get the parts from the
libraries that we need in our schematic. We can select parts from the library in one of two ways:
Click on the P button at the top left of the Object Selector as shown below. We can also use
the Browse Library icon on the keyboard shortcut for this command (by default this is the P
key on the keyboard) as shown in figure 4.1 below.
33
Right click the mouse on an empty area of the schematic and select Place Component - from
Libraries from the resulting context menu as shown below in Figure 4.2.
Either of these two methods will cause the Device Library Browser dialogue form to appear. In
the case of parts where you would know the part name its usually best to start the search with that.
2. Placing Objects on the Schematic: - Having selected the parts we need the next thing is to
actually place them on the drawing area – the Editing Window – and wire them together. You’ll
notice from the screenshot that we have also split the contents of the schematic into logical blocks
of circuitry. This is partly aesthetic but also reduces wiring clutter on the schematic and will allow
us to cover the use of terminals to form connections as we work throughout the project.
3. Wiring Up: - Having placed all the requisite components we now need to wire them together,
but there are a couple of items to note:
We cannot directly start a connection from an arbitrary point on a wire; we want to start
the connections from the pin and terminate them on the wire.
When you terminate the connection on another wire a junction dot will be placed
automatically to complete the connection.
34
4. Power Connections: - proteus supports a powerful scheme for making power connections
implicitly, thus vastly reducing the number of wires on the schematic.
By using the above steps, we have developed our project circuit diagram on proteus as shown
below in figure 4.4.
( Note that we had used the ac source to generate RF signals due to the lack of the EM-18 RF-
MODULE in the proteus software, and we use the AND gate as indicator for the closing of the
door for simulation purpose.)
Here we have selected Atmel Studio 6.1 software for c programming and its procedure are as
follows:
Installing tool for C programming
To program Atmel AVR microcontrollers using C, we need Atmel Studio software, which is freely
available from the company website. Atmel Studio is an integrated development environment that
includes the editor, C compiler, assembler, HEX file generator, and a microcontroller emulator.
Using Atmel Studio6.1 for C programming
35
We had created a simple C program for the Atmel AVR that allows the only authorized cards to
move dc motor. Next, we will be guided through four major stages:
First, creating an Atmel Studio project: - we Performed the following steps to create a simple
Atmel Studio project. Start the Atmel Studio 6.1 program by clicking its icon on the Windows
Desktop like as shown below in figure 4.5.
Second, Select the type of AVR Microcontroller:-In the ‘Device Selection’ dialog that appears
(shown in Figure 4.7), search for ATmega32 and then click button OK.
36
Note: In our project, we will use ATMEGA32 for both software simulation and hardware testing,
37
Figure 4. 8 :Shows the program is build successfully
Our program is build successful, and then the hex file is generated as shown in figure 4.9 above.
Now, we are going to discuss how we can get Hex File from ATmega32 microcontroller in proteus.
Double click on the ATmega microcontroller in proteus to get the hex file as shown in figure
4.10 below.
38
Choose program files as shown below in figure 4.11.
39
C). Run the simulation in proteus
After uploading the hex file, we run the whole simulation in proteus software. After running the
simulation on proteus running we got simulation running result by entering an unauthorized card,
and entering authorized card and waiting for a few minutes running as shown below in figure 4.13
and 4.14 respectively.
40
Figure 4. 13 :simulation after entering authorized card and waiting for a few minutes.
41
4.2.2 Discussion
We had observed from the above simulations is that: -
1. The LCD displays the number that is generated by the ac source. So, this indicates that the LCD
will displays the RFID tagged card number when implement practically.
2. The motor moves clockwise to 90 degree when only authorized number is given, and the motor
moves back anticlockwise after a certain time. The 90 degree clockwise and anticlockwise
movement shows the opening and closing of the door, which is matched to that we expect.
4. The LED blinks when the number that is generated by the ac source is authorized. This can
indicate that the LED blinks when the authorized RFID tagged card is approached to the RFID
module during practical implementation.
So, we, concluded that this project can be implemented practically using EM 18 RFID MODULE
without any problem.
For practical implementation, after dumping the program in the controller one must take the cards
which must be authorized and get the tags ID. These are obtained by placing the tag near RFID
module and the ID number will be shown on the LCD screen. After getting the IDs, the program
must be updated by replacing the below ID numbers with new ID numbers.
But, known since RFID module doesn’t present and tagged cards are implemented for practical
case; we used the ac source (instead of RFID module) to generate RF signals/numbers (which
act as tagged RFID cards number).
42
CHAPTER FIVE
43
5.2 Recommendations for Future work
We put the recommendation to ourselves for further analysis to implementation this RFID based
secured monitoring system: -
for BDU campuses, and other necessary large company entrance gates allowing only
peoples who have authorized RFID tag identification card (ID) can enter to the campuses,
and companies.
for shopping malls to stop theft as the products are tagged with RFID chip and when a
person leaves the building with the RFID chip an alarm is raised automatically,
for data centers where only the network administrator is allowed to enter the room,
it can also implement for any required entrance gates by taking some modifications as
necessary.
Since every good engineering design innovations, projects and researches is not done without
limitations, we also recommended that:
Any interested researcher should take up the programming and simulation of the RFID
based classrooms and dormitories monitoring system presented in this work to realize the
expected secured result for further detailed analysis.
Any interested researcher should take up a project on the implementation of it with simple
and easy hardware materials; for example, try to implement without using any motor by
replacing it with other simple technological comer material or any other system.
Any interested researcher should take up a similar RFID based project by further
modification of this, for any other sensitive secrete protection as well as controlling
systems; especially for international network security agency (INSA) systems.
44
REFERENCES
[1]. Andrew W. Wright; “RFID classroom management systems”, June 2011, pp1-12.
[2]. Judith Symonds & David Parry; “Auto identification & computing applications using RFID &
smart technology”.
[3] Longe O.O. (2009), “Implementation of Student Attendance System using RFID Technology”,
B. Tech Project Report, Ladoke Akintola University of Technology, Ogbomoso, Nigeria.
[5] Nambiar A.N. (2009), “A supply chain perspective of RFID Systems”, World Academy of
Science, Engineering and Technology Journal, Volume 6, pp1-25.
[6] RFID Sens Net Lab (2005), “A white paper on Automatic Attendance System”, Texas A & M
University, Texas, USA.
[7]. Saurabh Narkar, Ankit Hendre, and et al. as; “RFID based toll plasa system using pic
microcontroller”.
[8]. Son Lam Phung,“Getting Started with C Programming for the ATMEL AVR
Microcontrollers”, Version 2.0, pp1-6.
[9]. www.circuitdigest.com//.
45
46