IoT_RFID_Lock_Door_Security_System
IoT_RFID_Lock_Door_Security_System
E-mail: [email protected]
Abstract. Wireless security system is widely used and favored by many industries, leading to
mass growth of this technology. Prior to that, many advancement has been made throughout the
decades. One of the popular wireless security systems is the Radio Frequency Identification
System or RFID. RFID is favored over other systems due to myriads of its application in current
systems like ATM cards, national ID card, toll system, parking lot system, and even mobile
phones. This paper proposes an improved design of an RFID security system utilizing a Wi-Fi
capable microcontroller (ESP-8266/ESP-12E). Combining the RFID system with an IoT system
shall provide user with maximum control and monitor over the system. In this system, a RFID
module (MCRF522) and an ESP-12E are used to identify a RFID card UID, in which a relay will
turn on if the card is authorized, and the otherwise if not. The information will then be transmitted
over the internet to a database, in which the information will be accessible via an app created
specifically for the system for flexible configuration by the host user.
1. Introduction
Security system featuring the RFID system is vital to maintain a secured and safe environment of a
particular organization or an entity’s premise [1]. A place such as an official organization premise is
frequently strict over authorization upon entrance due to possession over precious or expensive item or
sensitive information. This liability may pose the organization to danger of unmonitored premise; which
is why security system is widely used to keep organization authorities aware of the status of their
premises [2].
The current RFID systems can be challenging to install due to their complicated technical setup and
operation [3]. This sometimes leads to limited monitoring capacity, which may only be available to
professionally or technically trained personnel. This limitation has indirectly undermined the authority
of the premise; putting the premise under poor security [4]. Acquiring information from security
systems database might be tricky, besides taking time to configure changes, which will reduce the
reaction speed of the system for users. Although there are already many security systems that provide
portable monetarization by pushing notifications to mobile phones, user accessibility to the system is
still cramped as it is a one-way transmission [5].
Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
The proposed RFID system in this paper offers the user a fairly simple setup, along with technically
flexible hardware device, as the whole system configuration is compressed into a single app for the host
to adjust user access, as well as other authorizations over the system which can be applied to premise
doors or any other access related appliances that need to be secured.
Like most RFID systems, the proposed system provides security over premise doors or entrance limit
to authorized employees or personnel only. Other extra features of this system are transmittable
information over the internet, portable monetarization, flexibility of system, and configurable access
using app.
As shown in Figure 1, the system brain is an ESP-12E module, which is specifically chosen as it is
capable to transmit Wi-Fi signals [6-10]. This module is connected to a MFRC522 module by SPI
protocol, which functions to identify RFID cards. The microcontroller module is also connected to
another two output components; firstly is a relay to turn on or off an output device, or as door lock,
connected to a 12V supply, and secondly a buzzer for sound indication of authorization. As this system
is intended to connect wirelessly to an internet database, a database account was created under Google
Firebase domain to store the information of the system. This information is made accessible through an
app designed specifically for the system.
2
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
As shown in Figure 3, MFRC522 module is a Serial Peripheral Interface (SPI) breakout board device,
consisting of a MFRC522 IC specifically manufactured to detect 13.56MHz Mifare card. As Mifare is
a widely used brand of RFID tags in daily basis, it is perfect for the task. The basic concept of RFID
module is transmission of electrical signal to cards and receiving data that is transmitted back from the
card, which is the memory content of the card. As shown in Figure 3, the RFID card architecture is
interesting: comprising of 16 sectors, in which each sector contains 3 data blocks of 16 bytes each and
1 trailer block of 16 bytes. The trailer block contains key and access information. Whenever a card is
written with information, it is embedded into the memory.
With the amount of sectors in the card, it can be calculated that a standard RFID card holds an average
of 1k byte of data, which is also known as dump, as shown in Figure 4. However, none of this is very
much useful for identification.
3
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
In theory of RFID system, most of the time, only the first 4 bytes of the first data block of the first
sector of an RFID card are used for identification to reduce the time taken to differentiate the data of a
card, unless it is used for data transfer. These 4 bytes are known as Unique Identifier (UID). Whenever
a card is waved, the reader will only capture the UID bytes. After capturing this information, the data
will then be transmitted using a communication protocol known as SPI, which is a native protocol to
both MFRC522 and ESP-12E to communicate.
ESP-12E has an onboard ESP8266EX microcontroller connected to a 4MB flash memory, as shown
in Figure 5. ESP module is theoretically faster and has a greater flash memory capacity than most
microcontrollers, making it more reliable for specific task. The microcontroller has an embedded Wi-Fi
firmware, enabling it to connect to Wireless Access Points, thus capable of surfing the internet.
When the ESP8266 has successfully connected to a modem, after passing through security
requirement, ESP8266 will be assigned with an IP address, which indicates that the module is now able
to transmit IP packets. These packets will be routed on a sub-net, and the modem will transmit the
packets to Internet Service Provider over DSL and enter the internet.
4
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
Following through a chain of program, after detecting a card, the ESP8266 will turn the information
into an IP packet and transmit it to a database, which is readable by specific app. The ESP8266 also will
request the database for a list of RFID UIDs that are authorized, and then start differentiating with the
detected card. If a card is found in the list, the program will then break the loop of differentiating and
proceed further command for output; otherwise, it will run a certain command for another chain of
output.
The relay in the system switches on or off the device based on different voltage and current range.
As electronics consume a very small amount of current and voltage, the same power supply cannot be
applied to the appliance of choice; in this case a door lock. A relay is basically a automatic switch
controlled by a low power electronic used to switch on or off a high powered appliance. For the proposed
system, a relay with a rating of 250V and 10A is used, which means any application below or equal to
the power rating can be used. This relay is driven by a transistor controlled by an ESP8266/ESP-12E
module whenever a card is detected or a message from an app is sent to the database to the
microcontroller.
Piezo-electric buzzer is a commonly used buzzer in electronic devices, which functions when voltage
flows through its electrodes. The buzzer’s anode can directly be connected to the microcontroller output
pinout for signal. Since the buzzer is the only output indication for the RFID device, the buzzer is the
first indicator whenever ESP-12E is connected to a router, emitting 2 quick low pitch beeping sounds.
It will produce one low pitch beep sound if a card is detected. If a card is identified, 2 low pitch beeps
will be produced, and if otherwise, a 2 slow, high pitch beeps are produced.
The door lock is an external component to the system, and its design option depends on user
preference. In a solenoid door lock, when voltage is applied to the coil located inside the metal housing,
the coil will be magnetized, thus pushing the solenoid back, as it is made of conductive metal. As of real
world application, this means the door will open as voltage is applied to the device. The door lock is
connected to the relay output, which is connected in circuit to 12V power supply.
3. Software Overview
There are varieties of software used in the development of this system. As the system transmits
information between 3 different platforms, there are also 3 distinguished software: Arduino IDE as the
hardware device programming interface, Google Firebase as the database storage, and Thunkable as the
app development interface.
5
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
Arduino IDE, as shown in Figure 6, is the working environment for this system’s hardware. Arduino
IDE provides the flexibility of programming with simple syntaxes, although the language used is
embedded C. Arduino has its own source files, which are reliable and easy-to-use functions for user to
navigate. This system also has additional source file, namely ESP8266 source file, SPI source file,
MFR522 source file, and Firebase source file. These are needed to maximize the efficiency of
programming the system without worrying about external related programs.
Google Firebase, as shown in Figure 7, is a free database domain provider. This is the database
domain in which the ESP-12E and the system’s app are connected to transmit and receive data to
communicate with each other through the internet. Google Firebase has different useful features but
relatively easy-to-configure database. The chosen feature for the proposed system is a real-time
database, which uses a JavaScript Object Notation (JSON) standard file format to store data in the web
for the authorized party to read or write.
6
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
The major circuit hardware were compiled and compressed into a single circuit board, which was
designed and fabricated under China’s manufacturing industry (JLCPCB). The Printed Circuit Board
(PCB) consists of components as shown in Figures 9 (a)-(b).
(a) (b)
(c)
Figure 9. The prototypes of proposed design: (a) Back side of PCB, (b) Front side of PCB, and (c)
Assembly of all components
The device model was precisely and carefully designed to fit all the appropriate components, for a
robust placement and installation of the device in real world application, as shown in Figure 9 (c).
Standard micro-USB port was used for powering up the module, and terminal block connector was used
for the relay output connection for multiple application purposes. The model was designed as close as
possible to commercial standard to achieve utmost effectiveness and simplicity of the device in daily
application.
The application of the device is as follows: The power supply of the module sent by a micro-USB
connector to power up the system. The ESP-12E is connected to the database, as shown in Figures 10
(a)-(i). With a list of authorized RFID UIDs, whenever a card is waved, the card will then go through
cycles of pairing algorithm, which will be processed by the ESP-12E. The output controls the relay
which in turn controls the door lock on/off state by opening and closing the 12V supply on the
breadboard.
7
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
(a) (b)
(c) (d)
(e) (f)
(g) (h)
8
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
(i)
Figure 10. Database of proposed design: (a) Login page, (b)Activity log, (c) Access
page, (d) Card management page, (e) Authorization alert, (f) Manage access page, (g)
Account page, (h) Card Request monitor, and (i) Registration manager
The architecture of the app is fairly complex, but designed to provide user an easy navigation. Like
most apps, signup/login is a requirement to identify a user. Upon opening the app, the user will be
presented with a login page. For new users, they need to sign up, and are required to fill in simple details
like username and password. Every user will be given a unique ID for identification. After registration,
user details will be sent to the user with authorized access management to review.
(a) (b)
Figure 11. Authorized access management: (a) Signup page, and (b) Signup successful
Upon loading the signup page as shown in Figure 11(a), the app will automatically generate an ID,
formatted based on the date and user sequence of the same date, thus generating unique numbering
sequence. After successfully signing up as shown in Figure 11(b), all the information including the ID
sequence will be stored in the database for review.
If a user has passed the login page, the user will be directed to the activity log as shown in Figure 10
(b). The user will be presented with 3 navigation tabs of different pages, which are the activity log,
access, and account. The activity log is the vital part of the app which shows the device activity in a
console view. Whenever the device detects a card, regardless the card is accepted or not, it will record
all activities, including remote access by console command input by authorized user.
In the access page, as shown in Figure 10 (c), users are able to see their authorized access, which
comprises of different features including access management itself. Users are able to apply for a RFID
9
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
Card as shown in Figure 10 (d). By entering a valid Card UID, user can apply for Card access from the
RFID device.
Figure 12(e) shows the Access management page, which can only be accessed and adjusted by
authorized users. Meanwhile, Figure 10 (f) shows that a user is unable to access the page due to
unauthorized feature.
At the rightmost end of the app navigation bar, the account page, as shown in Figure 10 (g), shows
that user will be presented with full detail of their account, including user rank and status of account.
Meanwhile, in the button navigation, the left columns of buttons are specially made for authorized users
for managing card requests and activation of registered users, as shown in Figure 10 (h) and Figure 10
(i), respectively.
The app holds the most function to make changes to the database, by means of controling the RFID
system device, allowing almost maximum control over the system by a portable interface.
Table 1 shows the major components connections. This system has 2 voltage sources, since the ESP-
12E and MFRC522 have 3.3V voltage rating, while the relay requires 5V voltage. A voltage regulator
is used to reduce the voltage supply of the ESP-12E and MFRC522. Menwhile, the relay is not 3.3V
compliant as the coil requires more current, so the relay is connected to the main unregulated 5V supply.
10
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
VCC(5V-Unregulated) C1
VCC(3.3V-Regulated) VCC
GND GND Emitter (-)
GPIO4 SDA
GPIO14 SCK
GPIO12 MISO
GPIO13 MOSI
GPIO0 RST
GPIO9 (+)
GPIO10 Base
Collector C2
7. Conclusion
In conclusion, the proposed RFID based security system offers efficient and reliable application, and
identification is as easy as just waving a card. This wireless system has brought forward innovation to
the existing and traditional technology. With complexity arising in new technologies, the proposed
11
ICE4CT2021 IOP Publishing
Journal of Physics: Conference Series 2312 (2022) 012092 doi:10.1088/1742-6596/2312/1/012092
system provides user-friendly interface for hosts and users to configure and navigate. The proposed
system also requires no programming for users, meaning neither trained nor technical personnel is
required. Moreover, the system reduces labor and cost for monitoring task and maintenance, offering
the users to become their own security personnel for the organization.
References
[1] N. Ripin, E-H. Lim, K.H Yusof and M.S.S.M. Basir, “Miniature Folded Log-Periodic Shaped
Tag Antenna for Metal Mountable UHF RFID,” Proceeding - 2020 International Conference on
Radar, Antenna, Microwave, Electronics and Telecommunications, ICRAMET 2020, no.
November, doi: 10.1109/ICRAMET51080.2020.9298581.
[2] S. L. Fong, A. A. A. A. Bakar, Y. H. F. Ahmed and A. Jamal, “Smart Transportation System
Using RFID,” ICSCA '19: Proceedings of the 2019 8th International Conference on Software and
Computer Applications, February 2019 Pages 579-584 doi: 10.1145/3316615.3316719.
[3] R. Suhail, “Automated door access based on RFID using Arduino,” Int. Conf. on ICT forDigital,
Smart and Sustainable Dev.2020, doi: 10.4108/eai.27-2-2020.2303113
[4] Orji E Z, Oleka C V, and Nduanya U I, 2018, “Automatic access control system using arduino
and RFID “, J. Sci. and Eng. Research, ISSN : 2394-2630.
[5] Shinde M P, Mehta S, Shanbhag I, Lele V, and Bhise A, 2020, “Android based smart door locking
system,” Int. J. Eng. Research & Tech.vol 9, ISSN: 2278-018.
[6] M. N. Mhammed, H. R. Hamid, S. Al-Zubaidi, N. S. Zamani and M. I. Abdullah, “A New Design
of Batik Production Machine using IOT Technology,” Proceeding - 2019 IEEE 7th Conference
on Systems, Process and Control, ICSPC 2019, doi: 10.1109/ICSPC47137.2019.9068064.
[7] N. S. Zamani, M. N. Mohammed, S. Al-Zubaidi and E. Yusuf, “Design and Development of
Portable Digital Microscope Platform using IoT Technology”, Proceedings - 2020 16th IEEE
International Colloquium on Signal Processing and its Applications, CSPA 2020, doi:
10.1109/CSPA48992.2020.9068685.
[8] H. Razalli, M. H. Alkawaz and A. S. Suhemi, “Smart IOT Surveillance Multi-Camera Monitoring
System,” Proceeding - 2019 IEEE 7th Conference on Systems, Process and Control, ICSPC 2019,
doi: 10.1109/ICSPC47137.2019.9067984.
[9] R. Ramli, N. D. A. Nazri, O. I. Al-Sanjary, and N. Rozzani, “The Development of Weight
Detection System using IOT Flooring,” IEEE 11th Symposium on Computer Applications and
Industrial Electronics, ISCAIE 2021, doi: 10.1109/ISCAIE51753.2021.9431787.
[10] M. S. S. M. Basir, M. S. M. A. Kader, K. H. Yusof, N. Ripin, S. S, Jamaluddiin, K. A. Yusof, S.
M. Mazalan and N. H. Shahadan, “IOT based emergency power shut down switch for industrial
machines, ” Proceedings of Mechanical Engineering Research Day, pp: 187-188, 2020.
12