A Long-Distance Communication Architecture for Medical Devices Based on LoRaWAN Protocol

Recent market studies show that the market for remote monitoring devices of different medical parameters will grow exponentially. Globally, more than 4 million individuals will be monitored remotely from the perspective of different health parameters by 2023. Of particular importance is the way of remote transmission of the information acquired from the medical sensors. At this time, there are several methods such as Bluetooth, WI-FI, or other wireless communication interfaces. Recently, the communication based on LoRa (Long Range) technology has had an explosive development that allows the transmission of information over long distances with low energy consumption. The implementation of the IoT (Internet of Things) applications using LoRa devices based on open Long Range Wide-Area Network (LoRaWAN) protocol for long distances with low energy consumption can also be used in the medical field. Therefore, in this paper, we proposed and developed a long-distance communication architecture for medical devices based on the LoRaWAN protocol that allows data communications over a distance of more than 10 km.


Introduction
With the exponential development of sensor technology and embedded devices, a wide range of gadgets/devices/wearables have been developed in order to monitor different health parameters. The studies show that the market for remote monitoring devices of different medical parameters will grow exponentially. Thus, Juniper Research Company predicted that the market for devices such as remote patient monitoring, health trackers will reach $60 billion by 2023, with a revenue of over $40 billion by 2022 [1]. In another study, Juniper Research Company forecasts that by 2023, more than 4 million individuals will be monitored remotely from the perspective of different health parameters [2].
The Internet of Things (IoT) concept originates back to 1982 when a soft drink machine was connected to the Internet, thus being able to report what drinks it contains but also whether they were cold or not [3]. Later, in 1991, a contemporary view of the IoT in the form of a ubiquitous computing technique was given by Mark Weiser [4]; however, in 1999 Bill Joy gave a clue as to what device-to-device communication could mean on the Internet of Things [5]. In the same year, Kevin Ashton, a technology pioneer and co-founder of the Massachusetts Institute of Technology's Auto-ID Center, proposed the term "Internet of Things" to describe a system of interconnected devices [6].
The basic idea of the IoT is based on the autonomous exchanges of useful data between different embedded devices around us, based on technologies such as Radio-Frequency Identification (RFID) and Wireless Sensor Networks (WSN) [7]. This data is reported by the sensor devices and subsequently processed for decision-making, based on an automated action will be performed [8,9]. Thus, IoT appeared in order to process and store data remotely, and this led to the development of communication and sensor technologies. This also emerges from the large number of research articles that have as object of study the • High-range high-power include 2G, 3G, 4G, and 5G; • Low-range high-power include Ultra-wideband and WI-FI; • Low-range and low-power applications include Bluetooth, ZigBee, Near-Field Communication (NFC), and Bluetooth Low Energy (BLE); • High-range low-power devices include LoRa (Long Range), SigFox, LTE-M, and NB-IoT.
A key area of interest in this paper is the implementation of the IoT applications in the medical field based on Long Range Wide-Area Network (LoRaWAN) protocol for long distances with low energy consumption using LoRa technology. This technology offers an efficient, flexible, and economical solution to real-world problems in urban, rural, and indoor use cases, where cellular and Wi-Fi/Bluetooth Low Energy (BLE) based networks are ineffective.
If we refer to the world problem that exists regarding this Covid pandemic, we can say that the data transmission over long distances based on LoRaWAN technology can be a solution of the future and very viable and helpful not only in the healthcare field but also in fields such as automotive, industrial, smart buildings, and in many others.
The aim of this paper is to design, develop and analyze a long-distance communication architecture for medical devices based on the LoRaWAN protocol.
In this paper, the sections are structured as follows: Section 2 contains a brief related work about the LoRa technology presented in the specialty literature; Section 3 presents the proposed medical device architecture based on LoRaWAN protocol; in Section 4, the hardware and software implementation for the proposed medical device are described, and finally, the conclusions are drawn in Section 5.

Related Works
From research in the field, LoRa was first developed by the start-up Cycleo in 2009, in Grenoble, France, and was acquired three years later by Semtech (USA). In 2015, LoRaWAN was standardized by the LoRa-Alliance, and it is implemented in 42 countries and is still ongoing in other countries, due to various mobile operators (e.g., Bouygues and Orange in France, KPN in the Netherlands, and Fastnet in South Africa) [11].
Since the LoRaWAN protocol is promoted by LoRa Alliance, which consists of more than 5800 member companies, the physical layer of LoRa belongs to and is maintained by Semtech and has announced an extension of the LoRa physical layer called Long Range-Frequency Hopping Spread Spectrum (LR-FHSS). The LR-FHSS is a fast FHSS (Frequency Hopping Spread Spectrum) modulation with bit rates ranging from 162 bits/s to 7.8 bits/s used for uplink only and was designed to introduce higher levels of network flexibility, targeting applications that require differentiated service levels [11,12]. There exist both private and public LoRa networks and everyone can set up their own LoRa gateway.
LoRa represents a wireless communication modulation technique, which uses a variation of Chirp Spread Spectrum (CSS-is a spread spectrum technique, where information is spread out by encoding the information onto a chirped signal which is a linear frequency sweep) to transmit messages. Many older wireless systems use Frequency Shift Keying (FSK) because it is effective for low power but LoRa offers the possibility of communicating using Gaussian Frequency Shift Keying (GFSK). Thus, we work with frequencies under the order of GHz in the unlicensed Industrial, Scientific, and Medical (ISM) band, such as 868 MHz in Europe, 915 MHz in North America, and 433 MHz in Asia [13]. LoRa as well as other wireless technologies using unlicensed ISM bands are limited by duty cycle (1% of communication time in Europe).
LoRa is also based on Chirp Spread Spectrum (CSS) technique, which maintains the same low power characteristics as FSK modulation but significantly increases the communication range. As I say, the transfer rate of the technology is between 300 bps and 50 kbps and it depends on the spread factor and the bandwidth of the channel. Moreover, messages transmitted using different spreading factors can be received simultaneously by LoRa base stations. The maximum payload length for each message is 243 bytes [14]. The Long Low-Power Wide-Area (LPWA) systems operating in the Industrial, Scientific, and Medical (ISM) band have a limited transmission power of 14dBm whereas the transmission power in the cellular bands is from 20 to 23 dBm. The CSS technique has been used in military and space communications for decades, due to the long communication distances that can be obtained and robustness to interference, but LoRa is the first low-cost implementation for commercial use.
In conclusion, the advantage of the LoRa technology is the ability to cover long distances; thus, a single gateway or base station can cover entire cities or hundreds of square kilometers. The range of coverage depends largely on the environment or obstacles in a given area, but LoRa technology and open LoRaWAN protocol have greater coverage than any other standardized communication technology [15].
The network protocol and architecture have the greatest influence in determining the battery life of a node, the network capacity, the quality of service, the security and the variety of applications served by the network. The environmental access control mechanism offered by LoRaWAN protocol allows several end devices to communicate with a gateway using LoRa modulation [13].
For any Low-Power Wide-Area communication network, it is extremely important to incorporate security. LoRaWAN uses two levels of security: one for the network and one for the application. Network security ensures the authenticity of the network node, while the security level of the application ensures that the network operator does not have access to the end-user application data [11].
There are trade-offs in every technology choice, but the features of the LoRaWAN specification in network architecture, the device classes, security, and mobility optimization, address the widest variety of potential IoT applications.
The results obtained in the IoT domain and LoRaWAN-based communications so far have been disseminated for the Internet of Things and for the LoRaWAN-based communications protocol in the research papers such as [15][16][17][18].
Currently, new efficient technologies are being developed and used with the main concern based on energy efficiency and long-distance data transmission, called LPWANs (Low-Power Wide-Area Network). The LoRaWAN specification is an LPWAN communication protocol, which uses the LoRa modulation, and it was developed to connect wireless devices over long distances. LoRaWAN focuses on the requirements of the Internet of Things, such as mobility and location services, two-way communication, and end-to-end security [11]. The LoRaWAN technology can transmit data over long distances, with transmission speeds between 0.3 kbps and 50 kbps and supports secure communications for data packets between 19 and 250 bytes [19]. LoRaWAN allows communications over distances Electronics 2021, 10, 940 4 of 11 of more than 18 km with low energy consumption; the batteries used have a lifespan of at least 4 years. The LoRaWAN enables a transmission power of 25mW in an 868 MHz SRD860 band on a record distance of 766 km that has been reported in special conditions in August 2019 [20]. It is also an emerging technology that is beginning to be used in broad areas such as the Internet of Things (IoT) [9], the Industrial Internet of Things (IIoT) [21], smart cities [22], health [23], etc. The LoRaWAN was designed for sporadic communications from a relatively large number of nodes [24]. In the following, some examples of research related to the use of LoRaWAN are presented.
In [25], the development of a LoRaWAN network infrastructure that is used in monitoring activities in the marine environment is analyzed. The transmission parameters are analyzed in the specific context of an industrial aquaculture facility, establishing a transmission channel from an offshore monitoring structure equipped with a LoRaWAN transmitter, to a shore reception device composed of two LoRaWAN gateways. In conclusion, even using the most unfavorable network settings, the test results show that efficient data transmission can be achieved at a distance of 8.33 km [26].
In [18], the authors did research on the LoRa network architecture and they concluded that compared to other modulation techniques, the LoRa modulation technique offers a high communication link budget as well as better interference immunity.
Other results published in [23] propose a new mobile medical device that can be integrated into an existing medical application. What was interesting is that the device is able to make a diagnosis based on data taken in real-time remotely for patients with heart disease. Thus, ECG-type investigations were also allowed for patients who cannot go to the family doctor or to a specialist for various medical reasons or who are in disadvantaged environments and who also cannot receive specialized medical services.
There are few references in the relevant research database regarding the use of Lo-RaWAN protocol in the healthcare field because LoRaWAN has recently appeared on the market. Starting from medical devices proposed in papers [23,[27][28][29] and based on the results published in papers [18,[20][21][22][24][25][26][30][31][32][33] for LoRaWAN communication, the aim of this paper is represented by the use of the LoRaWAN protocol for long-range communication on medical devices.
LoRaWAN specifications [31,32] describe that LoRa uses a communication channel with a bandwidth of 125 kHz, 250 kHz, or 500 kHz and spreading factors (SF) (in the range 7 to 12) to control the data rate of the transmitted signals (see Table 1). After great research efforts in the field, many solutions have been proposed for transmitting data and parameters either medically or from sensors, which are transmitted either via Bluetooth, USB, Wi-Fi, GSM, or serial (which allows the transmission or reception of data on short distances), but there are very few solutions or proposals for remote and real-time transmission. This article comes with an architectural proposal that is based on remote transmission using LoRa technology.
Based on specialized literature and researches in the field [2,6-10,13-35], we can affirm Based on specialized literature and researches in the field [2,6-10,13-35], we can affirm that the LoRaWAN protocol is the new trend in long-distance communication started from medical devices, automotive, industrial networks, and so on.

The Proposed Medical Device Architecture Based on LoRaWAN Protocol
In [23,28], the authors have proposed a solution for an Internet of m-health things system for remote ECG monitoring. The device allows connection to a central server through the USB, Bluetooth, and GSM interfaces, but this article proposes a new and efficient solution based on LoRa. However, the applicability of the system proposed in [23] can be improved, by integrating the concept into a new perspective of data acquisition and communication such as LoRa technology, which will be the scope of this paper. Nowadays, there are developed and used new efficient technologies having as the main concern the power efficiency and transmission of data at long distances, named LPWANs.
This paper improves the device proposed in [23] by integrating the LoRa technology. In this new context, the device integrates into a medical system that uses the LoRaWAN protocol for long-distance data transmission. The general architecture of the hardwaresoftware system used for validation and testing of long-distance communication of medical devices based on LoRaWAN protocol is presented in Figure 1.
In the proposed architecture (see Figure 1), a device is used with three electrodes that are connected to the Internet through three interfaces: Wi-Fi, Bluetooth, and LoRa (for the first two a smartphone can be used as a gateway). To transmit data on the Internet, the LoRaWAN gateway is used. The data are stored in the Cloud (Server from Figure 1) and can be viewed by the patient, family members, In the proposed architecture (see Figure 1), a device is used with three electrodes that are connected to the Internet through three interfaces: Wi-Fi, Bluetooth, and LoRa (for the first two a smartphone can be used as a gateway).
To transmit data on the Internet, the LoRaWAN gateway is used. The data are stored in the Cloud (Server from Figure 1) and can be viewed by the patient, family members, and the doctor via a GUI interface (via HTTP requests or MQTT subscriptions using a smartphone/tablet/mobile device).
Basically, the device proposed in this article is an update of the device presented in [23]. Through this update, the device can send data over long distances without having an Internet connection or without the use of a smartphone. Instead, a LoRaWAN gateway is needed to transmit the data on the Cloud server and send any alarms that can be generated by the device.
The solution of the proposed architecture is the use of the LoRaWAN technology in the medical field for remote monitoring of patients without additional costs given by the Internet connections. The feasibility and performance of the functional architecture of the proposed medical demonstrative experimental device based on LoRaWAN for validation and testing on medical long-distance communication devices (see Figure 1) will have a huge impact, not only for the medical field as presented in this article but also for fields such as aviation, automotive, industrial, academic, monitoring, management, and so on.
The proposed device can be integrated into an m-IoT system via LoRaWAN protocol. The stack of LoRa consists of the application that is in the top level of the stack and includes applications, possible cloud services, and databases; the Medium Access Control (MAC) layer is the high-level LoRaWAN protocol; and the LoRa modulation that is the physical layer and which is modulated onto the regional ISM bands. Figure 2 presents the architecture of the m-IoT system proposed, and it is organized on four levels such as Thing/Sensing, Edge/Fog Computing, Cloud, and Applications/Services. At the lower level are the devices that can purchase medical parameters at the home's patients without the assistance of qualified personnel. They will send the acquired data to the Fog/Edge computing level via LoRaWAN. At the Fog/Edge computing level, there are LoRaWAN gateways that receive data from the acquisition devices, perform local processing, and then save the data in the Cloud. At the higher-level are the applications/services that can be used by doctors or other dedicated hospital systems to analyze data saved in the Cloud. and the doctor via a GUI interface (via HTTP requests or MQTT subscriptions using a smartphone/tablet/mobile device).
Basically, the device proposed in this article is an update of the device presented in [23]. Through this update, the device can send data over long distances without having an Internet connection or without the use of a smartphone. Instead, a LoRaWAN gateway is needed to transmit the data on the Cloud server and send any alarms that can be generated by the device.
The solution of the proposed architecture is the use of the LoRaWAN technology in the medical field for remote monitoring of patients without additional costs given by the Internet connections. The feasibility and performance of the functional architecture of the proposed medical demonstrative experimental device based on LoRaWAN for validation and testing on medical long-distance communication devices (see Figure 1) will have a huge impact, not only for the medical field as presented in this article but also for fields such as aviation, automotive, industrial, academic, monitoring, management, and so on.
The proposed device can be integrated into an m-IoT system via LoRaWAN protocol The stack of LoRa consists of the application that is in the top level of the stack and includes applications, possible cloud services, and databases; the Medium Access Control (MAC) layer is the high-level LoRaWAN protocol; and the LoRa modulation that is the physica layer and which is modulated onto the regional ISM bands. Figure 2 presents the architecture of the m-IoT system proposed, and it is organized on four levels such as Thing/Sensing, Edge/Fog Computing, Cloud, and Applications/Services. At the lower level are the devices that can purchase medical parameters at the home's patients without the assistance of qualified personnel. They will send the acquired data to the Fog/Edge computing level via LoRaWAN. At the Fog/Edge computing level there are LoRaWAN gateways that receive data from the acquisition devices, perform local processing, and then save the data in the Cloud. At the higher-level are the applications/services that can be used by doctors or other dedicated hospital systems to analyze data saved in the Cloud. Based on these analyzes, the decision can be made to call the patient for a consultation with professional medical devices. In addition, based on these data, analyses of the evolution over time of patients using the ECG acquisition device can be performed. For this analysis to be effective, devices for measuring heart rate, blood sugar, oxygen saturation, or other medical parameters that can be acquired at home without qualified persona assistance can be integrated into the m-IoT architecture. Based on these analyzes, the decision can be made to call the patient for a consultation with professional medical devices. In addition, based on these data, analyses of the evolution over time of patients using the ECG acquisition device can be performed. For this analysis to be effective, devices for measuring heart rate, blood sugar, oxygen saturation, or other medical parameters that can be acquired at home without qualified personal assistance can be integrated into the m-IoT architecture.

Hardware and Software Implementation
The general hardware architecture of the medical experimental device is proposed in Figure 3, and it is designed and developed around an ARM Cortex M3 microcontroller to Electronics 2021, 10, 940 7 of 11 which different sensors and communication interfaces are connected. The ADC (Analog-todigital converter) Sensor and DAC (Digital-to-analog converter) interface are the acquisition sensors of the ECG system that can transmit analog values or use built-in DAC converters to convert the measured analog value to a digital one and transmit the final value to the acquisition board. This way, the signal immunity for the ECG signal obtained from the human body is much precise, and the obtained values are much accurate to be processed. DAC sensor could be the ADAS1000 ECG IC, which has built-in ADC's and transmits the final ECG digital signal to the MCU in order to be processed.

Hardware and Software Implementation
The general hardware architecture of the medical experimental device is proposed in Figure 3, and it is designed and developed around an ARM Cortex M3 microcontroller to which different sensors and communication interfaces are connected. The ADC (Analogto-digital converter) Sensor and DAC (Digital-to-analog converter) interface are the acquisition sensors of the ECG system that can transmit analog values or use built-in DAC converters to convert the measured analog value to a digital one and transmit the final value to the acquisition board. This way, the signal immunity for the ECG signal obtained from the human body is much precise, and the obtained values are much accurate to be processed. DAC sensor could be the ADAS1000 ECG IC, which has built-in ADC's and transmits the final ECG digital signal to the MCU in order to be processed. We use LoRaWAN gateways placed in key-points and develop the coverage area to perform the best possible communication between the devices. USI ® WM-SG-SM-42 lowpower long-range LoRaWAN ® module (see Figure 4), based on the STMicro STM32L0 series ARM Cortex M0 + 32 bit microcontroller (MCU) and Semtech SX1272 ultra-long-range wireless transceiver, is a low power wide area network (LPWAN) wireless module that supports the LoRaWAN long-range wireless protocol.
From the software point of view, this device is developed with the help of a real-time operating system (RTOS) for modularization and efficient control of the response times. The Keil RTX 5 RTOS is used for development. The application on the microcontroller is divided into 6 tasks, each task having a unique priority. The tasks, in descending order of priority, are LoRa, Bluetooth Acquisition, Processing/Aggregation, Logs, and HMI. These tasks use the inter-task communication mechanism provided by RTOS to cooperate through synchronizations and data exchange. We use LoRaWAN gateways placed in key-points and develop the coverage area to perform the best possible communication between the devices. USI ® WM-SG-SM-42 low-power long-range LoRaWAN ® module (see Figure 4), based on the STMicro STM32L0 series ARM Cortex M0 + 32 bit microcontroller (MCU) and Semtech SX1272 ultra-longrange wireless transceiver, is a low power wide area network (LPWAN) wireless module that supports the LoRaWAN long-range wireless protocol.  The application tasks and the data flow between them are presented in Figure 5. The LoRa task deals with communication through the LoRaWAN interface. It will retrieve data from the Processing/Aggregation and Logs tasks to transmit them to the LoRaWAN gateway. Bluetooth handles short-distance communication via the Bluetooth interface. It will retrieve data from the Processing/Aggregation and Logs tasks to send them to a gate- From the software point of view, this device is developed with the help of a real-time operating system (RTOS) for modularization and efficient control of the response times. The Keil RTX 5 RTOS is used for development. The application on the microcontroller is divided into 6 tasks, each task having a unique priority. The tasks, in descending order of priority, are LoRa, Bluetooth Acquisition, Processing/Aggregation, Logs, and HMI. These tasks use the inter-task communication mechanism provided by RTOS to cooperate through synchronizations and data exchange.
The application tasks and the data flow between them are presented in Figure 5. The LoRa task deals with communication through the LoRaWAN interface. It will retrieve data from the Processing/Aggregation and Logs tasks to transmit them to the LoRaWAN gateway. Bluetooth handles short-distance communication via the Bluetooth interface. It will retrieve data from the Processing/Aggregation and Logs tasks to send them to a gateway that is usually a smartphone. The ACQUISITION task deals with the acquisition of data from sensors connected to the microcontroller. The acquired raw data is transmitted to the Processing/Aggregation task for processing and aggregation. The LOGS task retrieves data from the Processing/Aggregation task for long-term storage on an SD flashcard. The HMI task handles the user interface. From here, we can start a new EKC acquisition, and we can view the data acquired from the sensors. The application tasks and the data flow between them are presented in Figure 5. The LoRa task deals with communication through the LoRaWAN interface. It will retrieve data from the Processing/Aggregation and Logs tasks to transmit them to the LoRaWAN gateway. Bluetooth handles short-distance communication via the Bluetooth interface. It will retrieve data from the Processing/Aggregation and Logs tasks to send them to a gateway that is usually a smartphone. The ACQUISITION task deals with the acquisition of data from sensors connected to the microcontroller. The acquired raw data is transmitted to the Processing/Aggregation task for processing and aggregation. The LOGS task retrieves data from the Processing/Aggregation task for long-term storage on an SD flashcard. The HMI task handles the user interface. From here, we can start a new EKC acquisition, and we can view the data acquired from the sensors. The advantage of the proposed device is the use of LoRaWAN communication. The LoRaWAN ® module can perform data transmission over long distances with baud rates range from 0.3 kbps to 50 kbps, and it allows to achieve communication on distances greater than 10km with reduced power consumption. The advantage of the proposed device is the use of LoRaWAN communication. The LoRaWAN ® module can perform data transmission over long distances with baud rates range from 0.3 kbps to 50 kbps, and it allows to achieve communication on distances greater than 10km with reduced power consumption.
Patients can view acquired data after receiving the ECG signal. This can be done from a PC or a smartphone. Figure 6 shows how to view an ECG capture on a PC, and Figure 7 shows the view from a smartphone. The data can be downloaded and saved on the flashcard that was inserted into the PC, on the smartphone, or by connecting via Bluetooth to the device. After viewing, the patient can agree that the data be transmitted to the central server via LoRa. As can be seen from Figures 6 and 7, the ECG capture is not very good in quality because it is made at home but may indicate whether it is necessary to call the patients to the doctor's office for a more detailed consultation with professional devices. a PC or a smartphone. Figure 6 shows how to view an ECG capture on a PC, and Figure 7 shows the view from a smartphone. The data can be downloaded and saved on the flashcard that was inserted into the PC, on the smartphone, or by connecting via Bluetooth to the device. After viewing, the patient can agree that the data be transmitted to the central server via LoRa. As can be seen from Figures 6 and 7, the ECG capture is not very good in quality because it is made at home but may indicate whether it is necessary to call the patients to the doctor's office for a more detailed consultation with professional devices.   shows the view from a smartphone. The data can be downloaded and saved on the flashcard that was inserted into the PC, on the smartphone, or by connecting via Bluetooth to the device. After viewing, the patient can agree that the data be transmitted to the central server via LoRa. As can be seen from Figures 6 and 7, the ECG capture is not very good in quality because it is made at home but may indicate whether it is necessary to call the patients to the doctor's office for a more detailed consultation with professional devices.

Conclusions
In this paper, we proposed a long-distance communication architecture for medical devices based on LoRaWAN Protocol, which is dedicated to long-term health monitoring of users/patients in urban/rural environments without assistance and is integrated into a broader IoT infrastructure. For practical implementation, an ultra-low power highperformance microcontroller from ARM Cortex-M3 (see Figure 3) will be used. The connectivity with the system can be made using Bluetooth Low Energy (BLE) or LoRaWAN ® module to connect the device with a smartphone or other mobile device that can display the acquisition of vital signals.