An Internet-of-Things based Real-time Monitoring System for Smart Classroom

The Development in technology has brought about a common norm of communicating and interacting with appliances remotely using portable devices like laptops and smartphones that have Internet connections. This is possible with the use of the Internet of Things, popularly referred to as IoT. This paper presents a system by which classroom held interactions speciﬁcally seat allotment is made a simpler process by secured automation coupled with the Internet of Things to develop a system that enables a person or group of people to remotely monitor seat allotment, de-allotment with precision over a wide distance. Traditional means of allotment are quite slow and tiresome especially when dealing with a large number of students. Hence there is a need to develop a system to automatically allot, track, and monitor real-time seats in a classroom. In this research, an IoT seat allotment system is proposed; the system is developed and tested within a smart classroom environment using the Federal University of Agriculture Abeokuta (FUNAAB), Nigeria as a case study. The system is implemented on Arduino IDE using C ++ programming language and a prototype of the mobile IoT seat allotment application is developed using Java programming language. Through experimental analysis, it was discovered that the IoT Seat allotment achieved the ranges of 30 % to 50 % reduced time, and higher accuracy when compared with the traditional seat allotment method.


Introduction
A Computer network refers to two or more computers connected, to transfer data electronically. Apart from connecting computers physically, a network system establishes a cohesive architecture that allows a variety of machine types to transfer and communicate information in an almost seamless fashion. Two popular architectures are ISO Open Systems Interconnection (OSI) and IBM's Systems Network Architecture (SNA).The Internet is considered the largest wide area network addressed. There is more than enough justification to automate and create platforms whereby IoT devices turn conventional classrooms into smart classrooms and mainly automate seat allotment using IoT devices. This research aims at developing a routine mechanism for IoT-based classrooms for seat allotment by designing a model for automatic allocation of seats and monitoring students in a smart classroom, deploying the model designed on suitable IoT hardware devices, and evaluating the model using suitable performance metrics. IoT integration with classroom learning brings automation into a classroom, enabling us to achieve complete control over electric equipment around us. It is indeed possible to control them using either gesture-based techniques or voice-based commands. IoT will be useful in developing an intelligent system that can decipher and understand our needs or requirements and function accordingly, without even having to command them [13].
In recent times, the IoT, as well as Cloud computing has enjoyed the great attention from the academic institutions to develop a smart learning atmosphere. Several devices and infrastructure are connected in a Smart Campus that provides smart lighting, projection, security, and efficient use of resources many more [14]. Smart classrooms can be referred to as a technology-enabled form of education. Integration of advanced hardware with software technology is used to enhance teaching and student learning, and it has become even more relevant and necessary to implement smart classrooms due to its efficiency ratio, which is evident in its track record of making regular tasks easier, as well as saving time and effort. There are various ways to automate a classroom and give it the resources it needs to be considered smart, like smart student ID cards, environmental sensors, smart cameras and projectors, and smart lighting systems. Even as little as a few minutes saved every day will result in an unquestionable return on investment, which can be measured in both actual costs and improved student outcomes. Due to the bloom in the automation and wireless connectivity industry, all devices within the classroom can be connected to a central network and remotely controlled. This improves the comfort, energy efficiency, security, and savings of the classroom [15]. Reducing the levels of truancy and absenteeism by students continues to be a very important goal of every level of the school system. Attendance to lessons does not only affect the individual student involved but can affect the learning environment of the school [16,17]. Generally, the institutes always request that the tutors do what is referred to as 'education guidance', but it is noteworthy that this is not the best solution for these truancies by the students. The tutors would issue one warning to the absent students in advance, by roll call and this, in turn, takes about 5 to 10 minutes. Therefore, most teachers may not bother doing the roll call regularly, since it would take lots of time. An important question that must be discussed is if the operations of roll call for every class in the university can be effectively handled by tutors who are familiar with their jobs.
With the rapid development of IoT, how to enhance the 298 management level of classrooms in colleges and improve the utilization of classroom resources has become the core of the informatization construction of smart classrooms [18]. Generally, several schemes have been proposed for managing or allocating resources in smart systems. For example, resource allocation algorithm and task scheduling strategy were used for edgecomputing based environmental monitoring system in [19]. In addition, the development of a smart parking system suitable for urban environment was proposed. The system assigns and reserves an optimal parking space based on the driver's cost function that combines proximity to destination and parking cost [20]. Similarly, some researchers designed a framework for resource management in a pervasive IoT environment with limited resources; by applying a use case study of IoT-based body area network and proposed a model for resource management in personal and community healthcare [21]. Furthermore, an intelligent decision-making model based on IoT data-driven technology, which offers significant insights and ideas was proposed in [22], the resource allocation approach for services-oriented IoT applications presented in [23], and many more. Given the relevance of resources management in Smart systems, similarly, an intelligent resource allocating scheme is proposed in this study. Specifically, this research proposes an IoT-based smart classroom for automatic seat allotment and effective monitoring in real-time. This study will design, and deploy IoT sensors, ESP82622, and middleware APIs with the benefit of providing a structured system for smart classrooms. The rest of the paper is organized thus: Section 2 discusses the related work on automated seat allocation, smart classrooms, and IoT applications. Section 3 presents the proposed IoT Seat allotment framework and Algorithms. Section 4 presents experimental setup and implementation procedures; Section 5 presents implementation results and discussions, and Section 6 concludes this paper and discusses potential future work.

Related works
Computer science as a field has seen the application of several IoT implementations and several attempts have been made to improve the metrics over the years. He et al. presented an intelligent chair system based on the network of sensors attached to chairs to collect certain information. The IoT device Arduino board was used to get information about the user through the RFID tag and if the pressure sensor on the chair was occupied. Data were uploaded to the ThingSpeak cloud. An Android application was also built to parse the implemented stored data. It is also important to note that the system developed doesn't only proffer a solution to a problem, it also lays the foundation for future works [24]. The authors in [25] observed that technology plays a vital role in education. In this scope, the role of the smart classroom is extensive. A digitized classroom is quickly transforming the way both a teacher and student learning in school by introducing meaningful and resourceful use of technology. A smart classroom brings in technology right next to the blackboard for teachers in the classroom. The results of this research concluded that students performed better when they were exposed to digitized learning materials compared to the traditional method of teaching.
In [9] the researcher investigates, "The potential Risks of IoT device supporting IR Remote Control", and discussed risks like how IoT devices that support IR remote control can be taken advantage of to leak data from a secured network using malicious IR hardware module. Precisely, a malicious IR hardware module is used to confirm the existence of such threats. Majorly, IR signals are used for their novel purpose. Therefore, it is difficult to differentiate the real signals and the fake simulated signals that are produced by an IR light-emitting diode (LED) by the MIRM, which reduces the chances of detection. The investigation in [26] pointed out that smart campuses and smart classrooms are distinct situations. While the smart classroom is made up of offline and online classroom pockets, the smart campus refers to broad campus activities. It is possible in certain circumstances that they intersect, they can also exist void of each other. To be considered smart, technological processes require colossal and diverse information databases to enhance experience and power artificially intelligent systems [27]. Physical environments which include towns and cities are described as smart when they start to combine the IoT and Big Data. Smart universities are developing smart environments that are intimately tied to developments in smart cities. With smart environments as such, individuals, governments, and corporations accrue massive troves of data from widely spread sensors and networks, utilities, social media, and other various sources, to better understand, inform and manage to live in the city [28]. The researchers in [29] revealed in their studies that the use of smart classroom technologies in the teaching and as well as learning process increases the productivity, interest, and motivation of both the teacher and the students. The processes of attendance, assignments, assessments and many tasks have become much easier with the help of advanced technology. Now, knowledge is taught through innovative methods. The automation-based system provides a common infrastructure for teaching and training initiatives in smart schools. Smart classes have changed the trajectory and process of learning over the past few years.
Authors in [30] studied the development of a scale for the smart classroom by first compiling major scales to form existing technology-integrated classroom instruments, including Technology Integrated Classroom Inventory (TICI), Technology-Rich outcomes-focused Learning Environment Inventory (TROFLEI), and Computerized Classroom Ergonomic Inventory (CCEI). A Smart Classroom Scale (SCS) was developed in this study using data gotten from primary and secondary schools in China. The results show that SCS has a magnanimous structure and sound psych properties. In [5], an investigation was conducted on the advanced sensible room. The sensible room was represented as an intelligent technique for learning and education. The major aim of this analysis was to circulate previous works connected to the sensory room. The study reviewed a range of sensible school rooms used in the recent studies, and the level of student acceptance and use. The researchers in [31] designed an intrusion detection 299 framework for energy-affected IoT devices such as sensible homes, sensible offices/organizations, sensible transport, and sensible education services. The study showed that the technique reduced the energy consumption and memory (overhead performance), and is effective among affected devices. The authors in [32] explained that IoT devices square measure the driving force required for a sensible world, wherever the items concerned play crucial roles in human's regular activities. Nodes square measure largely radio-frequency identification tags, pressure sensors, or wireless sensors. In a general IoT design, three basic layers exist application, perception, and the network layer [33]. These layers have their problems with security. The perception layer stores the physical IoT devices that ascertain numerous parameters for its atmosphere. If hacked into, it would be simple to extract very important information from it. The network layer is the medium that permits knowledge to be transferred between two alternative layers. The application layer is involved with the storage of knowledge, and analysis. For example, the physical hardware at the perception layer can be managed by one supplier and the network layer may additionally be controlled by another network supplier. Knowledge at the application layer may be maintained by a cloud service company and accessed from a computer code developed by some alternative computer code organization. An IoT node that has been compromised by an assaulter can be trained and fed with false knowledge and this might in flip be harmful as well as cause abnormal behaviors. To keep the IoT nodes away from attacks, a trustworthy infrastructure is required. To improve the security, and privacy in later engineered IoT networks, developments involving the 5G wireless network, machine learning, distributed intelligence, and blockchain technologies can increase. Effectively mistreatment of all these new rising technologies will offer space for security problems [34]. The sensible school rooms offer analyzers opportunities to research and experiment with new ways of real-time observance technologies that will be used in alternative scopes, that may embrace but not be restricted to control and work management. The ability to observe emotional changes mistreatment knowledge science and face recognition, or cross-reference knowledge regarding location with alternative patterns of life may simply be used to use innocent people, staff, crowds, or unsuspecting shoppers, and this may threaten the civil liberties of these individuals being monitored. Personal management of sensible room chokes teacher and student freedom [35]. Sensible school rooms that rely on giant technology corporations, denationalize basic functions like analysis, and assessment publicly colleges. If such systems square measured and applied in colleges, most room practices can be structured by the businesses that style them [26].
Based on the literature, it is observed that several smart classroom systems have been designed for effective virtual interaction between teachers and students using various approaches in the artificial intelligence domain. The summary of existing literature on automated seat allocation is presented in Table 1; the strengths and limitations of the closely related methods of seat allotment are summarized. The main constraints deduced from the existing schemes are the lack of an appropriate intelligent mechanism for seat allotment, inability to monitor automated seats remotely, lack of efficient approach to automatically allocate seat numbers to students, expensive IoT components, and limitation of seat allotment software to operate on selected variants of mobile devices. Additionally, it was observed that most smart classroom frameworks lack automated seat allotment functionswhich make them unsuitable for conducting a virtual examination or electronic examination and effective monitoring of students in the smart classroom. Thus, this paper aims to address the aforementioned challenges by designing a robust and efficient digital seat allotment mechanism suitable for the smart classroom using low-cost IoT infrastructures to further enhance the virtual learning experience and improve smart classroom functionalities in developing countries.

Methodology
The IoT-based seat allotment was developed using a smart application. Arduino Uno Wi-Fi Rev2 board are connected to the Firebase server, and then there were connections of load sensors and devices. The system was used to implement a smart classroom that enables seat allotment and de-allocation. An application with a user interface was used to control the devices and commands sent from the application to the Firebase server through the Wi-Fi. The application has an interface that allows the admin users to allocate seats to a particular set of users using a sorting algorithm, such that, two students cannot possess the same seat at the same time. Radio Frequency Identification (RFID) is a method of identifying persons or items by using radio waves. This is a gadget that takes messages from a wireless device or "tag" without establishing physical contact or requiring a line of sight from a remote [46]. The hardware was connected with RFID sensors and a load sensor to detect whether a seat allocated to a student is occupied at a particular point in time by that student, and data is transferred to the cloud/server in real-time. Every student would have to be found in the database using a User ID (UID), which would contain a pre-registered number of students as regards the available number of seats entered into the database. The architecture as shown in Figure 1 is divided into two phases which are the Seat Records and Information Management phase can be labeled the backend of the system, while the Information service phase can be labeled the frontend of the architecture. In the backend, RFID tags were used to authenticate users, and such information is parsed using the Arduino Uno Rev 2, which is connected to a Wi-Fi module referred to as 8266. Information from the load cells is transferred through the Arduino's 8266 module to the Cloud Server and Firebase and information is stored. In the Frontend, allotment takes place after similar authentication as done in the backend, and the information as to a vacant, un-allotted, or allotted is displayed on the mobile application.
The Arduino Uno Wi-Fi Rev2 runs on the ESP8266 Wi-Fi. This architecture was designed for the user end. The Inamdar [36] Students Seating Arrangement (SSA) and Supervision Duties Allocation (SDA) Algorithms Allocation of seating arrangement and supervision duties. Arranging students with a different subject on a bench The system lacks an intelligent mechanism that allows students to monitor their seats.

Acharyya [37] Music Inspired Harmony Search Algorithm
The method helped to separate seats for students offering the same subject Constraints, when seat number is larger than the number of students, were not considered 3 Keerthi [38] Web-based Application Solved the problem of exam hall clash Lack of allocation of seat numbers and monitoring. 4 Adetona [39] web-based application using a Graph search algorithm The pairing of each student to individual courses was solved Seat numbers cannot be accessed by students remotely 5 Chaki & Anirban [40] Seat allocation algorithm Solved the problem of exam seating arrangement 4 The system does not provide the optimum result for the worst case 6 Mhamane & Shriram [41] QR Code The vacant seat of the unavailable passengers is allocated to the waiting passengers. The method helps to solve the problem of waiting time.
The seat number cannot be monitored remotely. 7 Singh S. et al., [42] Concentrated on how different strategies are utilized to complete assignments.
Methods are employed to reduce the system's cost.
Due to incorrect assignment, some methods are not optimized.
This method gives data for forecasting,congestion detection, travel route planning, and modeling in the future.
The system is operated manually. 9 Menon et al. [44] The bus's unoccupied seats were calculated using sensors at the entry and exit points.
IoT was used to forecast real-time traffic on roads.
Installation of expensive IoT-enabled components raises system costs. 10 Nagadapally et al. [45] Passengers' waiting time is reduced by combining GPS monitoring with a mobile application to obtain the actual location of the bus on a map.
Shows the actual position of the bus.
This method will not offer a precise result if there is a shortage of data in the mobile device, and it only works with certain variants of Android and iOS.
application requires student's signup at the beginning which is for one time. Mandatory fields include the matric number, email address, and password. This information is stored in the static database and information can only be retrieved with details matching that user. The android application was used to control the hardware which is developed using Java programming language while Arduino programming language scripting is used to communicate with the Arduino Uno Wi-Fi Rev2. The designed algorithms for this system are robust and scalable, it also has a low communication complexity, meaning there is a low number of sent messages within the network. The procedure for Registration is presented in Algorithm 1. Line 1 initiates the algorithm; the registration algorithm requests certain inputs for the system to initiate registration. The inputs in this section must be completed for the registration to finalize. Line 2 checks to see that the required input fields are filled. If they are filled, the inputs are then stored in the database using a database update function and the registration is complete. If fields are empty, line 9 displays a message that says "enter all fields".
The Login process is presented in Algorithm 2; the database is first initialized in line 1. Line 2 selects user details from the initialized database. The inputs are checked with data in the database for any match. If there is a match, a message "login successful" is thrown, then the landing page where activities can be carried out is displayed. A method is initiated called alled session begin() to process activities. If there isn't a match in the database, a message with wrong details is thrown.
The operations on the application is presented in Algorithm 3. The Begin Session-process must be initialized before operation can be carried out on the application. There are two options to choose among the operations to be carried out. Line 3 states if a user selects "ALLOCATE", then the database () is initiated to be searched and fetches data as regards a list of all students, and seat numbers in the database. Line 8 states that where Student is not equal to a seat, then the user has only the option to allocate an unallotted seat. Whereas line 12 states that if a user selects "DEALLOCATE, database () is initiated to be searched and fetches data as regards the list of all students, and seat numbers in the database and deallocation can occur. The device status is requested through the Dev st method represented in Algorithm 4 and line 2 states that if Dev st is ON, then Wi-Fi protocol is initiated and communication to Server is established. For as long as the Server is connected, hx711 amplifies data and pushes it to the firebase database.

Implementation
The system was implemented using Arduino Integrated Development Environment, to send and receive signals from the Arduino Uno Rev2 device on twenty seats in a classroom and was evaluated using metrics like time saved (m), cost ( ), accuracy, and sensitivity (ms). The arduino IDE provides a service-based based approach to communicating with Arduino devices, in general, using software development. The procedures are written as a set of instructions and services which are then interfaced by a Console Application that calls the services. Each resource resourc in the system has a designated service that exposes its functions to the Console Application to call as required. The resources are RFID Tags, Load Cells, the Arduino board, and the Web Application interface that processes the allotment and de de-allocation. To implement the physical seat allocation system, three procedures are needed to be fulfilled and put into place. The first procedure involves the Arduino Uno Rev2 device and the Arduino IDE. The Arduino Uno Rev2 device was used to communicate between devices over the Internet. To communicate with the Arduino device, it must first be plugged into a computer device that has Arduino IDE installed on it. The Arduino IDE is installed from the Arduino official website. The Arduino IDE version used in the implementation of this work is the Arduino IDE 1.8.1.5 Windows Operating System Version. On loading the application, the first step is to install the Arduino megaATR board as shown in Figure 2 which includes the board used in this implementation; the Arduino Uno Rev2 board. Thereafter, the library that activates the Wi-Fi module (Wi-FiNINA) was installed on the IDE as shown in Figure 3. On complete installation of the board, and the Wi-Fi libraries, the device can then be used without being directly connected to a computer system through its Wi-Fi features. The last step in this procedure is the installation of the firebase and HX711 libraries respectively as shown in Figure 3.  The HX711 library ensures that the Arduino board can amplify the readings gotten from the load cells, while the Arduino    The Arduino board is powered on, using a 12Volts power adapter which is plugged into a power outlet, as shown in Figure 4. After powering up the board, RFIDs and load cells are attached to the seats and powered using a direct current from the power source. The load cells are connected to the HX711 amplifier in the order of Red: E+, Black: E-, White: A-, and Green: A+. The white wire connects to the digital Pwm 2, and the green wire connects to the digital Pwm 3 on the board. This connection had to be precise, else the board would not be able to read the values from the HX711 amplifier. After a student is authenticated and occupied the seat, the 20kg load cells collected readings and sent them to the Arduino board, which was then stored in the firebase cloud server.
The load cells also determined when exactly the student stood up from the allotted seat and sent the readings to the Arduino board. The last procedure works with the application that implements the changes to the state of the seat. The applica-tion works with an SQLite database of a pool of formulated student names. The admin user then allocates seats to particular students and then deallocates seats. The application is connected to the firebase cloud server; this is the same cloud server and database to which the Arduino device sends its readings, through its Wi-Fi functionality. When a seat is allocated, the student uses the RFID tag to bypass authentication, and the Arduino signals the application that the seat has been occupied. If the students don't pass the authentication, the Arduino signals the application and the seat can be red-flagged by the admin user. The user could also deallocate a seat. Any deallocated seat would also be red-flagged if the load cell reads anything. The application serves as a means for a non-tech non individual to be able to communicate with the Arduino, give instructions and signal the device comfortably.
Another section of the application is the student user. The student user is allowed to create an account after which they can then be allotted seats on the application. Information from this section is stored in an SQLite database and can be retrieved by the Admin user to carry out operations on it. Figure 5 depicts the output of the HX711 Output. Figure 6 shows values acquired from the Load cell, starting from when pressure was put on it to when there was no pressure on it. The output of this can only be viewed using the baud rate of 57600 as shown in the figure. The output gotten from the HX711 amplifier is retrieved in a loop function, hence the recurring output would continue to read. Figures 7 and 8 show the output from the firebase cloud database to the mobile application developed using Android studio. The output is parsed into the application in the backend which then gives a string value of "Occupied" or "Unoccupied". Table 2 depicts the performance of IoT based system against the traditional system.

Results
The system performance is evaluated to ascertain that this technique is very effective and efficient using two metrics; these are traditional classroom seat allotment and similar sensorbased systems for seat allotments. The traditional classroom seat allotment metric measures the amount of time taken to allot seats in a traditional classroom, compared to the time taken to allot seats under an IoT classroom using the developed system. The time taken for this system to allot seats is considerably low compared to a traditional system. Figure 8 shows the time taken for the allotment of a total of 20 students. The allotment is carried out twice for each sample case of the number of seats and the average time taken is recorded in each case. This shows that the system is fair.
On the other hand, the similar sensor sensor-based systems for seat allotment focused on the cost of the sensor, sens sensitivity, and accuracy and then, compare with similar systems. It is seen that the system performed excellently in most comparisons being carried out under this metric. Tables 3 and 4, and Figures 9 and 10 show the comparisons between capacitive sensors. It shows that the chances of error are quite low which signifies that the system is good. This sensor uses electric currents to check if a seat is occupied, Ultrasonic Sensors measure distance and objects in their surroundings using ultrasonic waves reflected from objects in their surroundings, Infrared sensors use optoelectronic components with spectral sensitivity to detect things in its surrounding, load sensors which uses displacements of seat position using mass, and temperature sensors which measure the temperature change in the environment to determine if the seat is occupied. Furthermore, Figure  11 shows the graphical implementation of the analysis between sensors in terms of their cost and sensitivity.
The empirical analysis revealed that the IoT seat allotment implemented using a load cell is highly recommendable and gives optimal results as well as a reasonable choice for a largescale implementation compared to other research and systems similar to this work. Generally, it is concluded that the system is not expensive, is accurate, and is highly sensitive to response and change in its environment.

Conclusion
This research focused on using IoT devices to better improve overall seat allotment in a classroom, which saved time, improved accuracy, served as a means of security, as well as elevation of general classroom awareness. Seats were allocated and deallocated successfully through sensors connected to the seats. The connection of devices over wireless networks is indeed the next generation of computing as it becomes more seamless over time. IoT can help enhance classroom instruction by saving time, improving techniques and methods of learning, and saving costs. It was discovered through this project that a group of devices connected over a network framework using the Arduino Uno as a basis, can be used to develop a smart seat allotment platform for classroom settings. Classroom performance metrics improved with the inculcation of technology into the learning environment. The key idea is to take away manual allotment and save time and resources by being able to automatically allot seats even without being physically present with the seats or students in this view. Resource reciprocation is also carried out by the database networks which help ensure that the admin continues to get data, changes in data, and their requests are being carried out. The Seat-Solution Algorithm is implemented on Arduino IDE using C++, and Java for mobile applications. The results of prototype testing and deployment revealed that the proposed seat allotment solution can improve Google classroom or other smart classroom facilities by assigning virtual seats for each candidate which will automatically update student attendance, keep a record of their activities in the virtual classroom, and provides an atmosphere close to the real classroom experience. Furthermore, the seat allotment solution is also suitable for automatically allocating seats for students in physical examinations, especially for large classes.The Seat-Solution algorithm can be improved upon by introducing other means of connection like Infrared connections and Bluetooth. Though these means are not necessarily faster or more versatile than the Wi-Fi connection used in this project, it allows a user to be able to decide what connection module they would prefer, and could also be expanded to cover more devices in the class-room environment like fans, smart boards, and other electrical devices, to further automate the classroom environment.