LoRa (Long-Range) High-Density Sensors for Internet of Things

Over the past few years, there has been a growing awareness regarding the concept of Internet of Things (IoT), which involves connecting to the Internet various objects surrounding us in everyday life. The main purpose of this concept closely connected to the smart city issue is increasing the quality of life by contributing to streamlining resource consumption and protecting the environment. The LoRa communication mechanism is a physical layer of the LoRaWAN protocol, de ﬁ ned by the LoRa Alliance. Compared to other existing technologies, LoRa is a modulation technique enabling the transfer of information over a range of tens of kilometers. The main contribution this paper brings to the ﬁ eld is analyzing the scalability of the LoRa technology and determining the maximum number of sensors which can be integrated into this type of monitoring and control architecture. The sensor architecture is speci ﬁ c to the smart city concept that involves the integration of a large number of high-density sensors distributed on a large-scale geographic area. The reason behind this study is the need to assess the scalability of the LoRa technology, taking into consideration other factors, such as the packet payload size, the duty circle parameter, the spreading factor, and the number of nodes. The experimental results reveal that the maximum number of LoRa sensors that can communicate on the same channel is 1,500; furthermore, in order to obtain a high performance level, it is necessary to schedule and plan the network as carefully as possible. The spreading factor must be allocated according to the distance at which the sensor is placed from the gateway.


Introduction
Over the past few years, there has been a growing awareness regarding the concept of Internet of Things (IoT), which involves connecting to the Internet various objects surrounding us in everyday life [1]. Today, it is impossible to develop a smart city without integrating this concept.
The main purpose of the concept is increasing the quality of life by contributing to streamlining of resources and protecting the environment. Considerable efforts have been made to increase the level of performance associated with a large-scale sensor network distributed on a very large geographic area. The battery should last for decades. The potential of these sensors is huge, as well as the number of applications which can be developed in various fields, such as environmental protection, smart cities, smart homes, disaster prevention, waste management, location tracking, smart metering, industrial, agriculture, transport, and logistics [2].
Currently, there are a lot of standards, protocols, and communication mechanisms that promise to more or less solve the main problems of IoT. The main characteristic of this concept is that it provides communication capabilities to a wide number of sensors distributed over a large-scale geographic area. The challenges are great, taking into consideration the fact that the communication distance is limited by the resources available to these sensors (e.g., processing power, information storage, and energy resources). Also, to ensure the highest performance level possible, as well as the integration of a large number of sensors, intensive research focusing on streamlining and improving the communication mechanism is required.
The paper is structured as follows: after a brief introduction, Section 2 presents the main challenges of the LoRa technology, the LoRaWAN communication protocol, and also the various solutions. Section 3 focuses on the experimental results of the developed model, while Section 4 ends this paper.
The main contribution of this paper is the analysis of the scalability of the LoRa technology and the determination of the maximum number of sensors that can be integrated into this architecture. The reason behind this study is the need to assess the scalability of the LoRa technology by taking into consideration additional factors, such as the payload size of the package. As far as the author knows, at this moment, there is no other similar analysis in the scientific literature, and this is also the novelty element of the study.

Large-Scale LoRa Sensors for Long-Range Transmissions
The LoRa modulation uses a modified frequency modulation (frequency-shift keying) that allows data to be transferred over a range of tens of kilometers. Figure 2 shows the LoRa-WAN (long-range wide area network) protocol defined by the LoRa Alliance. The Semtech-patented LoRa modulation is used at the physical level; this modulation operates in the ISM frequency band defined by the geographic area in which the sensors operate. The advantage of LoRa sensors is that they operate in the ISM (Industrial, Scientific, and Medical) license-free bandwidth, so there are no additional license fees. The application level is defined by the user above the MAC level, already defined by the LoRa Alliance. The technology is not connected to a mobile network operator, so there is the possibility for it to be implemented by users in an open-source manner.
In the IoT world, the LoRa communication protocol is seen as the holy grail because it comes to solve many challenges, like ensuring high-density connectivity for large-scale architecture sensors like those integrated in a smart city.
LoRaWAN is a low-power protocol that enables the connection of a sensor to the Internet, ensuring the lowest energy consumption possible [10]. The communication distance can be as long as 15 km in urban environment conditions and much longer in rural communication setups [11].
In previous papers published by the author [12][13][14][15][16][17], different aspects of the LoRa technology were studied, tested, and simulated. The experimental work presented in this paper provides an in-depth analysis of the LoRa scalability problem.
The LoRaWAN architecture is composed of sensors and a gateway module meant to centralize and collect messages received from various sensors. Figure 3 shows the architecture of a LoRaWAN network that includes sensors, gateway modules, and the LoRa network server and application server. When a LoRa node transmits a packet, it is received by the gateway module which, in turn, sends it back to the network server. The latter centralizes and controls the entire LoRaWAN network, being responsible for sending MAC commands that are designed to increase the performance level of the architecture. The necessity of an accurate control of sensor's parameters is very important and must not be neglected when designing a LoRa network [18].
The user interface application is located at the application server, the level where the user can query the data by receiving and viewing different reports. The main advantage of such an architecture is that it can integrate a large number of sensors, because the gateway modules can communicate with multiple sensors at the same time. The network uses a star topology so the architecture is similar to cellular networks. For a device to become a certified LoRaWAN gateway module, it must be able to receive and monitor all 8 channels simultaneously.
This feature allows for a major simplification of the communication mechanism and of the MAC level, because the integration of a routing protocol is no longer required. Thus, each sensor can communicate directly with the gateway module.
This simplicity of connectivity, supported by very longdistance communication, gives the LoRaWAN protocol the possibility to integrate a large number of sensors, with the benefits of a cellular-like topology.
Depending on the type of the application, the LoRa Alliance defines three classes of sensors (as presented in Figure 2):  Journal of Sensors (i) Class A: the sensor periodically sends packets to the gateway module. After completing the sending process, the node keeps the receiver active for a very short period of time, in which it can receive data from the gateway. After completing this cycle, the sensor enters sleep mode in order to save energy. Also, the duty cycle parameter limits the maximum number of packets a sensor can transmit in one day (ii) Class B: unlike class A, this type of sensor has programmed receiving time slots. Therefore, it becomes active more often and awaits messages from the gateway module (iii) Class C: this is the lowest energy efficiency class, because the sensor keeps the receiver constantly active, being able to receive messages from the gateway module at any time Energy efficiency is obtained through an ALOHA channel access mechanism. When a sensor wants to send a message, it does not perform any previous checking of the communication channel for avoiding possible collisions. The long communication distance is obtained at the expense of the transfer rate. The LoRa technology is defined by three main parameters: spreading factor (SF), bandwidth (BW), and carrier frequency. The transfer rate varies by using orthogonal spreading factors which is a compromise between distance and emission power [19]. Thus, a high level of performance is achieved within a communication system in which the frequency band is limited. There are a number of papers in the literature [20][21][22][23][24][25][26][27] dealing with LoRa, but none investigates the issue of scalability.
The European 868 MHz ISM frequency band defines a number of 8 channels, each separated by a bandwidth of 0.3 MHz. Thus, if a sensor wants to send a message, it chooses a spreading factor, the communication channel, and the amount of energy used, and afterwards, it sends the message. After the transmission, the sensor opens two reception slots: the first one second after the completion of the transmission process and the second one second after the previous reception slot. In the event that the gateway module does not have any message to be transmitted, it ignores these slots. If the sensor does not receive any message in the first reception window, it does not open the next slot, thus reducing the power consumption.
The gateway sensors can simultaneously receive and transmit messages on all 8 communication channels, and each of the messages can be sent with a different spreading factor. It is possible to use acknowledgment packets so that the sensors have confirmation that the packet has been received correctly. The implementation of such a mechanism will definitely contribute to the increase of the energy consumption. The sensors receive MAC commands from the network server that coordinates the entire architecture by adapting and modifying parameters, such as the spreading factor and the communication channel through an Adaptive Data Rate (ADR) mechanism. The main purpose is to increase the level of performance [28].
By increasing the bandwidth of a modulated signal, it is possible to compensate the degradation generated by the noise on the communication channel. This is the basic principle of spectral spreading. In classical transmission systems involving DSSS (Direct-Sequence Spread Spectrum), the signal emitted by the transmitter undergoes changes in accordance to a sequence of code [29].
This process is generally performed by multiplying the desired data signal with a propagation code known as the chirp radar sequence for LoRa modulation. The chirp sequence is much faster than the original data signal, and thus, the bandwidth of the given signal is extended; therefore, spectral spreading is performed, and the interference resistance is increased.
Because of the simplicity of this communication mechanism, the hardware structure of sensors is simple; so, a major advantage is that the sensors are very inexpensive. Also, decreasing the number of messages that a sensor can send, increases the energy efficiency.
An important aspect of modulation is that it turns each bit sequence into a symbol, doubling the number of the output samples needed to modulate a symbol. Because of this aspect, the LoRa technology becomes a very slow modulation.
This feature limits the applicability of the mechanism regarding real-time monitoring systems, where latency is important. However, this redundancy makes LoRa a very robust modulation, capable of being demodulated below the noise level, making it possible to reach very large communication distances. Table 1 presents the main characteristics of the LoRa technology.

LoRa Sensor Scalability Analyses and Performance Evaluation
This section presents and analyzes the scalability of the LoRa technology. For these reasons, the LPWAN simulation [30] environment is modified and adapted. The open-source simulator is developed in MATLAB, allowing the integration and development of new functionality models and mechanisms.
In the model, we have integrated the obtained parameters presented in another paper published by the author in [12].

Journal of Sensors
This approach customizes simulation scenarios that have to be as realistic as possible.
The transfer rate R can be determined by the following equation: where SF = spreading factor (7,…,12) and BW = modulation bandwidth (Hz). Table 2 presents the obtained data rates and the time on air (ToA), for a channel bandwidth of 125 kHz and using different payloads for the sent packets. This configuration profile was integrated in the simulation model.
The main purpose was to obtain a model with a high level of performance. The packet error rate (PER) parameter is analyzed in order to assess the performance level. The parameter is analyzed globally at a scenario level, and it is expressed as a percentage, representing the ratio between the number of erroneous received packets and the total number of sent packets.
This parameter is strictly influenced by the number of collisions that may occur on the communication channel. Most of the time, these collisions occur because of the big number of sensors. In the case of the LoRa communication, two messages sent on the same channel with different spreading factors will not interfere with each other, but there may be collisions due to the capture effect phenomenon.
In experimental scenarios, each LoRa sensor sends packets using different configurations (e.g., spreading factors). The PER parameter is influenced by any collisions that may occur on the communication channel. Thus, for a spreading factor SF = 7, we have, as shown in Table 2, a transfer rate of approximately 6.83 kbps; still, the communication distance is reduced, in comparison to using a higher spreading factor. In the first set of modeled scenarios, all sensors communicate using the same spreading factor, while other parameters vary.
The main contribution of this paper is the analysis of the LoRa technology scalability. The influence of the packet payload was analyzed. From the author's best knowledge, this is the first paper that addresses this issue and proposes different solutions. Figure 4 shows the PER parameter when a number of 10,000 sensors are integrated. The spreading factor used is 7. The duty cycle parameter is approximately 0.02%, because   Journal of Sensors we consider this value to be realistic and appropriate to many IoT application. In order to evaluate the performance level with the purpose to model the sensor network, the payload of sent packets varies from 10 bytes to 30 bytes, 50 bytes, and 70 bytes. To achieve an acceptable performance level, it is recommended that the PER parameter does not exceed 10%, thus avoiding the resending of packages.
From the obtained results, we can see that for a 10% PER, when a 70-byte payload is used, the network integrates a number of 200 sensors. We can integrate 50 sensors for a 50-byte payload and almost 1,000 sensors for a 30-byte payload.
If a 10-byte payload is used, the maximum number of sensors that can be integrated into a LoRa architecture is approximately 1,500. Taking into account that a gateway module can communicate and monitor 8 channels simultaneously, the number of sensors that can communicate on a channel can grow even more. Figure 5 shows the PER parameter when a number of 2,000 sensors are integrated and the spreading factor used is 12. The use of the maximum spreading factor determines the selection of the longest communication distance and the lowest transfer rate.
The obtained results show that the PER level is much higher even if the transfer rate is considerably reduced (as shown in Table 2) because the time on air is much higher; so, the packet is more susceptible to collisions. Whereas in the first case we had a PER of 15% for 2,000 sensors if a 10-byte payload was used, in this case, we get a PER of about 98%.
Thus, the experimental scenario where the lowest transfer rate is approximately 0.36 kbps provides the highest PER. These aspects should not be neglected when implementing a LoRa sensor architecture.
Most of the time, the default settings of these sensors involve the use of a spreading factor of 12, obviously for reasons related to the communication range; this results in the crowding of the communication channel, the increase of the number of collisions, and, consequently, in the drastic decrease of the performance level. Figure 6 shows the PER parameter when 5,000 sensors are integrated and the spreading factor used is 7. This experimental scenario involves using the highest transfer rate (6.8 kbps) at the expense of the data transfer distance. It can be noticed that for a number of 5,000 sensors when a 10-byte payload is used, we get a PER of 30%, and when the payload is 70 bytes, PER is 80%. It is obvious that for a value of 100% associated with the PER parameter, no packet is received, and for a value of 0%, all packets are received correctly.
As expected in the case where the payload of the packets is increased, the time on air is also increased; this increases the chances of collisions. The obtained values characterize the LoRa communication mechanism, which is a specific ALOHA. For a possible increase of the performance level, it is imperative to implement a communication channel verification mechanism. Figure 7 presents the PER parameter when 1,000 sensors are integrated and the spreading factor used is 12. It can be noticed that for more than 1,000 sensors, when a payload  5 Journal of Sensors of 10 bytes is used, the PER is 92%, and when the payload is 70 bytes, the PER is 100%.
A comparison with previous scenarios in which SF was 7 reveals the dramatic increase of the PER parameter in the case of long communication distances; consequently, the SF is as high as possible. For these reasons, a better understanding of the LoRa communication mechanism is needed in order to increase the performance level as much as possible. Choosing most often the configuration that ensures the highest radius of communication determines the significant decrease in the number of nodes. This decision must be based on the specifics of the application.
In the second set of modeled scenarios, all sensors communicate using the same spreading factor; the duty cycle parameter is being modified this time by altering the total number of packets sent by each sensor within the network. The main purpose is to assess how the duty cycle influences the performance level. Figure 8 shows the PER parameter in which the duty cycle is varied from 0.1% to 0.5% and the spreading factor used is 7. The maximum regulated duty cycle is 1%, taking into account the limitations imposed by the ISM operation band and the communication power. Thus, the access of a sensor to the communication channel is limited. From the obtained results, it can be noticed that for a duty cycle of 0.5%, the PER parameter reaches the maximum value of 100%, corresponding to the case when no package is received; in comparison, when the duty cycle is 0.1%, the maximum PER is approximately 75%.
The results highlight the importance of choosing properly the spreading factor and the duty cycle when the initial implementation of sensor network is performed. Another parameter that should not be neglected and which is of crucial importance is the payload.
In the third set of modeled scenarios, all sensors communicate using different spreading factors; this time, the number of nodes and the payload of the package are being modified. The purpose of this analysis is to determine the maximum number of sensors that can communicate on a LoRa channel. Thus, for 120 seconds, the LoRa sensors will send random messages using different spreading factors. Figure 9 shows the PER parameter when the payload of packets sent by sensors varies from 10 bytes to 30 bytes, 50 bytes, and 70 bytes. In this test scenario, the sensor network has integrated a number of 1,000 LoRa nodes.
From the results, we can see that the PER parameter increases at the same time with the payload. Thus, for 1,000 sensors, we get a PER of about 40%, while for a 70-byte payload, we get a PER of about 72%. Thus, when the developed LoRa network is deployed and tested, it is very important to choose the appropriate payload. This will influence the performance level and the number of sensors that can be integrated into the architecture. In this situation, we have a uniform distribution of the spreading factor used and, implicitly, a more effective coverage of the spectrum. Figure 10 shows the PER (packet error rate) parameter when the number of LoRa sensors varies from 1,000 to 10,000 nodes.
As expected, with the increase in the number of nodes, the PER parameter increases exponentially. Within this test scenario, the payload is 50 bytes. From the results, we can see that for 1,000 sensors, we get a PER of about 50%; for 4,000 sensors, a PER of 90%; and for 10,000 sensors, a PER of 98%.
Depending on the specificity of the application, in order to ensure the highest level of performance by reducing as much as possible the number of retransmissions, it is not recommended that the PER parameter exceeds 10%. Figure 11 shows a way to allocate the spreading factor parameter based on the distance of the sensors from the gateway module.
The gateway module is placed in the center of the figure. As we can see, the number of sensors with a high spreading factor decreases with the increase of the distance from the    Journal of Sensors gateway. This allocation method has been proposed to increase the performance of the topology by reducing the number of collisions. A possible distribution of the LoRa sensors considering their distance from the gateway module is shown in Table 3. In order to ensure connectivity when the distance from the gateway is increased, the spreading factor is also increased by the network server. This aspect generates a high number of collisions because the packets spent more time on air. The optimization of the radio communication parameters is done by using MAC commands. These commands allow the network server to fully control the entire LoRa network composed of thousands of nodes.
In order to obtain a good level of performance, the number of LoRa nodes that use a high spreading factor must be limited. Thus, it is crucial that the nodes that use high spreading factors be minimum. When the nodes use a high spreading factor (e.g., SF = 10, 11, and 12), the communication channel will be occupied more times, this means that the packets are prone to collisions caused by concomitant transmissions. The use of different spreading factors entails an orthogonal feature that enables the integration of a high number of nodes.
The main contribution of this paper is a detailed analysis of the LoRa technology scalability. In the paper, different scenarios that were analyzed included the influence of the LoRa number of nodes on the PER parameter and the impact of the duty cycle parameter on the performance level of the network. Also, the influence of the packet payload was analyzed. The novelty of this work consists in the payload analyses. Possible solutions to increase connectivity maintaining a high level of performance were proposed by the author.

Conclusions
In this paper, the level of performance of the LoRa technology is assessed by performing a scalability analysis. Thus, the main purpose was to determine the maximum number of sensors that can be integrated into such an architecture specific to the concept of IoT.
Furthermore, a series of solutions and possible improvements that can efficiently contribute to increasing the performance level has been presented. The main contribution of this paper is the analysis of the LoRa technology scalability. The influence of the packet payload was analyzed. From the authors' best knowledge, this is the first study that addresses this issue and proposes different solutions.
The varied parameters from the analyzed scenarios were the following: the spreading factor, the size of the packet payload, the number of nodes, and the duty cycle parameter. If the packet payload is increased, the time on air also increases, thus becoming more susceptible to collisions. The obtained values characterize the LoRa mechanism, which is a specific ALOHA [26]. One possible solution would be to implement and integrate a channel access     Journal of Sensors mechanism; this mechanism can reduce the collisions that decrease the performance of the architecture.
For these reasons, a better understanding of the LoRa communication mechanism is needed so that the performance level is as high as possible. Choosing most of the time the configuration that ensures the highest radius of communication determines a significant decrease in the number of nodes. This decision has to be made according to the specificity of the application, taking into account several factors.
The obtained results highlight the importance of properly choosing the spreading factor and the duty cycle, when the sensor network is initially implemented. Another parameter of crucial importance that should not be neglected is the payload. The experimental results show that once with the increase of the spreading factor, the PER parameter also increases, even if the transfer rate decreases considerably. This behavior is generated by the particularity of the LoRa communication mechanism.
The experimental results obtained show that the maximum number of LoRa sensors that can communicate on the same channel is 1,500 in the configuration with a SF of 7 and a payload of 10 bytes. Thus, in order to achieve a high level of performance, it is necessary to plan the network as carefully as possible, and the spreading factor has to be allocated depending on the distance of the gateway mode sensor. Also, the package size should be as small as possible so that the collision packet exposure is as small as possible.
The number of sensors assigned to operate on a certain spreading factor must be carefully monitored to avoid retransmissions and lower performance levels. Thus, at the level of the network server, the implementation of a mechanism that avoids the allocation of the same factor to a very large number of sensors is necessary; the mechanism can also monitor the distance at which these sensors are placed. Only with an accurate control of these parameters is it possible to integrate as many sensors as possible.

Data Availability
The data results used to support the findings of this study are presented in this paper.

Conflicts of Interest
The author declares that they have no conflicts of interest regarding the publication of this paper.