Bulletin of Electrical Engineering and Informatics

Ali Saibi, Hadjira Belaidi, Razika Boushaki, Recham Zine Eddine, Amrouche Hafid Signal and Systems Laboratory, Institute of Electrical and Electronic Engineering, University M’hamed Bougara of Boumerdes, Boumerdes, Algeria Laboratoire d'Automatique Appliquée, Institute of Electrical and Electronic Engineering, University M’hamed Bougara of Boumerdes, Boumerdes, Algeria Institute of Electrical and Electronic Engineering, University M’hamed Bougara of Boumerdes, Boumerdes, Algeria


INTRODUCTION
Previously, the science of medicine was advancing in tandem with biological advances, and it was not achieving the accuracy, reliability, and speed that it is now due to new technologies and modern medical devices. Medical devices include instruments, equipment, appliances, implants, software, materials, reagents, and other things that can play a variety of roles in health preservation and recovery [1]. Historically, medical diagnosis relied on doctors' expertise to diagnose and discover diseases. Recently, medical diagnostic devices began to spread in conjunction with the emergence of technology, where the semiconductor industry, programming, and artificial intelligence (AI) are playing important roles in diagnosing diseases such as pneumonia [2], cardiovascular diagnosis [3]- [8], breast cancer [9], [10], brain tumors, diabetes diseases [11]- [13], atherosclerosis diseases [14]. Moreover, AI algorithms and the internet of things (IoT) assist us to detect and predict diseases before they occur, such as, blood pressure [15], Parkinson's disease, or to enhance COVID-19 screening, and monitoring by cameras of people who do not wear masks to reduce the spread of pandemics [16], [17]. A vast range of different scientific topics has developed because of advances in AI [18], [19].
Healthcare monitoring systems (HMS) are a modern technology that can replace the traditional management of patients and their health [20]. This technology consists of wearable wireless devices such as watches, bracelets, or underwear with sensors that are paired with health center applications to gather different kinds of information concerning physiological indicators of a patient's body. Remote HMS can be

METHOD 2.1. Layers of the IoT environment
In the context of IoT, the architecture is the structure that defines the software and the physical components of the system, the functional standard configuration and organization of the network, and the operational methods and data formats that will be used. The architecture of the IoT varies from one application to another, depending on the requirements and implementation. Therefore, it does not have a single standard reference structure. This means it does not have an easy architecture that can be followed for all implementations. However, its three most common architectures are three-layer, four-layer, and five-layer

1057
[39]- [41]. Figure 1 presents the four-layer architecture, which we used for our system. The four-layers architecture of the system there are: a. Application layer: this layer is what the user interacts with. It is the layer responsible for sending the user's commands to execute an operation or to receive information and notification. b. Data processing layer: this layer processes information and data collected in the "perception" layer.
Moreover, it stores and analyses the data using advanced data analytics methodologies to take decisions depending on the results. c. Network layer: this layer handles the transmission of the data collected by sensors and passes the commands concerning actuators. In addition, it connects the system to other devices such as servers and smartphones. d. Perception layer: it is the physical layer of the IoT architecture, where the sensors collect data and the actuators interact with their environment. Figure 1. Four-layers architecture of the system 2.2. Proposed system architecture HMS provide several options to improve or change the traditional management of patients. In addition, these solutions help the medical centers improve the treatment process of patients, reduce the cost of healthcare, and provide healthcare monitoring remotely. The architecture of this system is based on advanced modern technologies such as embedded systems, programmable development boards, the IoT, and smartphone applications. The system architecture that is shown in Figure 2 presents the structure and associations between the components of the proposed system.

Biomedical sensors
In the real world, the use of medical sensors is growing day by day. Furthermore, medical diagnosis uses many types of these sensors to improve the quality of life based on the measurements related to the medical condition of patients collected from them. Implantable, wearable, off-body, and environmental sensors are the four types of sensors [42]- [44]. The sensing section in our system is responsible for measuring and reading many different measurements concerning physiological indicators of patients, such as the body temperature, the heart rate, the oxygen level in the blood, etcetera. In addition to several sensors responsible for collecting data about the patient's environment.

Mobile application
Simple systems are characterized by their flexibility, and they are usually free of complexity during employment. For the sake of simplicity and ease of use, we built this simple and flexible HMS with a user interface that is an Android application. This interface will help the doctors to manage and monitor the patient's health without the requirement for programming or knowledge of electronics. In our system architecture, the section which has been titled "Mobile Application" is responsible for facilitating utilization and for the dynamism of the proposed system. In addition to displaying and browsing the patient's data.

IoT cloud and server
The term "IoT cloud and server" refers to everything related to delivering the data collected by medical sensors to databases on the server. In this section, we proposed a new HMS based on IoT techniques. Patients' data is collected by wearable monitoring sensor nodes which relate to a microcontroller (ESP32). This data is transmitted directly to the servers using mobile data via (SIM800L) or via Wi-Fi. Both the message queuing telemetry transport (MQTT) and hyper text transfer protocol (HTTP) protocols [45], [46] have been employed in this section in order to provide timely transfer of patients' data into servers.

Webpage
The "Webpage" section was built in order to visualize and display the gathered data. It has been developed using languages for web development such as hypertext markup language (HTML), cascading style sheets (CSS), and JavaScript. To visualize the data anytime and anywhere in the world, this webpage was built to be accessed by doctors either through their smartphones or through computers.

Healthcare monitoring system
Due to its excellent characteristics in both processing and IoT [47], we used an ESP32 microcontroller as a central processor for the proposed system. This ESP32 controller has been developed and produced as an integrated board that can be used in healthcare systems, wearables, automation, smart home applications, audio applications, cloud-based IoT applications, and more [48], [49]. In addition, we used different sensors to gather bio data concerning the patient shown in Figure 3. These sensors are divided into two categories: wearable sensors and patient environment sensors.

Wearable healthcare sensors
Recently, wearable sensor modules for physiological indicators of a patient's body have begun to spread and have attracted much attention. These wearable sensors can measure different physiological indicators such as breathing rate, body position, body temperature, blood pressure, pulse, oximeter, and ECG. We used in our system two sensors as wearable sensors, which are body temperature sensors (LM35) and dual integrated sensors to measure pulse oximetry and heart rate (MAX30102).

Patient environment sensors
In her notes on nursing, nightingale (1860/1969) wrote that "The patient's environment plays a major role in enhancing his health condition, and the doctor needs to take initiative to create an appropriate environment that helps the patient gradually recover his health because an inappropriate environment affects his life or his vital or physiological condition". We used in this proposed system four sensors to gather different values concerning the CO and CO2 levels, which are (MQ-9) and (MQ-135) respectively. Also, for gathering data related to air temperature and humidity, we used an integrated temperature and humidity sensor (DHT11).

Mobile application user interface
This proposed system was controlled by a touch screen to insert the patient's data and for configuration. But in this version, the touch screen was replaced with a smartphone application (Figure 4), to make the device lightweight and inexpensive. Moreover, smartphone applications have many advantages due to the high-resolution screens and advanced processors of smartphones. We developed this application to be smooth, effective, and completely capable of setting up the system, browsing patient information and managing the database.

Working principle
The proposed system in Figure 5 was developed to be compact, portable, standard and controllable by a smartphone. The doctors utilize the Android application that was specifically created to control this system. Initially, the system must relate to the smartphone via Bluetooth to allow the doctor to type in the patient's information such as his name and identification number. Then he must verify this data if it is correct before he submits it to the microcontroller that will receive, process, and save this data. In the second step, the system will automatically connect to the network through Wi-Fi. Then, the system will start sending requests to a PHP file via Wi-Fi using HTTP and MQTT protocols or wirelessly using the GSM.
The PHP file is responsible for executing requests that come from the system immediately. In addition, this file plays the role of mediator between the system and databases. The algorithms in this file are designed to be able to operationally build dynamic relational or non-relational databases to store patients' data on them. All these previous operations were executed in a few seconds. Subsequently, the system will start gathering data continuously from the patient's body and his environment and transfer it to databases via Wi-Fi or GSM.

Physical components of the proposed system
The physical components (hardware) of this system serve as the cornerstone for the entire system. We built the system using an ESP32 board, which is integrated with Bluetooth and Wi-Fi. Figure 6 presents this microcontroller connected with sensors and a GSM module (SIM800L). We use these sensors to collect physiological indicators from a patient's body and data concerning the environment where he/she lives.
The physiological indicators such as heart rate and blood oxygen saturation are collected by one integrated sensor, which is MAX30102. Whereas the body temperature is collected by the temperature sensor LM35. The MQ-9 and MQ135 sensors measure concentrations of CO and CO2 in the air to provide some important information about the environmental conditions where the patient lives. In addition, the temperature and humidity of the air are collected by the dual integrated sensor, which is DHT11.

Time between requests
This system has been tested in three different ways. The first test was on a local server, then on the ThingSpeak platform, and finally on the servers of the Hostinger company. We measured the delay between sending a request and the response with the same characteristics of system and the same network performance. The result is presented in Figure 7.

General results of the proposed monitoring system
The proposed system was tested with different people and environments. First of all, we tested the connectivity with a smartphone application via Bluetooth. Then we sent the patient's information to the system. The time taken from sending data to the moment it reached the processor was 0.2 seconds. This time is the average of 30 tests. This system has been designed to be autonomous in order to create databases automatically depending on the data received via Bluetooth. It has been tested to create databases on local servers, ThingSpeak, and Hostinger servers and it accomplished the intended task successfully. Figure 8 depicts the results of this test in detail. The time elapsed between sending (POST) data to the server and receiving a response (which equals "200 Ok") that indicates the databases were created correctly-was 2.015 seconds, 2.325 seconds, and 2.213 seconds for local server, ThingSpeak, and Hostinger servers, respectively. These times are averages of 30 tests for each of them. Also, concerning the time elapsed between requests, this system has been tested on three different servers. The first test was on a local server, then on the ThingSpeak platform, and finally on the servers of the Hostinger company. We measured the time between sending a request (POST DATA) and the response, with the same characteristics of the system and the same network performance. We found 2.00 seconds, 15.32 seconds, and 3.6 seconds related to the local server, ThingSpeak platform, and Hostinger servers, respectively. The results of this test are illustrated in Figure 7.
In fact, this proposed embedded system was developed to be autonomous, to work whenever and wherever, to create databases automatically for collecting data from the patient's body and his environment, and to analyze and store this data. The system successfully completed the tasks for which it was established in the IoT environment. In addition to the efficiency of the smartphone application for setting up the system, browsing data, receiving alerts. Figure 8 shows the response coming from the ThingSpeak platform after creating the database correctly. This response represents one of the thirty responses that we relied on to calculate the response time. When the database was successfully created on the ThingSpeak platform, the system began to collect physiological indicators from the body, as shown in Figure 9. Physiological indicators collected from the body are automatically sent to the server depending on the patient ID, channel number, password, and field name. The database on the ThingSpeak platform contains 7 fields (as shown in Figures 10-16). Each field represents one of the sensors. Figure 10(a) represents the air temperature measurements associated to the date when they are taken, and Figure 10(b) represents the last value has been measured. Further, the air humidity measurements collected by the same sensor DHT11 are shown in Figure 11(a) as a graph and the last value of humidity in Figure 11(b). Figures 12(a) and 13(a) illustrate the data collected by MQ-9 and MQ-135 concerning CO and CO2 levels in the air of the environment where patients live. On the other hand, the last levels of CO and CO2 are presented in Figures 12(b) and 13(b), respectively. We also illustrate the results of data concerning heart rate in Figure 14(a), blood oxygen saturation in Figure 15(a), and body temperature in Figure 16(a). In addition to their latest values has been taken by the sensors are illustrated in Figures 14(b), 15(

The result of the local and hosting servers
We tested the system on the local server and then on the Hostinger servers. It gave us the same results because the algorithms that are responsible for managing the databases of the system are the same for each of them. The seven sequential figures (from Figures 17-23) show the data collected by the system. These data are: air temperature, air humidity, CO, CO2, heart rate, blood oxygen saturation (SpO2), and body temperature in the last figure of these sequential figures. These 7 figures, from Figures 17-23, represent physiological indicators collected from the body and environment of a patient which are saved on the local server and hostinger servers.  Table 1 illustrates a comparison between the proposed system and related work mentioned in this paper. This comparison is concerning the hardware used, visualization of data, servers used, encryption that is used to protect data, and the methods used to manage databases. This system includes many of the techniques that have been mentioned in previous literature. In fact, we built this system to be autonomous and able to synchronize databases automatically to enhance data reliability; capable of managing databases automatically; mobile and working anywhere, anytime due to different communication technologies that have been used, such as Bluetooth, mobile data (GSM), and Wi-Fi. Moreover, it is free of complexity, operates effectively and can send SMS alerts or make calls in abnormal conditions.

CONCLUSION
The proposed solution was to create an autonomous, advanced, and portable system that is easy to use and free of complexity to save time and effort. We developed this system to be able to collect physiological indicators from a patient's body and his/her environment, analyze, store, and synchronize this data on a local server or on external servers such as ThingSpeak servers and real hosts such as Hostinger servers. This system is considered advanced compared to its peer systems mentioned in previous literature due to its flexibility and efficiency. It contains a control, settings, and display screen, which is an application that works on smartphones. In addition to the sensors, the GSM module, and the microcontroller, they are integrated with the Wi-Fi and Bluetooth modules, which makes it small and lightweight. This paper presented an embedded system for healthcare monitoring remotely in an IoT environment that works anytime and anywhere. In addition, it can facilitate the management of databases via a smartphone by the doctor or the person responsible for the patient.