networking recipes

User Tools

Site Tools


IoTLabs: Exploring LoRa Technology

As defined by Semtech, LoRa is a wireless technology developed to create the low-power, wide-area networks (LPWANs) required for machine-to-machine (M2M) and Internet of Things (IoT) applications. The technology offers a very compelling mix of long range, low power consumption and secure data transmission and is gaining significant traction in IoT networks being deployed by wireless network operators.

In this lab, you will implement a prototype of LoRa communication between two wireless modules. This enables you to get hands-on experience with LoRa, assess the radio performance, and prepare future advanced prototypes and experimentations.

  • What are the advantages of the LoRa modulation?
  • How LoRa is compatible with LPWAN requirements and constraints?

1. Hardware Platform

In order to design and implement experiments with LoRa, you will use the following devices:

  • Arduino Mega (x2).
  • LoRa shields from Dragino (x2).
  • Give the characteristics of the Arduino you are using: model, number of pins, type of pins, memory sizes, etc.
  • Give the main characteristics of the LoRa shield from Dragino (
  • What type of Antenna are you using? Explain the corresponding characteristics.
  • Give an estimated cost of your platform.

2. Software Tools

Download the following software on your PC:

Unzip the RadioHead library and copy it to your sketchbook library folder as detailed in

3. Installation

Start by plugging the Dragino shields on the Arduino devices and mounting the antennas as shown in Fig. 1.

Figure 1. Arduino with LoRa Dragino shield.

Connect the two Arduino devices to USB ports on your computer. If this is the first time you use Arduino IDE, make sure to install the necessary USB drivers by selecting Tools > Boards Manager and installing Arduino AVR boards.

Now, you have to choose the Board type as Arduino/Genuino Mega 2560 in the Tools menu and select the corresponding serial Port to start programming your Arduino.

For Arduino Mega 2560, additional drivers for Microsoft Windows can be installed from

4. Running Basic Sketches

Start by setting the central frequency of the LoRa modules. For this, open the RH_RF95.cpp file locate in the RadioHead folder and change the frequency to 868.10 (Group 1), 868.30 (Group 2), and 868.50 MHz (Group 3).


Download the basic sketches that implement a reliable LoRa communication between the two modules. Open the sketches with Arduino IDE, compile and upload on the two arduino modules, respectively. On the serial interfaces, you should obtain similar results as in Fig. 2 and Fig. 3. The client sends a short message and waits for an acknowledgement message from the server. Both modules output the RSSI (received power in dBm) for each received message.

Figure 2. Client serial monitor
Figure 3. Server serial monitor

5. Modifying the Radio Parameters

The typical configuration for LoRa modules consists of 125 kHz sub-channels, a coding rate of 4/5, and a spreading factor equal to 7. You can modify the radio parameters by selecting one of the three available configurations:

  • Bw125Cr45Sf128
  • Bw125Cr48Sf4096
  • Bw31_25Cr48Sf512

Radio configuration is applied in RH_RF95.cpp as in the following example:

  • What is the relation between processing gain and spreading factor in LoRa modulation? Explain.
  • How does the spreading factor impact the coverage of a LoRa transmitter?
  • For each of the three possible configurations of your LoRa module, what is the transmission bit rate? Explain your computation.
  • Compute the receiver sensitivity, assuming the following parameters: channel bandwidth = 125 kHz, spreading factor = 7, coding rate = 4/5, bit error rate (BER) target = 10-4, and receiver noise figure = 6 dB. Refer to this article to determine the mapping between the BER and the SNR.
  • Compare the computed sensitivity to that provided by the Semtech Application Note AN1200.22 for the same parameters.

In the remainder of this lab, you will conduct measurements to validate the obtained theoretical receiver sensitivity.

6. Performance Evaluation

In the following, you will design and implement a set of scenarios that enable to evaluate the performance of the LoRa modulation. As you will deal with scientific assessment, you are required to use scientific tools to show the results. You have the choice between gnuplot, matplotlib with Python, and MATLAB. Take some time to become familiar with one of these software as you will be required to use them in different occasions off your academic programme.

6.1. Round Trip Time

In this section, you will measure the Round Trip Time of LoRa communication under the three different radio configurations. For this, you can start by implementing a function on the client that measures the time between the message sending and the reception of the acknowledge from the server. For example, you can use the micros() function available in the arduino libraries.

  • Draw a box plot of the RTT under the three different radio configurations.
  • Analyze the obtained results and compare with the theoretical computations.

6.2. Packet Error Rate

In this section, you will measure the Packet Error Rate (PER) under the three different radio configurations and for different transmission periods. For this, you can start by implementing a function on the client that measures the ratio of successfully delivered packets.

Only for this test, all groups are required to use the same frequency (for example 868.10 MHz).

  • Draw the PER as a function of the transmission period for the different radio configurations. Analyze your results.
  • What type of mathematical models enables to theoretically compute the PER?

6.3. Coverage

In this section, you will measure the coverage of LoRa modules under the three different radio configurations. For this, you can start by identifying a set of Test Points (TP) on the campus. Then, you should implement a function that sends packets with different radio configurations. Note that the following functions in the Arduino sketch enable to modify on the fly the LoRa parameters:

  • Draw the test points on a map.
  • Give a statistical measure of the PER and the RSSI for each TP with each of the different radio configurations.

6.4. Path Loss

In this section, you will study the properties of the radio channel as used by the LoRa technology. For this, you should obtain a large set of RSSI values for different distances, preferably in a free space setting.

  • Provide the expression of the link budget.
  • Draw the RSSI values as a function of the distance.
  • What is the path loss exponent?
  • Using regressions, compute a value of the path loss exponent. Analyze the result.
  • Compare the obtained sensitivity with the theoretical results computed in the previous section.

In order to compute distances in your experiment, you can get the GPS coordinates as recorded by your smartphone using an application such as Ultra GPS Logger. You can export the time-location correspondence in a CSV format from this application. As for the time-RSSI correspondence, you can use a logger file on your laptop. Finally, the time matching enables you to obtain the RSSI for each GPS location, hence for different distances.

7. Grading

Exemplary Accomplished Developing Beginning
Answer to questions
Design experiments
Analyse results
exploring_lora.txt · Last modified: 2017/10/10 21:31 by samer