LoRa - The Wireless Technology for the Internet of Things

I've wanted to explore LoRa for years. A radio range of several kilometers with minimal energy consumption sounds almost too good to be true. For my weather station, I currently use ESP-NOW for the sensors, a proprietary wireless protocol from Espressif Systems that builds upon WiFi technology, but isn't WLAN in the traditional sense. However, the range is relatively limited, and this technology is only compatible with ESP32 or ESP8266 microcontrollers.

In recent weeks, I've been delving into LoRa wireless technology, and since it took me a while to grasp the concept, I'd like to offer a brief introduction. From the basics of chirp spread spectrum modulation and various parameters like spreading factor, bandwidth, and coding rate, to a short overview of LoRaWAN, Meshtastic, and The Things Network.

What is LoRa?

While traditional wireless technologies like Wi-Fi, Bluetooth, or Zigbee are primarily designed for high data rates and bandwidth (with correspondingly limited range and higher energy consumption), LoRa takes a completely different approach. With data rates ranging from a few bits per second to several kilobits per second, the technology achieves ranges of over 15 kilometers in rural areas and penetrates even dense urban areas over several kilometers.

These characteristics make LoRa the ideal wireless technology for the Internet of Things (IoT). LoRa demonstrates its strengths wherever data from sensors needs to be transmitted over long distances with minimal energy consumption. Unlike cellular LPWAN technologies such as NB-IoT or LTE-M, LoRa does not require licensed frequency bands or mobile network contracts, but instead utilizes freely available ISM (Industrial, Scientific, and Medical) bands. This makes the technology suitable for private projects as well.

The story of LoRa begins in 2009 in France, when Nicolas Sornin and Olivier Seller conceived the idea of ​​enabling particularly low-energy radio transmission over long distances. François Sforza joined them in 2010, and together they founded Cycleo. They used Chirp Spread Spectrum (CSS) modulation technology for implementation. Semtech recognized the potential and acquired Cycleo in 2012, developing the first LoRa chips (SX1272/SX1276) with the founders and specifying its own network protocol, LoRaMAC. In 2015, the LoRa Alliance was founded, and the protocol was renamed LoRaWAN to ensure global interoperability and standardized development.

How does Chirp Spread Spectrum (CSS) modulation work?

To understand why this technology is so robust and enables such a range, one must look at the modulation, i.e., the way digital data is converted into a radio signal. Many traditional methods encode data in one of three ways:

  • Amplitude Modulation (AM): The information is contained in the strength (amplitude) of the signal. The digital form is Amplitude Shift Keying (ASK) or simple On-Off Keying (OOK), where "transmitter on" means "1" and "transmitter off" means "0." This is simple but very susceptible to interference.
  • Frequency Modulation (FM): The information is contained in the pitch (frequency) of the signal. The digital form is Frequency Shift Keying (FSK), which abruptly switches between two fixed frequencies for "0" and "1."
  • Phase Modulation (PM): The information is contained in the angle (phase) of the waveform. The digital form is Phase Shift Keying (PSK), which abruptly switches between different phase angles (e.g., 0° for "0" and 180° for "1").

LoRa, on the other hand, uses a completely different approach. It doesn't use fixed frequencies or states. Instead, LoRa uses movement: It generates a signal whose frequency continuously rises (or falls) like a ramp, a so-called chirp. The continuous shifting of this chirp is the actual modulation. This very method, Chirp Spread Spectrum (CSS), makes the signal very resistant to interference and is the key to its range.

The Core Principle: The Chirp

The word "chirp" refers to a signal whose frequency changes linearly over a defined period.

  • An up chirp starts at a low frequency ( f min ) and rises linearly to a high frequency ( f max ).
  • A down chirp does the opposite, decreasing from high to low.

This rising or falling signal is the fundamental symbol, the "data building block" of LoRa. The following diagram illustrates the temporal evolution of a chirp. On the left, you see the signal's progression, and on the right, the corresponding frequency/time graph with the linear frequency increase.

Chirp

The actual information is not encoded by the frequency change itself, but by the cyclical shift of the chirp's starting point. A chirp that starts at the beginning of the bandwidth means something different than a chirp that starts in the middle. The receiver only needs to know the base chirp and compare it to the starting frequency of the received chirp. This frequency shift is the information. The following diagram illustrates the frequency response of a shifted chirp. 

Verschobener Chirp

The duration of the chirp, as well as f min and f max  remain unchanged; only the starting frequency is different.

Die Schlüsselparameter: Spreading Factor, Bandbreite und Coding Rate

Chirp Spread Spectrum (CSS) is therefore the basic principle of LoRa. However, the number of possible shifts, i.e., the symbols, and the duration of a chirp are not arbitrary, but are determined by the parameters Spreading Factor (SF) and Bandwidth (BW).

Spreading Factor

The Spreading Factor (SF) defines how many shifts, and therefore symbols, a chirp can assume. This number is defined as the power of two, 2SF. It follows that a single symbol can carry exactly

log2(2SF)=SF Bits

of information. With a Spreading Factor of 3, there are therefore 2³ = 8 different symbols. The following diagram shows these 8 possible "launch ramps" for the chirp.

Symbole

The receiver only needs to determine which of the 8 ramps was sent in order to decode the 3 bits. LoRa uses a Spreading Factor between SF7 and SF12; more modern Semtech chips can also use SF5 and SF6.

Bandwidth

The bandwidth (BW) is the second crucial parameter of LoRa. It defines the frequency range over which a chirp extends, from the minimum frequency f min  to the maximum frequency f max :

BW=fmax-fmin

In reality, a LoRa chirp is not as smooth as depicted in diagrams, but consists of many small, discrete frequency steps (called chips). The number of these steps corresponds precisely to the number of possible shifts of a chirp, which are used for encoding. A symbol therefore consists of:

NChips=2SF

The chip rate (RChip), i.e., the speed at which these 2SF chips are transmitted, is by definition identical to the bandwidth:

RChip=BW

Each chip thus lasts:

TChip=1BW

This results in the following for the total duration of a symbol (the so-called symbol duration):

TSymbol=2SFBW

From this follows the gross bit rate (Rb) of the signal:

Rb=SF×BW2SF

A larger bandwidth makes the chips shorter and thus the entire chirp faster. This increases the data rate, but simultaneously reduces sensitivity and range, as the received energy per unit of time is more heavily masked by noise. A smaller bandwidth means the opposite. Slower symbols, lower data rate, but significantly greater range and interference immunity. Common values ​​for LoRa are 125 kHz, 250 kHz, and 500 kHz.

Two examples using the SF7/500 kHz and SF12/125 kHz combinations demonstrate the maximum and minimum data rates achievable with LoRa and illustrate the trade-off between speed and range:

  • SF7 (BW 500 kHz):

TSymbol=27500.000 Hz0,000256 seconds (0,256 ms)

Bitrate Rb=7×500.000 Hz2727343,75 Bits/s

  • SF12 (BW 125 kHz):

TSymbol=212125.000 Hz0,032768 seconds (32,77 ms)

Bitrate Rb=12×125.000 Hz212366,21 Bits/s

Although SF12 is only 75 times slower, it wins The high spreading factor gives the signal so much robustness that it can transmit significantly further than a factor of 100, more than the pure time difference would suggest.
Feedback geben

Sensitivity, dBm, and Processing Gain

To understand the exceptional range of LoRa, one must consider the receiver's sensitivity, i.e., the weakest signal it can detect. In radio technology, power is often expressed in dBm (decibels relative to one milliwatt):

  • 0 dBm corresponds to 1 mW (milliwatt) of transmit power.
  • +30 dBm corresponds to 1 W (watt).
  • -100 dBm is an extremely low power of 0.0000000001 mW.

While traditional radio technologies typically require a sensitivity of -100 dBm to -110 dBm, LoRa receivers can decode signals from -125 dBm to -140 dBm.

LoRa's ability to receive these signals, which are far below the noise floor, is made possible by what is known as processing gain (PG). The processing gain quantifies by how many decibels (dB) the signal is amplified by the spreading method. In LoRa, the processing gain is directly linked to the Spreading Factor (SF):

PG=10×log10(2SF)

The processing gain causes a weak signal, which would otherwise be lost in the noise at the receiver, to be highlighted again by decoding the slow chirp pattern. For example, SF12 offers a processing gain of approximately 36 dB, making a signal decodable even if it is 20 to 30 dB weaker than the ambient noise. A high SF essentially sacrifices data rate for a significant increase in noise immunity and range.

Coding Rate

The coding rate (CR) defines the redundancy for forward error correction (FEC), that is, how many additional bits are sent to correct transmission errors. The receiver uses these redundant bits to detect if an error has occurred and to correct the erroneous bits. The available values ​​are 4/5, 4/6, 4/7, and 4/8:

  • CR 4/5: 20% redundancy – can correct 1 out of 5 bits
  • CR 4/6: 33% redundancy – can correct 2 out of 6 bits
  • CR 4/7: 43% redundancy – can correct 3 out of 7 bits
  • CR 4/8: 50% redundancy – can correct 4 out of 8 bits

The actual bit rate decreases as a result:

Reffektiv=Rb×44+n (n=1 to 4)

Therefore, with increasing redundancy, the effective data rate decreases, while the signal's noise immunity increases.

Regulatory Framework: Frequency Bands and Operating Limits

LoRa operates on the license-free ISM bands (Industrial, Scientific, Medical). While the use of these bands is free of charge, it is subject to strict regional regulations to minimize interference and ensure fair access.

Regional Frequency Plans

Frequency allocation is not globally standardized. Therefore, the LoRa Alliance defines regional parameter plans that comply with local regulations:

  • Europe (EU868 & EU433): Primarily uses the 863 to 870 MHz band (EU868). There is also a plan for the 433.05 to 434.79 MHz band (EU433). Regulation is carried out by the ETSI (European Telecommunications Standards Institute).
  • North America (US915): Uses the 902 to 928 MHz band. Here, a Frequency Hopping Spread Spectrum (FHSS) regulation is dominant, which prescribes a maximum dwell time per channel instead of strict duty cycles.
  • Asia (AS923): Uses frequencies around 923 MHz, also with specific national adjustments.

Regulatory Limits in Europe (ETSI)

In Europe, the key regulatory restrictions are duty cycle and maximum transmit power.

Frequency Band (Sub-Band) Max. Transmit Power (ERP) Max. Duty Cycle Typical Use
433,05 – 434,79 MHz 10 mW (+10 dBm) 10 % (variiert) EU433, more susceptible to interference
863,0 – 868,0 MHz (g1) 25 mW (+14 dBm) 1 % Standard uplink channels for LoRaWAN
868,7 – 869,2 MHz (g2) 25 mW (+14 dBm) 0,1 % Very restrictive, often avoided
869,4 – 869,65 MHz (g3) 500 mW (+27 dBm) 10 % LoRaWAN RX2 (downlink), Meshtastic
869,7 – 870,0 MHz (g4) 25 mW (+14 dBm) 1 % (or 10% with LBT/AFA)

As the table shows, the 868 MHz band is more complexly divided. It offers the standard band (g1) for sensor uplinks with a 1% duty cycle and the high-performance "power band" (g3) with 500 mW transmit power and a 10% duty cycle. This g3 band is typically used by LoRaWAN gateways for downlink messages (acknowledgments, commands) in the RX2 window. Meshtastic also uses this band in Europe to benefit from the higher transmit power and more tolerant duty cycle for routing within the mesh network.

Consequences for Time on Air (ToA)

The duty cycle directly impacts the architecture of a LoRa application, as the ToA, i.e., the duration of a single transmission, determines the waiting time until the next transmission:

  • SF7 (BW 500 kHz): A typical 20-byte payload has a ToA of approximately 9.4 milliseconds (ms).
    With a 1% duty cycle, the device must wait 99 * 9.4 ms ≈ 0.93 seconds after transmission.

  • SF12 (BW 125 kHz): The same payload has a ToA of approximately 1.32 seconds (s).
    With a 1% duty cycle, the device must wait 99 * 1.32 s ≈ 130.2 seconds (over 2 minutes) after transmission.

This simplified calculation illustrates that a high spreading factor, necessary for maximum range, drastically reduces the maximum transmission frequency. With SF12, only one transmission every few minutes is possible on a 1% channel, making LoRa unsuitable for applications with high data throughput or low latency.

LoRaWAN, Meshtastic and The Things Network

LoRa defines only the physical transmission layer. It is the protocols and network architectures built upon it that transform the pure radio signal into a usable, scalable system. They define the necessary rules for communication, handle addressing, data security, and interoperability of end devices.

LoRaWAN: The Network Protocol for LoRa

LoRaWAN specifies the complete network protocol for Low Power Wide Area Networks. The LoRa Alliance, a consortium of over 500 companies, develops and maintains the open LoRaWAN specification, which standardizes network architecture, security mechanisms, and device profiles.

Network Architecture: Star-of-Stars Topology

LoRaWAN uses a star-shaped network topology, which differs fundamentally from mesh networks:

End Devices (Sensors/Actuators)
      ↓ ↓ ↓
Gateways (Concentrators)
      ↓ ↓ ↓
Network Server (Central Intelligence)
        ↓
Application Server (Application Logic)

End Devices are the actual IoT devices with LoRa transceivers. They communicate directly with one or more gateways, without multi-hop routing. Gateways act as transparent bridges between end devices and the backend and receive on eight channels simultaneously. The Network Server deduplicates packets from multiple gateways, manages authentication, and optimizes parameters via ADR. The Application Server decrypts the payload and executes the application logic.

Device Classes: Class A, B und C

LoRaWAN defines three device classes with different power profiles:

Class A is the standard for battery-powered sensors: The device initiates all communication and opens two short receive windows after each uplink (RX1 after 1 second, RX2 after 2 seconds). The server can only respond immediately after an uplink.

Class B complements Class A with periodic receive windows synchronized by gateway beacons (every 128 seconds). This enables predictable downlink latencies with moderate power consumption.

Class C keeps the receiver permanently active (except during transmission), resulting in minimal latency with high power consumption – ideal for mains-powered devices.

Security: Two-Layer Encryption

LoRaWAN implements end-to-end security with AES-128 on two layers:

Network Session Key (NwkSKey): Secures MAC layer communication, calculates the Message Integrity Code (MIC), and encrypts MAC commands. The network server knows this key.

Application Session Key (AppSKey): Encrypts the application payload in AES-128-CTR mode. Only the end device and the application server know this key – the network server cannot decrypt the payload.

Activation is performed either via OTAA (Over-The-Air Activation) with dynamic key generation during each join process (secure, recommended) or via ABP (Activation By Personalization) with pre-programmed keys (simpler, but less secure).

Each packet contains a frame counter (FCnt) that prevents replay attacks. The 4-byte MIC authenticates the entire packet and protects against tampering.

Frequency Bands and Data Rates

LoRaWAN uses regionally varying ISM bands:

Europe (EU868): 8 uplink channels (863-870 MHz), various duty cycle limits (1% or 10% depending on the sub-band), RX2 window at 869.525 MHz @ SF12

USA (US915): 64 channels @ 125 kHz + 8 channels @ 500 kHz with channel hopping across all frequencies

Asia: Various variants (AS923, CN470, etc.) with local adaptations

Data rates range from DR0 (SF12BW125, 250 bps) to DR6 (SF7BW250, 11 kbps) in Europe. The Adaptive Data Rate (ADR) algorithm automatically optimizes SF, TX power, and channel utilization based on measured signal quality.

Meshtastic: LoRa without Infrastructure

While LoRaWAN relies on central gateway infrastructure, Meshtastic enables a completely decentralized mesh network based on LoRa. This open-source project aims for off-grid communication without internet access or infrastructure.

Basic principle: Mesh topology

Node A ←→ Node B ←→ Node C
  ↑                   ↑
  ↓                   ↓
Node D ←→ Node E ←→ Node F

Each node is simultaneously a sender, receiver, and router. Messages are routed through the network via flooding with a hop limit: Each node that receives a message forwards it (with a reduced hop counter) until the hop limit is reached. A packet ID cache prevents the same message from being forwarded multiple times.

Modem Configuration and Presets

Meshtastic uses predefined modem presets optimized for different use cases:

LongFast (default): SF11 @ 250 kHz – range ~5-8 km, Airtime ~2s
LongSlow: SF12 @ 125 kHz – range ~10-15 km, Airtime ~8s
MediumFast: SF10 @ 250 kHz – range ~3-5 km, Airtime ~1s
ShortFast: SF7 @ 250 kHz – range ~1-2 km, Airtime ~200 ms

The choice of preset determines the trade-off between range per hop and network throughput.

Security

Meshtastic uses AES-128-CTR encryption with channel-based pre-shared keys. The encryption key is derived from the channel name and PSK. Compared to LoRaWAN, however, it lacks a frame counter (no replay protection) and a message integrity code (no authentication against manipulation). For sensitive applications, additional application-layer encryption should be implemented.

The Things Network: Community-Based LoRaWAN as a Middle Ground

Between professional LoRaWAN and infrastructure-free mesh solutions, The Things Network (TTN) offers an interesting alternative: a free, community-run LoRaWAN network.

The Things Network is a global, open, crowdsourced LoRaWAN network built by a community of over 190,000 members in more than 100 countries. Launched in Amsterdam in 2015, the entire city was provided with LoRaWAN coverage within six weeks.

TTN utilizes standard LoRaWAN technology, but the gateways are operated by community members, and the network server is free to use. The Things Stack is the central LoRaWAN network server, handling routing, security, message deduplication, and ADR optimization..

Coverage and Availability

Many major cities worldwide already have full TTN coverage. You can check if your region has coverage on the TTN map. Unlike Meshtastic, where you are part of the network yourself, TTN requires a gateway within range. If no gateway is nearby, you can set up your own (approximately €300 - €600 investment).

Fair Use Policy

While TTN is free, it does have certain limits:

  • 30 seconds of airtime per device per day (EU868)
  • 10 downlink messages per device per day
  • Maximum 500 bytes payload

This is generous for typical sensor applications (one packet every 5-10 minutes). However, it's unsuitable for streaming data or frequent updates.

Conclusion and Outlook

I hope I have succeeded in explaining the fundamentals of LoRa, especially CSS modulation, in a reasonably understandable way. In the next article, I will show how to implement a simple transmitter and receiver using the ESP32 and a Semtech SX1262 transceiver.

Loading Conversation