---
title: "Low-Cost Access Management System in an Educational Environment"
url: "https://maker.wiznet.io/emimamanna/projects/low-cost-access-management-system-in-an-educational-environment/"
markdown_url: "https://maker.wiznet.io/emimamanna/projects/low-cost-access-management-system-in-an-educational-environment/md"
type: "UCC: User Created Content"
author: "emimamanna"
author_url: "https://maker.wiznet.io/emimamanna/"
original_author: "Fábio Jorge Costa"
original_url: "https://www.researchgate.net/publication/266686387_Low-Cost_Access_Management_System_in_an_Educational_Environment"
published: "2022-10-25"
language: "en"
hardware: ["Arduino Ethernet Shield"]
likes: 6
views: 1166
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Low-Cost Access Management System in an Educational Environment

> Higher education institutions should provide a high quality education, perform scientific and applied research, promote knowledge.

Original author: Fábio Jorge Costa (source: https://www.researchgate.net/publication/266686387_Low-Cost_Access_Management_System_in_an_Educational_Environment)

## Components

- **Arduino Ethernet Shield** x 1 ([docs](https://docs.arduino.cc/retired/shields/arduino-ethernet-shield-without-poe-module))

## Article

## 1 Introduction

Higher education institutions should provide a highquality education, perform scientific and applied research, promote knowledge and technologies transfer to the industry and community and, finally, produce and disseminate knowledge and culture. To achieve such objectives, it is necessary to continuously control the quality of the education process. Thus, the management board of those institutions should have adequate tools to manage the existing resources evolving the quality, human resources and bursar offices.

A correct planning and cost analysis is required to optimize the logistical educational process. Thus, it is necessary to know and register, for example, the use of classrooms, lecture halls and laboratories, as well as equipment and materials. For purposes of assessment of students and teaching staff, it is also necessary, in a simple and transparent way, to record information on attendance and punctuality of the participants in the educative process (i.e., students, teachers or other staff), and information related with classes in the form of summaries.

### 1.1 Related Work

As presented in [1], particular attention was devoted to the control and the access of vehicles into to the FEUP campus. The solution uses the student cards as identification through bar code reading, helping only the doorman to keep the entrance register accurate and in a digital database.

A more complex solution based on RFID technology combined with a wireless network is proposed in [2]. The system tracks people and objects in a workplace, thus simplifying the paperwork associated with the control of people and materials. Similarly, the authors in [3] present a solution to monitor and control students’ attendance using a platform for distance education (virtual). Participants are able to register their presence through a virtual object, in which that information is sent to the database and accessed by teachers and other staff. In [4] it was developed a RFID-based system, which automatically identify the users and control access to services such as classrooms, labs, libraries and remote access to computers. The application uses *Visual Basic* and *SQL Server *with the objective to replace an older barcode-based system.

Finally, [5] describes a solution that reduces the school administrative work, thus automatically executing everyday jobs such as: person identification, class/laboratories/library attendance management, emoney usage control, warnings, announcements and logging. The planned system uses several interconnected workstations (*i.e.*, computers) equipped with RFID readers in order to perform each one of the above mentioned tasks.

### 1.2 Statement of Contribution

Based on the earlier mentioned requirements, the Engineering Institute of Coimbra (ISEC) management board has launched a project to develop a versatile and low-cost solution to manage people flows and access control on the ISEC campus. The problems mentioned in the related work section point to a novel access control solution that aims to safely accommodate the higher number of cars within the campus, taking into account the existence of premium users (board staff, disabled and wheelchair). In the ISEC main park “premium” seven places are permanently reserved to the board, two other places are reserved to handicapped people. The remaining places are used on a first-come, firstserved (FCFS) among both ISEC employees and teachers. Students are discouraged to use that particular premium park. In the ISEC campus there are several other parking areas in which parking places are agglomerated in clusters (parks) or reserved along one side of the internal roads (street parks). Another important attribute in the academia is the control of student’s attendance in classes. Currently, in most education institutes (*e.g.*, ISEC) this registration process is made using the traditional paper sheet. This simple method is effective for student’s attendance registration purposes; however, only with a digital support it is possible to implement new features, such as: student’s arrival time, class duration, student’s grade penalty based on punctuality and attendance. Data in digital format also allows justifying automatically student’s absence during a particular period, when properly justified by a valid certificate (medical or other). Besides those functionalities, it is also possible to: register the maintenance tasks performed by technicians in the laboratories; identify the number of hours spent by the students in project labs; identify the students that are not attending to specific classes. With that data, it is possible to adequate the number of students to the room capacity, foreseen needs in terms of number of classes and produce statistics to the course director and institution board related with attendance and abandon.

Given the large size of the ISEC student community and the costs associated with the implementation of a completely new solution, it was decided to use the existent student cards which already incorporate RFID technology. Furthermore, the proposed solution to register the attendance in classes’ information also point to the student’s cards usage.

### 1.3 Outline

The description of the electrical and other hardware components is carried out in section 2. Section 3 presents the system architecture, thus highlighting the main functionalities and relevant main mechanisms. Some preliminary results in RoboCorp laboratory of projects at ISEC to evaluate the herein proposed management system are presented in section 4. Section 5 outlines the main conclusions and set clear expectations, thus paving the way for possible future directions.

## 2 Components

This section describes the hardware of the proposed system, highlighting the choices that would preserve low-cost prerequisite while maintaining a high level of feasibility.

### 2.1 RFID Selection Reasons

A RFID system is composed by a RFID reader and a tag. The reader is usually larger, more complex and more expensive, so a basic system usually consists of a RFID reader and tens or hundreds of tags. The tags used in this project are passive, *i.e.*, they have no battery or other power source. The tags use the energy sent by the reader to feed their circuits and transmit the stored data. Hence, a passive tag must have a very simple constitution and a reduced number of elements. Due to the lack of battery, passive tags can have a long working life without any maintenance. They can resist to extreme conditions without being jeopardized. Also, passive tags are generally smaller than active tags and mass production significantly reduces its costs (the simplest tags can cost around 5 cents each). Nevertheless, it is also noteworthy that the area of coverage of a passive tag is smaller than the area of coverage of an active tag [6].

Tags are secure memory chip/card often called contactless smart card from Mifare. They allow to easily increment and decrement functions especially designed for payment systems. They are commonly used in RFID applications where very high security and fast data collection systems are required. This family of tags has a contactless communication speed up to 106 kHz and uses strong encryption techniques: If the user wants to copy or modify content, one needs the adequate key(s). As a result, Mifare become ideal for e-money applications, secure access, data storage and fast data collection systems. To maintain low-cost requirements, the own institutional identification bank cards were used since they are endowed with RFID Mifare tags. The reader always has to communicate in the first place, since the tag requires the received power to operate. For this reason, the reader must constantly “transmit” the RF signal in its field of action, in order to detect the presence of tags. The selected RFID reader [7] is a compact 13.56 MHz RFID Read/Write module designed for ISO14443A standard. It is controlled by an external device over UART RS232 Interface with baud rate equal to 19200. The reader can be easily and quickly integrated into RFID applications.

### 2.2 Arduino Board

The Arduino [8] Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/output pins (of which 14 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports) used to connect the RFID readers, a 16 MHz crystal oscillator and a USB connection. Arduino Mega was chosen as result of its advantages over the Arduino Uno board. By having four serial communication ports, it allows the processing of four RFID readers, which enables the reduction of the cost in some applications. For instance, the same control unit could be used to manage the access and students’ attendance of two adjacent classrooms.

Another reason for choosing the Mega is due to its larger memory that allows the implementation of various types of communication, such as Ethernet, Serial and I2C. Preliminary tests with Arduino Uno showed that such board was too memory limited to handle all these procedures.

### 2.3 Arduino Ethernet Shield

The Arduino Ethernet Shield allows connecting the Arduino board to the internet. The shield is based on the [Wiznet W5100](http://www.wiznet.co.kr/Sub_Modules/en/product/Product_Detail.asp?cate1=5&cate2=7&cate3=26&pid=1011)Ethernet chip that provides a network (IP) stack capable of both TCP and UDP [9], supporting up to four simultaneous socket connections. The Ethernet shield connects to the Arduino board using long wire-wrap headers extended through the shield. This keeps the pin layout intact and allows the addition of other shields on top. Moreover, there is an onboard micro-SD card slot which can be used to store files, such that when the device is not connected to the network, a backup information storage system was implemented based on the SD Card.

### 2.4 RTC Module

The Real Time Clock (RTC) module is based on Maxim DS1307. This module allows checking the time and date required to access and manages the records. This chip has long life duration of at least nine years due to its low power consumption inferior to 500 nA. This module can be optional whether the device has fault-tolerance option or not. For a common device without such mechanism and always connected to server, the transmission is instantly and the server knows the time registration.

### 2.5 Reliable Energy Module

Li-po Rider Pro [10] is an extremely affordable power module with Lithium battery charge management and boost circuit designed for MCU projects. It supplies a big load output 1 A peak. The internal charger IC handles all the power flow between the various components.

Figure 1 presents the first prototype containing all the previously described hardware.

![](https://maker.wiznet.io/upload/ckeditor5/1015659894%5F1666729750%2Epng)

Figure 1: Access Management system Prototype.

The next section presents the architecture of the access management system.

## 3 Architecture

As previously mentioned, the proposed platform was developed based on the Arduino development board [8], in order to easily fit the application requirements. The solution has additional external modules (*cf*., section 2), interconnected as represented in Fig. 2, such us: an Ethernet communication module, a RFID reader, a RTC module, a SD card reader and several passive tags.

![](https://maker.wiznet.io/upload/ckeditor5/1015659894%5F1666729749%2Ejpeg)

Figure 2: Proposed system architecture.

### 3.1 The Main Loop

The following algorithm shows the generic device main loop, presenting a fast response for the RFID reader, executing all other functions only when necessary.

tle = millis () //

ttb = 0 // time to check SD for send backup to server bkup = { } // if system have backup 1, else is 0

Access = { } // if system have control access 1, else is 0 Loop ()  if (* millis *() – tle > 1000 ) // check if pass more than 1 sec. to update time in LCD

show_time() // function to read time from RTC and write on LCD

tle = millis() // update last time than hour was been updated

if ( *search_card_1*()* *= True ) // check for card in Reader

1, system support up to 4 Readers if( bkup = 1) // if system have backup  can be mobile and don’t wave always connection

if ( * check_eth* () = true) // if system was connected try to send

if ( send_serv ( rfid1, “ReaderName”) = false ) // if

fail to send data to server

write_SD ( rfid1 )  write data to backup      else write_SD ( rfid1 )

else // if system don’t have backup or not mobile, the connection is always’s on

if ( *check_eth* () = true) // if system was connected try

to send

send_serv( rfid, “ReaderName”)      else

connect_eth()        send_serv ( rfid, “ReaderName”)

if( bkup = 1 and ( millis() – ttb > 300000) ) // if system

have backup and pass more than 5min.    if ( sd_exist() = true)      if (* check_eth* () = true)        send_bkup()

ttb = millis() // update last time than SD was check

Algorithm 1. *loop*() function.

#### 3.1.1 send_serv()

To process the RFID code and send it to the server, the *send_serv*(RFID, reader) function is used. The *send_eth*(hour, min, sec, reader, rfid) function retrieves the date and time from the RTC. After sending the information, the function returns a success message, error message, guaranteed access, or denied access depending on the implemented system.

send_serv (rfid, reader)  *get_time*(); // function to get time to RTC

if ( access = 0) // if system don’t have control access if (* send_eth*(hour,min,seg,rfid) = 1) // function send data to server and return code of successful

return true

else // function don’t return sucessfull return false

else // if system have control access have to check server

answer

answer = * send_eth *(hour,min,seg,reader,rfid) // send time and reader to for identification of local Switch // check answer from server

00: return False //server don’t answer

01: *Access_Granted *(); return True // server give access

02: *Access_Denied* (); return False // server don’t give access

… // another error codes Algorithm 2. *send_serv*() function.

### 3.2 Memory Card Usage

Two functions were created to interact with the SD card: one for recording the information and another for reading information previously recorded. The information is recorded in a simple text file, **.txt*, in an organized structure. The information is separated by one record per line, with special characters in the beginning and in the end of each parameter.

#### 3.2.1 write_sd()

For registration, the information to be recorded is received by the *write_sd*() function. A variable is created containing the filename, which may be variable or not. If this operation is not successful, a write error is reported and the transaction is closed in order to be used again later.

#### 3.2.2 send_backup()

When it is necessary to read the information from the memory card, the system uses more than one function based on the structure previously defined. Similarly to the *write_sd*() function, the *send_backup*() check whether the file exists or not.

If the file contains any information on it, the function reads character by character until the end of it. The processing of reading a buffer is created and inserted into a vector by means of a pointer variable. The data is sent to the *send_eth*() function which is responsible for resending it to the server. The local variables are cleared and it is checked whether there are new lines of data to send, thus repeating the whole process.

### 3.3 Ethernet Communication

One of the most relevant features of the system is to communicate with the server so as to process the information and access the database. Therefore, it was necessary to develop the communication based on TCP/IP [9] due to the knowledge of the status of the message. The default Ethernet library of Arduino 1.0 was used, thus allowing the automatic acquisition of IP address from the DHCP service. To ensure that the device is working properly, a series of functions were developed to support the connection to the server.

#### 3.3.1 chek_eth()

The check_eth() function executes a connection to the server to a predefined page, and expects a reply. If the module receives the expected response, the function returns true, allowing the device to know if there is a connection or not.

#### 3.3.2 send_eth()

When all the information is ready to be sent to the server, the function send_eth (hour, min, sec, days, months, years, reader, RFID), formats the data in order to be sent to the server. Then, depending on the type of system, the response is received, processed and transmitted to the device.

### 3.4 Web based application

To manage all the information sent by the portable device, a database in MySQL and interface in HTML and PHP was developed. The authentication system is based on a session technique that uses cookies logging into the server logs, thus providing a secure authentication. Each user has different levels of permission, which allows distinguish administrators, teachers and other users such as employees and students.

Since bank cards are renewed every four years (with a new RFID code) and the access control is based on the institutional identification bank card (*cf.*, section 2.1), the database includes the possibility to add more than one card for each user.

For the access control system, there is a table that relates the user with the area, lab or room in which he/she has access. The raw data of attendance management is recorded in a specific table, that is then processed and saved in another final table.

To improve system reliability, the entire database must be, at least, in the *Third Normal Form *[11] to ensure stability and consistency in the database.

## 4 Preliminary Experiments

After the development of the low-cost solution, some preliminary experiments were carried out in RoboCorp laboratory for projects in ISEC. The system is connected to a server for access management. The access to the server is made through a user interface developed in PHP that, using a database, it allows adding or removing users, giving permissions to users by establishing different access levels they have in each department/area, and others. The database developed for this application (Fig. 3), besides all other features previously mentioned, it allows consulting the presence of users in the laboratory in an online fashion.

![](https://maker.wiznet.io/upload/ckeditor5/1015659894%5F1666729750%2Ejpeg)

Figure 3: Data-base structure.

As Fig.4 presents, it is possible to observe, in realtime, the entry and exit of users, the hours they spend in the laboratory, the average number of hours per day and the distribution of attendance.

![](https://maker.wiznet.io/upload/ckeditor5/1015659894%5F1666729749%5F0%2Ejpeg)

Figure 4: Robocorp lab usage using a Gantt diagram

## 5 Conclusions and Future Work

From the proposed interface, it is possible to manage the access control and access the flow of participants in the education process. The system allows generating statistics to manage educational departments, record students’ attendance and identify the participants inside a given classroom. The next task to accomplish is to create a battery of tests to evaluate all functionalities of the system, such as the duration of charging and discharging batteries, as well as the transmission speeds and response.

As future work, we also intend to extend the scope of applications using the same architecture. For instance, the implementation of a portable system for recording attendance in classes, thus providing to the teacher a greater accuracy and ease to manage student’s attendance. Another application would be the control and access of vehicles on ISEC campus. Also, using such equipment in school cafeterias to recognize and identify teachers, students or other staff, to manage the different charges associated to them.

---

Source: https://maker.wiznet.io/emimamanna/projects/low-cost-access-management-system-in-an-educational-environment/
