Self-monitoring and self-alarm social distancing system based on BLE ESP32
Stefanus Christianto Sugiyanto1, Hendi Wicaksono Agung2*, and Rafina Destiarti Ainul3 {[email protected]1, [email protected]2*, [email protected]3}
Department of Electrical Engineering, University of Surabaya, Surabaya, Indonesia1,2,3
Abstract. The COVID-19 pandemic is still out there, and in mid-2022, diseases such as monkeypox and tomato flu outbreak in UK and India, respectively. Those diseases are also spread through physical contact.
Therefore, it is critical to do social distancing, especially since the restrictions are no longer enforced. This study developed a system for self-monitoring and self-alarm when people approach within a radius of 1 meter on the university campuses environement. The distance monitoring system utilizes BLE on the ESP32 microcontroller. Based on the RSSI, a radius of 1 meter is detected with -71 dBm to -75 dBm RSSI. The Android app is designed using MIT Inventor to evaluate anyone who approaches in a day, and this can help trace if anyone is indicated to have COVID-19. Lastly, this device is designed with comfortable consideration in the user's pocket when sitting, standing, or driving a vehicle.
Keywords: BLE, ESP32, MIT Inventor, social distancing, self-monitoring, self-alarm, COVID-19.
1 Introduction
At the beginning of 2020, COVID-19 has become a big problem worldwide. On February 12, 2020, World Health Organization (WHO) officially declared this novel Corona Virus disease in humans as Corona Virus Disease, often referred to as COVID- 19, and on March 11, 2020, WHO declared COVID-19 as a pandemic [1]. On December 31, 2019, the first case of COVID-19 occurred in the city of Wuhan, Hubei Province, China. The patient continued to grow until reports of deaths circulated and imports occurred outside China on January 30, 2020. WHO designated COVID-19 as a Public Health Emergency of International Concern (PHEIC) or a Public Health Emergency of International Concern (KKMMD) [2].
It has been three years since the first case occurred in China. The COVID-19 pandemic is still out there, and in mid-2022, diseases such as monkeypox and tomato flu outbreak in UK and India, respectively [3][4]. Those diseases are also spread through physical contact. Therefore, the Indonesian Government keeps asking the citizens to wear masks, especially in crowded places, such as markets, malls, and tourist places [5]. It is also crucial to maintain social distancing to avoid physical contact. Recently, the restrictions are no longer enforced with economic factors as a consideration. However, as the university campus is a high-risk environment for infection, the University of Surabaya has restricted access to the campus for lecturers, staff, and students.
To comply with government regulations, the University should maintain health protocols such as using a mask and keeping a distance. First, when entering the campus environment, all employees and students take body temperature measurements, and the security forces will check the green status on their respective “PeduliLindungi” mobile
ICSEDTI 2022, October 11-13, Tanjungpinang, Indonesia Copyright © 2023 EAI
DOI 10.4108/eai.11-10-2022.2326427
applications. However, there is no supervision when they are in the classroom, laboratory, or canteen. Keeping distance is the rule that students violate, especially when doing laboratory work, even if the faculty already did class planning, often because of forgetfulness or being too busy discussing.
This paper proposes a self-monitoring and self-alarm system based on BLE to keep social distance on university campuses. Bluetooth Low Energy (BLE) is a subsystem of Bluetooth technology that allows data transmission using less battery power. It is a one- way data transmission system. It is ideal for devices with small batteries that operate continuously for long periods [6].
The overview of the proposed method is presented in Figure 1. The mobile device, which contains ESP32 with its BLE and buzzer packaged in a case, is distributed to each student. This device was brought as a permit for entering the laboratory room. The device can be carried by a student in their pocket, sling bag, or else, but the important thing is it should be got wherever they go on the campuss environment. Distance between students in the lab is periodically measured by sending and receiving BLE advertising packets between devices. The ESP32 Master's location is at the entrance and exit labs, so whenever a student swipes an RFID card to an RFID reader at the door, ESP32 Master will collect their data on the mobile device. The record will be sent to the MySQL database by ESP32 Master, and it will be helpful for monitoring or tracing. When the students interact in the laboratory, if the distance is less than the allowed distance, the buzzer will remain active and give some sound to tell the students that they had close to each other. A loud and noisy sound produced by a buzzer as an alarm will make students stay away from the allowed distance. With this self-alarm, the students can maintain their space with others. The proposed method also provides what is called self-monitoring. By self-monitoring, students can see violations (when close together more than one minute) recorded daily through a smartphone application built using MIT Inventor and supported by MySQL database.
2 Related Works
Prevention of the spread of COVID-19 by keeping a distance is possible if the number of persons in a location or room does not exceed a certain number so that persons can keep their distance from one another. Before the COVID-19 pandemic, there were extensive studies to monitor the number of persons and the congestion level of a location or room using cameras [7][8], sensors [9][10], and Wi-Fi devices [11][12]. However, these studies did not take into account the distance between people (social distancing), which is essential to prevent the spread of COVID-19.
There are also some studies using cameras [13][14] and smartphones [15][16] to watch social distancing. In mid-2021, the Indonesian government issued a smartphone application called "PeduliLindungi". This application records whether it has been vaccinated and whether it is identified as being infected with the COVID-19 virus. The Japanese government uses a smartphone application and Bluetooth to measure the distance between smartphones. Proximity information is recorded when the smartphone is within a distance of 1 meter for more than 15 minutes [17].
According to [18], the use of smartphones is cheap, the system is quickly built, and every student has a smartphone. However, according to [18], each student has a different smartphone model and wearing style, which can affect distance measurement accuracy.
Therefore, they proposed a device called a mobile node wearing a neck strap. This study also agrees that differences in smartphone models will affect the accuracy of distance
measurements. However, draping a mobile node can reduce student comfort. Therefore, this study designed a mobile device to carry in a pocket. This study also pays attention to the device's packaging to ensure student comfort when holding the device.
3 Design of the Proposed System
Figure 1 shows the outline of the proposed method. Mobile devices (hereafter referred to as devices) are distributed to students as lab access privileges. The device supposes to be carried by a student in their pocket, and it should be got wherever they go in the campus environment.
The device contains ESP32 as the main component and has BLE and Wi-Fi features.
The device that every student brings is called a user device. The device that sends the information to the MySQL database is called the master device. BLEs used as a sensor for distance measurement, user-to-user communication, and user-to-master communication. Master device sends data log to MySQL database through the Wi-Fi network. When connected to a Wi-Fi network, the device is assumed to use network time protocols to keep accurate time.
Fig. 1. Overview of the purpose method.
Fig. 2. Mobile Application Constructed by using MIT Inventor.
Devices periodically (every 60 seconds) broadcast BLE advertising packets, which include the UUID (Universally Unique Identifier) of the sender device and its MAC address for device identification. A device receives a neighbor's BLE advertising packets containing the proposed system's UUID, receiving device records the time of reception, RSSI (Received Signal Strength Indication), and source MAC address in its internal memory. When a device gets its BLE packets, it uses RSSI to estimate the approximate distance between devices. The device activates the buzzer if this distance falls below the threshold for more than 60 seconds (the allotted time). Based on the Indonesian government's healthy protocol, the allowed distance is about 1 meter for COVID-19 infection prevention—this value becomes the setting threshold distance in this study.
A smartphone application was created to evaluate the possibility of social distancing violations, whether intentionally or not. In this study, the application built uses the MIT Inventor program, as shown in Figure 2. However, due to the limited storage capacity of the ESP32, the device can only send data daily. This problem is solved by the Master device, which sends log data to the MySQL database. This database is set only to store limited data for a week. This method could be used as a tracing if there (are) student(s) detected infected with COVID-19.
4 Experimental Evaluations
Some measurements focusing on between-device BLE communications were implemented and conducted a fundamental evaluation to verify the feasibility of the proposed system.
4.1 Implementation
The mobile devices as the implemented system of SASDM (self-alarm and social distance monitoring) are presented in Figure 3. SASDM mobile device specification uses ESP32 DOIT microcontroller, BLE, and Wi-Fi (802.11b/g/n) for wireless media communication. A SASDM has small dimensions at 57x35x20 mm and 20 grams in
weight. Except for the master device, those devices are equipped with a buzzer and LED indicator to provide warning information. Each SASDM device consumes a 3.7 V and 650 mAh battery source.
Devices broadcast a BLE advertising packet every five seconds. The advertising packet size of this system is 43 bytes which are header, CRC, flag, 6-bytes mac address, 2-bytes RSSI, and the rest. This paper will evaluate the interlink communication of each mobile device using BLE transmission. Many previous studies have measured RSSI of BLE transmission, while this paper focuses on social distances measurement, which is obtained by measuring RSSI in BLE of SASDM mobile device communications. SASDM will be placed in the pocket of the user who carries this device.
Fig. 3. SASDM Mobile device used in proposed prototype system.
Fig. 4. RSSI against Social Distance.
4.2 Analysis Receiver RSSI Effect on the Social Distance
The first evaluation of this system is analyzing the correlation effect between distance and RSSI measurement from inter-device BLE transmission. Two students in the third- floor laboratory of the Electrical Engineering Department, University of Surabaya, measured these experiments. As a student brings the sender, one device periodically transmits the advertising packet of BLE, while the other receives the transmitted packet
from the sender. Inter-distance of device measurement was varied in a range of 0.5 to 2.5 meters with 0.5 m increments. The sender device will continuously transmit an advertising packet via BLE at each movement distance. Due to BLE transmission being influenced by battery power effects, all devices of this system were powered by wired cable.
The RSSI measurement result of each distance movement is analyzed using average and median distribution, as shown in Figure 4. Using this statistical approach can determine the correlation between RSSI measurement of BLE and its distance modification. The result indicates that RSSI fluctuated at the same distance. Then after deciding the median and average value of RSSIs at each distance, there is an inverse correlation between RSSI and the distance. The RSSI measurement values decrease significantly with the farther distance modification. Therefore, using RSSI measurement from BLE transmission can be estimated the social distances by utilizing a number of times and median or average values of RSSI. Its BLE transmission, accompanied by packet advertisement, can also be used for estimating the close contact of each person.
The distances between devices that still receive BLE advertising packets were also investigated. The results of this evaluation indicated that receiver devices could receive BLE advertising packets from the sender further than 2.5 meters. However, this is limited to close contact with people detection. Hence, the limitation distance of this system is 2.5 m according to the social distance regulations and close contact people detection.
It is important to note that this study obtained RSSI evaluation results under limited conditions. In future work, it is necessary to perform additional evaluations such as measurement scenarios, device combinations, student positions and postures, and environment implementation.
4.3 Analysis of Battery Life for a Day Usage
Next is to evaluate the duration of battery levels on daily usage; the experiments were conducted with two devices at a 1 m separation distance. In these experiments, both sender and receiver devices were powered by their internal battery. Two devices were placed on a laboratory desk because the measurement duration times were long. The SASDM battery voltage fell to 80% after the devices worked for 5 hours. This condition indicates that the battery is enough to be used for one day of study if the most extended student studying on campus is 8 hours. Figure 5 shows the decrease in battery voltage level in units of hours up to 5 hours.
4.4 Analysis of Convenience of Carrying the Device
In addition, the convenience of carrying the device in the student’s pocket is also tested. In Figure 6, it can be seen several conditions for carrying the device in a pocket.
Figure 6 (a), Figure 6 (b), and Figure 6 (c) show when driving a car, standing up, and riding a motorcycle, respectively. This way of carrying the device is more convenient than hanging it with the neck strap, as done in [18].
Fig. 5. Battery Voltage Level Drop Evaluation.
Fig. 6. Several conditions for the device are in the student's pocket, (a) when driving a car, (b) when standing, and (c) when riding a motorcycle.
5 Conclusions
This paper proposes a social distance monitoring system for university areas using BLE indicator transmission among dedicated mobile devices called SASDM devices. The system can be estimated social distance and close contact people conditions from the RSSI measurement value of BLE in 2.5 meters distance separation. The data was collected in the MySQL database via Wi-Fi transmission from mobile devices and server communication. Inter BLE SASDM devices' communication generated a fundamental
correlation between RSSI and distance. The results confirmed that average and median value calculations to the RSSI measurement data could be used for estimating the distance of two devices' separation. Evaluations in this study considered only straightforward situations, so it will be necessary to perform assessments in more extensive and varied environments or conditions in future research. It is also required to consider mechanisms for reducing device power consumption.
References
[1] Arden, M. A., Chilcot, J.: Health psychology and the coronavirus (COVID-19) global pandemic: A call for research. Vol. 25 (2), pp. 231-232. Br J Health Psychol (2020) [2] The Novel Coronavirus Pneumonia Emergency Response Epidemiology Team: The
Epidemiological Characteristics of an Outbreak of 2019 Novel Coronavirus Diseases (COVID-19). Vol. 2 (8), pp. 113-122. China CDC Wkly (2020)
[3] Hraib, M., Jouni, S., Albitar, M. M., Alaidi, S., and Alshehabi, Z.: The outbreak of monkeypox 2022: An overview. Vol. 79, pp. 104069. Annals of Medicine and Surgery (2022)
[4] Chavda, V. P., Patel, K., and Apostolopoulos, V.: Tomato flu outbreak in India. The Lancet Respiratory Medicine. Elsevier BV (2022)
[5] Mirabella, M., Liana, H. M., Ahlyantara, I. W. A., Maharani, D., and Ie, M.: The Effectiveness of Indonesian Government Policies in Dealing with Pandemic Covid-19.
Proceedings of the 3rd Tarumanagara International Conference on the Applications of Social Sciences and Humanities (TICASH 2021). Atlantis Press. (2022)
[6] Public [Online]: Bluetooth Low Energy. https://en.wikipedia.org/wiki/
Bluetooth_Low_Energy
[7] Deleu, E., Elez, S., Gadodia, A., Macvaugh, K., and Zhao, G.: Using Deep Learning for Urban Pedestrian Counting. IEEE MIT Undergraduate Research Technology Conference (URTC). pp. 1-5. (2021)
[8] Csönde, G., Sekimoto, Y., and Kashiyama, T.: Online real-time pedestrian tracking from medium altitude aerial footage with camera motion cancellation. Vol. 217, pp. 103386.
Computer Vision and Image Understanding (2022)
[9] Yu, Y., Qin, X., Hussain, S., Hou, W., and Weis, T.: Pedestrian Counting Based on Piezoelectric Vibration Sensor. Vol. 12 (4), pp. 1920. Applied Sciences (2022)
[10] Alahi, M. E. E., Akhter, F., Nag, A., Afsarimanesh, N., and Mukhopadhyay, S.: Internet of Things (IoT)-enabled pedestrian counting in a smart city. Proceedings of International Conference on Computational Intelligence and Computing. pp. 89-104. (2022)
[11] Guillen-Perez, A., and Cano, M. D.: Pedestrian characterisation in urban environments combining WiFi and AI. Vol. 37 (1), pp. 48-60. International Journal of Sensor Networks (2021)
[12] Sandaruwan, R., Alagiyawanna, I., Sandeepa, S., Dias, S., and Dias, D.: Device-free pedestrian count estimation using wi-fi channel state information. 2021 IEEE International Intelligent Transportation Systems Conference (ITSC). pp. 2610-2616 (2021)
[13] Rahim, A., Maqbool, A., and Rana, T.: Monitoring social distancing under various low light conditions with deep learning and a single motionless time of flight camera. Vol. 16 (2).
Plos one (2021)
[14] Saponara, S., Elhanashi, A., and Gagliardi, A.: Implementing a real-time, AI-based, people detection and social distancing measuring system for Covid-19. Vol. 18 (6), pp. 1937-1947.
Journal of Real-Time Image Processing (2021)
[15] Priyan, L., Johar, M. G. M., Alkawaz, M. H., and Helmi, R. A. A.: Augmented Reality- Based COVID-19 SOP Compliance: Social Distancing Monitoring and Reporting System based on IOT. 2021 IEEE 12th Control and System Graduate Research Colloquium (ICSGRC). pp. 183-188 (2021)
[16] Honnef, A., Sawall, E., Mohamed, M., AlQahtani, A. A. S., and Alshayeb, T.: Zero-effort indoor continuous social distancing monitoring system. 2021 IEEE World AI IoT Congress (AIIoT). pp. 0482-0485 (2021)
[17] Ministry of Health, Labour and Welfare: COCOA, COVID-19 Contact-Confirming Application. https://www.mhlw.go. jp/stf/seisakunitsuite/bunya/cocoa 00138.html. (2020) [18] Kobayashi, Y., Taniguchi, Y., Ochi, Y., and Iguchi, N.: A System for Monitoring Social Distancing Using Microcomputer Modules on University Campuses. 2020 IEEE International Conference on Consumer Electronics - Asia (ICCE-Asia). pp. 1-4 (2020)