REPORT
REPORT
SALEM -11
(An Autonomous Institution; Affiliated to Anna University)
Submitted by
of
BACHELOR OF ENGINEERING
IN
NOVEMBER 2023
i
GOVERNMENT COLLEGE OF ENGINEERING
SALEM-11
(An Autonomous Institution; Affiliated to Anna University)
BONAFIDE CERTIFICATE
PRADEEP T (61772141L05)
SOBIKA K (61772141L08)
KISHORE S (61772141T311)
SIGNATURE SIGNATURE
Dr. V GEETHA Dr. S.K.S. ANGURAJ
HEAD OF THE DEPARTMENT SUPERVISOR
Professor and Head Assistant Professor (Adhoc)
Department of Electrical and Electronics Department of Electrical and
Engineering Electronics Engineering
GOVERNMENT COLLEGE OF GOVERNMENT COLLEGE OF
ENGINEERING SALEM-11 ENGINEERING SALEM-11
This paper describes RFID technology to track books information in the library
andthe number of people that access the library. The libraries are very important
aspects for humans. They are essential in acquiring and retaining the knowledge of
a person. But the earlier library system has caused many problems. This project
helps to identify the large number of tagged books using radio waves. RFID
entry. RFID tags can be embedded in library books, allowing for automated check-
in and check-out processes. Patrons can simply pass their books over an RFID
reader, and the ESP32 can manage the transactions, updating the library system in
real-time. It can facilitate real-time monitoring of access events. Library staff can
track entry and exit times, helping with attendance management and ensuring that
Key Words: RFID technology, library access, RFID cards or tags, ESP32
microcontroller.
iii
ACKNOWLEDGEMENT
iv
TABLE OF CONTENTS
1 INTRODUCTION 1
1.1 GENERAL 1
1.2 INTRODUCTION 1
1.3 RFID TECHNOLOGY 3
1.4 LIBRARY ACCESS CONTROL 4
1.5 INTRODUCTION TO EMBEDDED SYSTEMS 4
1.5.1 EMBEDDED SYSTEM 5
1.6 SIGNIFICANCE OF THE PROJECT 6
2 LITERATURE REVIEW 7
2.1 GENERAL 7
2.2 LITERATURE SURVEY 7
4 HARDWARE REQUIREMENTS 14
4.1 GENERAL 14
4.2 ESP 32 MICROCONTROLLER 14
4.2.1 ABOUT ESP 32 14
4.2.2 SPECIFICATIONS 15
4.2.3 PIN DIAGRAM AND ITS EXPLANATION 15
4.3 SERVOMOTOR 17
4.3.1 GENERAL 17
4.3.2 SG90 MINI SERVOMOTOR 17
4.3.3 PULSE WIDTH MODULATION 18
v
4.3.4 WORKING OF SERVOMOTOR 18
4.3.5 SPECIFICATION 19
4.3.6 FEATURES 19
4.3.7 APPLICATIONS 19
4.4 RFID MODULE 20
4.4.1 GENERAL 20
4.4.2 RFID RC522 MODULE 20
4.4.3 SPECIFICATION 21
4.4.4 FEATURES 21
4.4.5 APPLICATIONS 22
4.4.6 ADVANTAGES 22
4.5 RFID TAGS 22
4.5.1 GENERAL 22
4.5.2 RFID TAG 22
4.5.3 SPECIFICATIONS 23
4.5.4 ADVANTAGES 24
4.5.5 APPLICATIONS 24
4.6 BREAD BOARD 24
4.7 JUMPER WIRES 25
4.8 OLED DISPLAY 26
4.8.1 SPECIFICATIONS 26
4.9 4*4 MATRIX KEYBOARD 27
4.9.1 SPECIFICATIONS 28
4.10 LIGHT EMITTING DIODE(LED) 29
4.11 BUZZER 29
4.12 PUSH BUTTON 30
5 SOFTWARE REQUIREMENTS 31
5.1 GENERAL 31
5.2 ARDUINO IDE 31
5.2.1 ABOUT ARDUINO IDE 31
5.3 INTRODUCTION TO EMBEDDED SYSTEMS 33
5.3.1 EMBEDDED SYSTEMS PROGRAMMING 33
6 APPENDICES 35
6.1 GENERAL 35
6.2 SOURCE CODE FOR MICROCONTROLLER 35
vi
7 RESULT 42
7.1 GENERAL 42
7.2 RESULT ANALYSIS 42
REFERENCES 47
vii
LIST OF TABLES
TABLE PAGE NO
NO TABLE DESCRIPTION
viii
LIST OF FIGURES
FIGURE PAGE
FIGURE DESCRIPTION
NO NO
3.1 BLOCK DIAGRAM OF PROPOSED METHOD 13
4.1 ESP32 BOARD 14
ix
CHAPTER 1
INTRODUCTION
1.1 GENERAL
The Radio frequency identification and detection (RFID) based library
management system was developed these days that will enhance the use and
management of library, the service being rendered can be managed with the help of
software and hardware tools. This system uses RFID technology to track books
information in the library and the number of people that access the library. The device
consists majorly of a RFID reader, a Bluetooth module, and a microcontroller and the
material to be tracked are tagged with a RFID (a transponder). The unique IDs are
stored in a PC running an application with other information on the materials into a
database. Through these processes, books, library users with their information as well
as their tag ID can easily be used for cataloging and user authentication. A model of the
system was built, tested with several data and the result showed satisfactory
improvement in the efficiency of the library management system.
1.2 INTRODUCTION
Over the years, efforts had been made to see library services such as book
borrowing, user’s information tracking etc. being provided in an effortless manner.
Library Management Systems (LMS) are computer based systems that automate one or
all functional areas of a typical library and have had a history of evolution going back
to the mid-1950s. LMS have also been referred to as Integrated Library Systems (ILS)
in later years to reflect the fact that all functions are managed via a central database
(what is today being called a soloed application) with processes that transparently
exchange data between functional components such as catalogue recordsand circulation
transactions. By the end of the 1990s some LMSs incorporated interfaces to standard
tools such as Microsoft’s Excel for the presentation of statisticaldata. New kinds of
enterprise applications have become available to institutions andthere is demand for
better integration of LMS with such systems
1
The rapid development in information technology has brought out a
revolutionary change in the field of library system management and services. The new
information technology had changed the manual scenario of library to computerized
automated library. The Radio Frequency Identification (RFID) technology is a latest
technology for automatic identification method. RFID has been used in diverse
applications from inventory tracking to building access. The concept of RFID can be
simplified to that of an electronic barcode and can be used to identify or detect library
holdings at the circulation desk and in the daily stock maintenance. This system
consisting of short RFID labels (tags), hardware, and software provides library with
more effective way of managing their collection while providing greater customer
services to their regular customers.
Campus Management RFID technology can fully automate various transactions
of happening within a Campus. Students, teachers, lectures and staff can be provided
with RFID smart cards for their attendance and access to variouslabs and library.
Library systems can also be automated by using RFID which can include issuing of
books, security gates, searching of books, etc. Assets like computers, electronic
equipment and mechanical tools which are constantly on the go for student experiments
can be tracked to improve their usage by various departments. Hostel canalso be better
managed with access control system installed for students.
The Radio Frequency Identification and Detection RFID is a technology that has
sparked interest in the library community because of its applications that promise to
increase efficiency, productivity and enhance user satisfaction. Current library
management systems use security strips and barcode technology. Using these
technologies, a library management system can keep records of lending, borrowing and
shelving status of items such as books, audio or video tapes, CDs, DVDs, etc. But
barcodes and security strips have their limitations. They are slow to read and are prone
to be stolen. All these led to irreparable loss to a library and its valuable inventory stock.
This is where RFID technology can come to the aid of library managers.
2
1.3 RFID TECHNOLOGY
RFID is a technology that uses radio waves to transmit data between a reader
and an electronic tag attached to an object, typically for the purpose of tracking and
identifying the object. It is made of two components. The RFID module RC522 is a
popular RFID reader and writer module that operates at 13.56 MHz frequency. It is
commonly used for projects involving RFID-based systems, such as access control,
attendance systems, and inventory tracking.
Features:
Specification:
o Voltage: 3.7V
o Operating Voltage: DC 3.3V
o Operating Current: 13-26mA
o Idle Current: 10-13mA / DC 3.3V
o Sleep Current: < 80uA
o Peak Current: < 30mA
o Operating Frequency: 13.56MHz
o Module interface: SPI
o Data transfer rate: Maximum 10Mbit/s
o Reader Distance: ≥ 50mm / 1.95" (mifare 1)
o Dimension: 40mm*60mm(L*W)
o Package Includes: 1 x 12V 1.2Ah Rechargeable Lead Acid Battery
3
1.4 LIBRARY ACCESS CONTROL
RFID Library access control is based on both hardware and software solutions.
The hardware requirements are ESP32 microcontroller, computer system, RC522
module, RFID tags, SG90 Mini servo motor, Light emitting diode (LED), 0.96 Inch
I2C/IIC 4 pin OLED Display module BLUE,4*4 matrix keypadand a electronic buzzer
beep alarm bell. While Arduino ide software is used. The features of the system are
RFID enabled library for cataloging of books, Bluetooth enabled for easy mobility,
flexibility in searching information, centralized database, user identification through
their RFID tags and security features that include a login procedure with password
protection for both the librarian and members.
4
Although microcontroller is preferred choice for many embedded systems, there
are times that a microcontroller is inadequate for the task. For this reason, in recent
years many manufactures of general-purpose microprocessors such as INTEL,
Motorola, and AMD & Cyrix have targeted their microprocessors for the high end of
embedded market. While INTEL, AMD, Cyrix push their x86 processors for both the
embedded and desktop pc market, Motorola is determined to keep the 68000 families
alive by targeting it mainly for high end of embedded system.
One of the most critical needs of the embedded system is to decrease power
consumptions and space. This can be achieved by integrating more functions into the
CPU chips. All the embedded processors based on the x86 and 680x0 have low power
consumptions in additions to some forms of I/O, Com port & ROM all on a single chip.
In higher performance Embedded system, the trend is to integrate more & more
function on the CPU chip & let the designer decide which feature he/she wants to us.
5
The core of any embedded system is formed by one or several microprocessor or
micro controller programmed to perform a small number of tasks. In contrast to a
general-purpose computer, which can run any software application, the user chooses,
the software on an embedded system is semi- permanent, so it is often called firmware.
6
CHAPTER 2
LITERATURE REVIEW
2.1 GENERAL
The following journal papers has been reviewed and the technology used, pros
and cons are inferred.
1. Edwards, E.O. and Orukpe, P.E., 2014. Development of a RFID based library
management system and user access control. Nigerian Journal of Technology,
33(4), pp.574-584.
This paper This paper developed a RFID based library management system
(LMS) using UNIBEN as a case study. The need to manage time consumption is utmost
desire of an organization, a firm or an institute. Library management System reduces
time wasted in performing a particular job by librarian and library staffs. Librarians in
the library spend time sorting out books that has been mixed with others on different
shelves. But with this system adopted and used, time will effectively be saved in
performing such tasks in the library. This designed system worked satisfactorily.
This paper proposed that the RFID in the library speeds up book borrowing,
monitoring, books searching processes and This paper proposed that the RFID in the
library speeds up book borrowing, monitoring, books searching processes and
7
frees staff to do more user-service tasks. But the performance varies with respect to the
vendors of RFID readers and tags. The efficient utilization of the technology also
depends upon the information to be written in tag. Experimental results with respect to
effectiveness of RFID reader position, tag position are presented in this paper.
Developments in RFID technology continue to yield larger memory capacities, wider
reading ranges, and faster processing.
3. Malipatil, N., Roopashree, V., Gowda, R.S., Shobha, M.R. and Kumar, H.S., 2020.
RFID based library management system. International Journal of Research in
Engineering, Science and Management, 3(7), pp.112-115.
They are essential in acquiring and retaining the knowledge of a person. But the
earlier library system has caused many problems. This project helps to identify the large
number of tagged books using radio waves. The database shows the availability of the
book in the library so that the student can search in the database and if available, they
can collect book from the library. It helps to handle the issue, renewal and return process
via RFID tags easily. Student will get notified about the due date of book usingGSM. If
the student failed to return the book after the due date corresponding fine will be
generated based on the time period. RFID EAS system
is used for theft detection at the library.
4. Srujana, C., Murthy, B.R., TanveerAlam, K., Sunitha, U., DV, M. and Thimmaiah,
P., 2013. Development of RFID based library management system using MATLAB.
International Journal of Engineering and Advanced Technology, 2(5), pp.480-483.
8
university library its effects are more obvious and applicable. This RFID technology
also provides the facility of self-check for the library staff and non-returned books
effectively. So, it is expected that this RFID technology will soon replace the presently
existing technology method. The proposed system successfully implemented in our
library and it is satisfactory working.
5. Addepalli, S.L. and Addepalli, S.G., 2014. Library management system using RFID
technology. International journal of computer science and information
technologies, 5(6), pp.6932-6935.
This paper presents that the Radio frequency identification (RFID) is a rapidly
emerging technology which allows productivity and convenience. Radio Frequency
Identification (RFID) is a new generation of Auto Identification and Data collection
technology which helps to automate business processes and allows identification of
large number of tagged objects like books, using radio waves. This paper proposes
RFID Based Library Management System that would allow fast transaction flow and
will make it easy to handle the issue and return of books from the library without much
intervention of manual book keeping which benefits by adding properties of traceability
and security. The proposed system is based on RFID readers and passive RFID tags
that are able to electronically store information that can be read with the help of the
RFID reader. This system would be able to issue and return books via RFID tags and
also calculates the corresponding fine associated with the time period of the absence of
the book from the library database.
9
CHAPTER 3
3.1 GENERAL
• Inefficient Processes: Manual book checkouts and returns create long queues and
frustrate both staff and patrons.
• Data Deficiency: Libraries lack comprehensive user behavior and book usage data
3.3 OBJECTIVE
10
• Real-Time Inventory Management: Implement RFID-based book tracking to
provide real-time information on book locations within the library, reducing
incidents of misplaced or lost books and improving user experience.
• Traditional barcodes are widely used for library materials. Each book is assigned
a unique barcode, and library staff can use barcode scanners for tasks such as
check-in, check-out, and inventory management.
• Online public access catalog (OPAC) systems provide users with online access to
the library catalog, allowing them to search for books, check their availability, and
place holds or requests.
11
3.5 PROPOSED METHOD
• RFID tags can be embedded in library books, allowing for automated check-in and
check-out processes. Patrons can simply pass their books over an RFID reader, and
the ESP32 can manage the transactions, updating the library system in real-time.
• The ESP32 is known for its low-power operation, making it suitable for
applications where energy efficiency is essential. This is particularly important in
scenarios where the system needs to operate for extended periods on battery
power.
• The ESP32 comes equipped with Wi-Fi and Bluetooth capabilities, enabling
wireless communication. This allows for remote monitoring and control of the
access control system, enhancing flexibility and management.
12
3.6 BLOCK DIAGRAM OF PROPOSED METHOD
13
CHAPTER 4
HARDWARE REQUIREMENTS
4.1 GENERAL
This chapter gives the basic description of the hardware components that is used
in the proposed solution.
14
4.2.2 SPECIFICATIONS
• GND: Ground.
• 3.3V: Output from the on-board 3.3V regulator. You can use this to supply power
to other components.
• Analog Pins (ADC): The ESP32 has some pins that can be used to read analog
signals using its Analog-to-Digital Converter (ADC). These pins are often labeled
with numbers like A0, A1, etc.
• SPI (Serial Peripheral Interface) Pins: ESP32 has pins dedicated to SPI
communication, which is commonly used for connecting to peripherals like
displays or other microcontrollers.
• PWM (Pulse Width Modulation) Pins: These pins allow you to generate PWM
signals, which are useful for tasks like controlling the brightness of an LED or the
speed of a motor.
• I2C (Inter-Integrated Circuit) Pins: These pins are used for I2C communication,
a protocol for connecting multiple devices on a shared bus.
16
4.3 SERVO MOTOR
4.3.1 GENERAL
17
4.3.3 PULSE WIDTH MODULATION
As mentioned before, servo motors work with PWM converters and require a
controller to control the pulse, which can be controlled by microcontrollers such as the
Arduino, ARM, or other programmable controllers.
18
4.3.5 SPECIFICATION
o Weight 9g
o Size 22 x 11.5 x 27 mm
o Operating Speed 0.12sec/60 degrees
o Stall Torque (4.8V) 17.5oz/in (1.2 kg/cm)
o Temperature Range -30 to +60 Degree C
o Dead Band Width 7usec Operating Voltage:3.0-7.2 Volts
4.3.6 FEATURES
o High efficiency.
o High output power relative to their size.
o More constant torque at higher speed.
o Closed-loop control.
o Quiet operation.
o Highly reliable.
o High ratio of torque to inertia.
o High acceleration
4.3.7 APPLICATIONS
o Robotics
o Telescope
o Industrial production
o Machinery Works
o Production industries
19
4.4 RFID MODULE
4.4.1 GENERAL
RFID (Radio-Frequency Identification) modules are devices that use radio waves
to wirelessly transmit data between an RFID reader and an RFID tag. These modules
consist of an RFID reader, which emits radio waves, and RFID tags, which store data
and can be attached to objects or people. They're commonly used for access control,
inventory tracking, and other applications where wireless identification is needed
20
4.4.3 SPECIFICATIONS
4.4.4 FEATURES
o Integrated MF RC522
o 13.56MHz contactless communication card chip.
o The low-voltage, low-cost, small size of the non-contact card chip to read and write.
o Suitable for Smart meters and portable handheld devices.
o Advanced modulation and demodulation concept completely integrated into all types
of 13.56MHz passive contactless communication methods and protocols.
o 14443A compatible transponder signals.
o ISO14443A frames and error detection.
o Supports rapid CRYPTO1 encryption algorithm, terminology validation MIFARE
products.
o MFRC522 support MIFARE series of high-speed non-contact communication, two-
way data transmission rate up to 424kbit/s.
o Low cost, and ideal for user equipment development.
o The reader and RF card terminal design meet advanced applications development
and production needs.
o Can be directly loaded into the various reader molds, very convenient.
21
4.4.5 APPLICATIONS
4.4.6 ADVANTAGES
o low-temperature rise
o low power
o high efficiency
o high reliability
o high-security isolation
4.5.1 GENERAL
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.
This is a 13.56MHz RFID IC Key Tag. The RFID technology is used for sensing
and identifying tagged people and objects for access control, automation, and a whole
22
range of different applications. Operating on a frequency of 13.56MHz, these tokens
are all pre-programmed with unique ID numbers to communicate wirelessly with RFID
Readers.
This 13.56MHz RFID Tag makes it easy to distribute while maintaining a fair
amount of discretion. Additionally, the process of matching tags to readers is also very
simple as well, as all you have to do is tell the RFID Reader that you are adding a token,
and then hold the token nearby. Then, when the token passes by the reader, the system
can identify and log the ID number and time, or can even open up doors or other access
ways automatically. This means you can attach it to vehicles or items, keyrings, or even
pets’ collars to keep track of the location via an array of readers in the office,warehouse,
or home.
This basic RFID tag works in the 13.56MHz RF range and comes with a unique
32-bit ID. It is not re-programmable. This blank, smooth, and the mildly flexible RFID
tag is ready for your logo (or hand-drawn scribble)
4.5.3 SPECIFICATIONS
o Size 30 40 3mmOperating
o Read write time 1 to 2 milli-seconds
o Operating Temperature 20 to 85 Endurance -100,000 times
23
o Boud Read write distance 2.5 to 10cm
o Communication speed 106K
o Frequency Available 13.56 MHz & 125 KHz
o Storage Capacity 8 K bit
4.5.4 ADVANTAGES
o Small, durable.
o Waterproof, anti-corrosion, shockproof.
o easy carrying.
4.5.5 APPLICATIONS
o Enterprise/campus card
o bus stored value card
o attendance systems
24
Figure 4.6 Bread Board
A jump wire (also known as jumper, jumper wire, DuPont wire) is an electrical
wire, or group of them in a cable, with a connector or pin at each end (or sometimes
without them – simply "tinned"), which is normally used to interconnect the
components of a breadboard or other prototype or test circuit, internally or with other
equipment or components, without soldering.
Individual jump wires are fitted by inserting their "end connectors" into the slots
provided in a breadboard, the header connector of a circuit board, or a piece of test
equipment.
A jumper wire is an electric wire that connects remote electric circuits used for
printed circuit boards. By attaching a jumper wire to the circuit, it can be short circuited
and short-cut (jump) to the electric circuit.
By placing the jumper wire on the circuit, it becomes possible to control the
electricity, stop the operation of the circuit, and operate a circuit that does not operate
with ordinary wiring. Also, when specification change or design change is necessary
on the printed circuit board, reinforcement of the defective part, partial stop of the
unnecessary function, and change of the circuit configuration of the unnecessary output
part by attaching or detaching the jumper wire can.
SHOWA jumper wire (NSL: New Showa Lead) is a lead-free tin-plated annealed
copper wire. Tin plating is tin: 99.2%, copper: 0.8%.
25
In general, it is said that hot plating is difficult to control the plating thickness
compared with electroplating, but we control the plating thickness by the original
processing method.
4.8.1 SPECIFICATIONS
A 4x4 matrix keyboard is a keypad with 16 keys arranged in a grid of four rows
and four columns. Each key represents a unique combination of a row and a column,
allowing for a total of 16 possible inputs.it allow users to input additional information
or perform specific actions using the keyboard. For instance, users might need to enter
a code for special access privileges.
27
The use of keyboard enables administrators to configure system settings or
perform maintenance tasks directly on the access control system.
It Implement features for adding or removing users, changing access levels, or
updating user information using the keyboard for administrative purposes.it Allow
users or administrators to input time-sensitive information, like time frames for
temporary access.
The integration involves connecting the 4x4 matrix keyboard to a
microcontroller (like Arduino) along with the RFID reader and other system
components. Programming is then done to manage input from both the RFID reader
and the keyboards.
4.9.1 SPECIFICATIONS
28
4.10 LIGHT EMITTING DIODE (LED)
LEDs, or Light-Emitting Diodes, are semiconductor devices that emit light when
an electric current passes through them.
Use LEDs to visually communicate the status of access attempts. For example,
a green LED could indicate successful access, while a red LED could signify denied
access. Incorporate LEDs to guide users through the access control process. For
instance, use blinking LEDs to prompt users to present their RFID cards or enter PINs.
LEDs used to indicate the overall status of the access control system.
By integrating LEDs strategically into the library access control system, it creates
a user-friendly and informative environment.
4.11 BUZZER
29
The buzzer is activated in case of system errors, card reader malfunctions, or
security breaches, alerting staff to investigate and resolve issues promptly.
A push button is a simple yet essential electronic component that, when pressed,
completes an electric circuit. Assigning specific functions to the push button, such as
toggling between access modes, activating maintenance mode, or initiating system
diagnostics. The push button is used for turning on and off the Bluetooth connection,
for access control and for the activation of regulation mode.
30
CHAPTER 5
5. SOFTWARE REQUIREMENTS
5.1 GENERAL
This chapter gives the description of the software methods used in this proposed
system.
When using the Arduino IDE with an ESP32 microcontroller for library access control
various features and capabilities can be leveraged to create an effective and secure access
system.
ESP32 Board Support: Arduino IDE provides built-in support for the ESP32
microcontroller, making it easy to develop projects with this powerful and versatile chip.
Library Support: Access a wide range of libraries directly from the Arduino Library
Manager. This includes libraries for RFID modules, displays, and other peripherals
commonly used in access control systems.
Easy Programming: Utilize the simplicity of the Arduino programming language to develop
and upload code to the ESP32. Arduino IDE abstracts many complexities, making it
accessible for beginners and experienced developers alike.
31
Wi-Fi Connectivity: Leverage the ESP32's built-in Wi-Fi capabilities for network
connectivity. This could be useful for real-time data logging, remote monitoring, or
integration with other networked systems.
Integrated Development Environment (IDE): Benefit from a user-friendly IDE with featuressuch
as syntax highlighting, code completion, and a serial monitor for debugging and communication.
Serial Communication: Utilize the serial communication capabilities to interact with the
ESP32, allowing for debugging and data exchange between the microcontroller and the
computer.
Community Support: Tap into the vast Arduino community for support, tutorials, and shared
projects. The popularity of Arduino and ESP32 ensures a wealth of online resources.
Flexibility in Hardware Integration: Easily integrate various hardware components like RFID
readers, displays (OLED, LCD), push buttons, buzzers, and more, using the availablelibraries
and straightforward connections.
Access Control Logic: Implement access control logic in the Arduino code, defining how
the system responds to RFID card scans, button presses, and other events.
Security Considerations: Implement secure coding practices and consider security aspects
such as encryption for sensitive data, secure storage of access credentials, and protection
against unauthorized access.
Modularity and Expandability: Develop the access control system in a modular way,
allowing for future expansion or upgrades. The ESP32's capabilities and the Arduino IDE's
flexibility make it easy to add new features.
32
5.3 INTRODUCTION TO EMBEDDED SYSTEMS
Initially C was developed by Kernighan and Ritchie to fit into the space of 8K and
to write (portable) operating systems. Originally it was implemented on UNIX operating
systems. As it was intended for operating systems development, it can manipulate
memory addresses. Also, it allowed programmers to write very compact codes. This has
given it the reputation as the language of choice for hackers too.
33
Two salient features of Embedded Programming are code speed and code size.
Code speed is governed by the processing power, timing constraints, whereas code size is
governed by available program memory and use of programming language. Goal of
embedded system programming is to get maximum features in minimum space and
minimum time.
o Machine Code
Assembly language maps mnemonic words with the binary machine codes that the
processor uses to code the instructions. Assembly language seems to be an obvious choice
for programming embedded devices. However, use of assembly language is restricted to
developing efficient codes in terms of size and speed. Also, assembly codes lead to higher
software development costs and code portability is not there. Developing small codes are
not much of a problem, but large programs/projects become increasingly difficult to
manage in assembly language. Finding good assembly programmers has also become
difficult nowadays. Hence high-level languages are preferred for embedded systems
programming.
34
CHAPTER 6
APPENDICES
6.1 GENERAL
#include <SPI.h>
#include <MFRC522.h>
#include <BluetoothSerial.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <esp_now.h>
#include <WiFi.h>
uint8_t broadcastAddress [] = {0x24, 0xD7, 0xEB, 0x0F, 0x97, 0x58};
const int RELAY = 27;
typedef struct struct_message
{int command;
} struct_message;
struct_message received_Data;
void OnDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len)
{memcpy(&received_Data, data, sizeof(received_Data));
Serial.println();
Serial.print("Received command: ");
Serial.println(received_Data.command);
if (received_Data.command == 1) { digitalWrite(RELAY,
HIGH); // Set output pin HIGH
} else {
digitalWrite(RELAY, LOW); // Set output pin LOW
}
}
int lcdAddress = 0x27;
int lcdColumns = 16;
int lcdRows = 2;
unsigned long presentTime;
unsigned long previousTime;
unsigned long delayTime = 30000;
LiquidCrystal_I2C lcd(lcdAddress, lcdColumns, lcdRows);
35
BluetoothSerial SerialBT;
#define PUSH1 13
#define PUSH2 26
#define SS_PIN 5
#define RST_PIN 15
#define ON_PIN 12
#define OFF_PIN 32
#define BUZZ 14
struct CardEntry {
String uid;
String name; // Changed 'name' to 'tag'
};
void setup() {
Serial.begin(115200); // Initialize serial communication
//Serial.begin(115200);
WiFi.mode(WIFI_STA);
if (esp_now_init() != ESP_OK)
{ Serial.println("Error initializing ESP-
NOW");return;
}
esp_now_register_recv_cb(OnDataRecv);
esp_now_peer_info_t peerInfo;
memcpy(peerInfo.peer_addr, broadcastAddress, 6);
peerInfo.channel = 0;
peerInfo.encrypt = false;
if (esp_now_add_peer(&peerInfo) != ESP_OK)
{Serial.println("Failed to add peer");
return;
}
lcd.begin();
lcd.setBacklight(HIGH);
pinMode(PUSH1, OUTPUT);
pinMode(PUSH1,INPUT_PULLUP);
pinMode(PUSH2, OUTPUT);
36
pinMode(PUSH2, INPUT_PULLUP);
pinMode(ON_PIN, OUTPUT);
pinMode(OFF_PIN, OUTPUT);
pinMode(BUZZ, OUTPUT);
pinMode(RELAY, OUTPUT);
SPI.begin(); // Initiate SPI bus
rfid.PCD_Init(); // Initiate MFRC522
//SerialBT.begin("ESP32_456");
Serial.println("Place your RFID tag near the reader...");
lcd.setCursor(0, 0);
lcd.print("Place your RFID ... ");
void loop() {
// Check for new cards
if(digitalRead(PUSH2)==LOW){dig
italWrite(RELAY,HIGH);
delay(5000);
digitalWrite(RELAY,LOW);
}
if (rfid.PICC_IsNewCardPresent() && rfid.PICC_ReadCardSerial())
{String content = "";
if (uidMatched) {
37
Serial.println("Access granted to "+ name); // Changed 'name' to 'tag'
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Access granted :");
lcd.setCursor(0, 1);
lcd.print(name); // Changed 'name' to 'tag'
digitalWrite(RELAY, HIGH);
digitalWrite(ON_PIN, HIGH);
digitalWrite(BUZZ, HIGH);
delay(500);
digitalWrite(ON_PIN, LOW);
digitalWrite(BUZZ, LOW);
delay(5000);
digitalWrite(RELAY, LOW);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Place your RFID ... ");
// Perform actions for granted access
} else {
Serial.println("Access denied!");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Access denied!");
digitalWrite(RELAY, LOW);
digitalWrite(OFF_PIN, HIGH);
digitalWrite(BUZZ, HIGH);
delay(100);
digitalWrite(OFF_PIN, LOW);
digitalWrite(BUZZ, LOW);
delay(100);
digitalWrite(OFF_PIN, HIGH);
digitalWrite(BUZZ, HIGH);
delay(100);
digitalWrite(OFF_PIN, LOW);
digitalWrite(BUZZ, LOW);
delay(100);
delay(5000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Place your RFID ... ");
// Perform actions for denied access
}
}
if (digitalRead(PUSH1) == LOW)
{ previousTime = millis();
lcd.clear();
38
lcd.setCursor(0, 0);
lcd.print("Register Mode");
lcd.setCursor(0, 1);
lcd.print("Activated");
SerialBT.begin("ESP_RFID");
Serial.println("Bluetooth Enabled");
delay(3000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Enter Password");
Serial.println("Enter a password");
while (true) {
if (SerialBT.available())
{delayTime += 30000;
String data = SerialBT.readStringUntil('\n');
data.trim(); // Remove leading/trailing whitespace characters, including the newline
if (data.equals("12345")) {
SerialBT.println("Please place your RFID tag to scan:");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Scan RFID tag");
while (true) {
if (rfid.PICC_IsNewCardPresent() && rfid.PICC_ReadCardSerial())
{String content = "";
39
int commaIndex = name.indexOf(',');
if (commaIndex != -1) {
String uid = content;
name = name.substring(commaIndex + 1); // Remove the leading comma
entries[numEntries].uid = uid;
entries[numEntries].name = name;
numEntries++;
if (numEntries >= MAX_ENTRIES) {
numEntries = 0; // Start overwriting from the beginning of the array
}
isNewValueRequired = true;
40
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Timeout");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Place your RFID ... ");
break;
}
}
}
// Halt PICC
rfid.PICC_HaltA();
41
CHAPTER 7
RESULT
7.1 GENERAL
The result of this project is to develop a prototype on RFID based access control
for library. The RFID technology is implemented to improve the efficiency, security,
and user experience within library environments. This technology enables controlled
access to library spaces. Authorized users, such as library staff or registeredpatrons, can
gain entry by presenting RFID cards or tags. Patrons can use RFID- enabled library
cards for quick and secure authentication. This eliminates the need for traditional
barcode-based systems and streamlines the borrowing and returning process.
42
Fig: 7.1 Connection Diagram
43
Fig 7.3: Bluetooth serial monitoring APP
44
CHAPTER 8
8.1. GENERAL
This chapter tells the conclusion of the proposed system and further ways todevelop
the system.
8.2 CONCLUSION
In conclusion, it is quite clear from the above discussion that an RFID system may
be a comprehensive system that addresses both the security and materials tracking needs
of a library. RFID in the library is not a threat if best practices guidelines followed
religiously, that it speeds up book borrowing and inventories and frees staff to do more
user-service tasks. The technology saves money too and quickly gives a return on
investment. It is important to educate library staff and library users about RFID
technology before implementing a program. It may be good for librarians to watch
developments in RFID until the cost of tags comes down to $.20 or less, the figure which
some librarians have determined is the key to their serious consideration of it. While
library RFID systems have a great deal in common with one another, including the use
of high frequency (13.56 MHz), passive, read-write tags, lack of a standard and
compatibility of tags produced by different vendors is a major problem in
implementation of RFID in libraries.
RFID tags can be embedded in library books, allowing for automated check-in and
check-out processes. Patrons can simply pass their books over an RFID reader, andthe
ESP32 can manage the transactions, updating the library system in real-time. The ESP32
microcontroller can facilitate real-time monitoring of access events. Library staff can
track entry and exit times, helping with attendance management and ensuring that
library facilities are used appropriately. With the ESP32, it becomes feasible to
implement customized access levels. Different user groups, such as students, faculty,
and staff, can have varying levelsof access to different sections of the library, ensuring
that resources are appropriately restricted.
45
8.3 FUTURE SCOPE
Recent developments in hardware and software for RFID systems have increased the
potential of this technology in library automation and security. ‘Today, the one
important result for libraries is the ability to use non-proprietary systems, now that the
new generation of RFID-chips with standard ISO 15693 (to be integrated into ISO
18000-3) is available,’ explains Dr Christian Kern, system development manager of
Bibliotheca RFID Library Systems, a Swiss company specializing in such systems for
libraries. “With this technology, libraries do not have to depend on one single supplier
for tags. As libraries make a long-term investment, which mainly consists of the quantity
of tags needed, this is a very important requirement.”
46
REFERENCES
2. Renold, A.P. and Rani, R.J., 2013, April. An internet-based RFID library
management system. In 2013 IEEE Conference on Information & Communication
Technologies (pp. 932-936). IEEE.
5. Fujisaki, K., 2015, July. An RFID-based system for library management and its
performance evaluation. In 2015 Ninth International Conference on Complex,
Intelligent, and Software Intensive Systems (pp. 105-109). IEEE.
7. Yu, S.C., 2007. RFID implementation and benefits in libraries. The Electronic
Library, 25(1), pp.54-64.
8. El Beqqal, M., Kasmi, M.A. and Azizi, M., 2017. Access control system in
campus combining RFID and biometric based smart card technologies. In Europe
and MENA Cooperation Advances in Information and Communication
Technologies (pp. 559-569). Springer International Publishing.
47