Skip to Content

What is LoRaWAN? How it works and how to use it with a PLC

LoRa vs LoRaWAN, network architecture, device classes and industrial use
November 17, 2020 by
What is LoRaWAN? How it works and how to use it with a PLC
Boot & Work Corp. S.L, Dani Salvans Quesada

LoRaWAN (Long Range Wide Area Network) is an open network protocol of the LoRa Alliance that runs on top of LoRa radio modulation. LoRa is the physical layer that carries the signal over kilometres with very little power; LoRaWAN is the MAC layer that defines how end devices join the network, send small packets through gateways to a network server, and encrypt them with AES-128. It is designed for sensors and controllers that send a few bytes now and then, run on batteries or sit far from any cable.

This guide explains how a LoRaWAN network is built, the difference between LoRa and LoRaWAN, the three device classes, the limits of payload and airtime, and when an industrial PLC is a good LoRaWAN end device.

LoRa vs LoRaWAN: what is the difference?

LoRaLoRaWAN
What it isRadio modulation (chirp spread spectrum) developed by SemtechNetwork protocol (MAC layer) specified by the LoRa Alliance
LayerPhysical layerMAC layer, on top of LoRa
TopologyPoint to point between two radiosStar of stars: devices, gateways, network server, application server
SecurityNone by itself, the application must add itAES-128 with network and application session keys
Join and device managementNot definedOTAA or ABP activation, adaptive data rate, frame counters
Typical usePrivate link between two PLCs or a PLC and a sensorMany sensors over a public or private network, cloud integration
LoRaWAN protocol stack: application, LoRaWAN MAC, MAC options with classes A, B and C, LoRa modulation and regional ISM bands
LoRaWAN stack: the application on top of the LoRaWAN MAC with its classes A, B and C, on LoRa modulation in a regional ISM band. The LoRaWAN Regional Parameters define plans such as EU868, EU433, US915, AU915 and AS923.

For the radio side, spreading factors and point to point links, see what is LoRa.

How a LoRaWAN network works

  1. End devices (sensors, PLCs) send an uplink by LoRa radio. They are not linked to one gateway.
  2. Gateways receive every LoRaWAN packet in range and forward it over Ethernet, Wi-Fi or cellular to the network server. A gateway does not decrypt the payload.
  3. The network server removes duplicate packets received by several gateways, checks the message integrity code, manages the data rate and schedules downlinks.
  4. The application server decrypts the payload and passes the data to your software: MQTT, HTTP, a database or a SCADA system.
LoRaWAN network architecture: LoRaWAN sensors, gateways, network server and application servers connected by LoRa and by Ethernet, Wi-Fi or cellular
LoRaWAN network: sensors send by LoRa to the gateways, which forward the packets by Ethernet, Wi-Fi or cellular to the network server and the application servers.

The network can be public, such as The Things Network or an operator network, or private, with your own gateways and network server on site.

Main characteristics of LoRaWAN

CharacteristicValue or behaviour
RangeSeveral kilometres with line of sight in open terrain, much less in cities and inside buildings. It depends on antenna height, terrain and spreading factor
PayloadSmall. In EU868, from 51 bytes at SF12 to 222 bytes at SF7 (242 bytes in networks without repeaters)
Airtime limit1 % duty cycle in most EU868 sub-bands. Public networks such as The Things Network add a fair use policy of 30 s of uplink airtime per device and day
SecurityAES-128: the network session key protects integrity, the application session key encrypts the payload end to end
ActivationOTAA (keys derived at each join, recommended) or ABP (fixed keys)
PowerLow. A class A device can sleep between uplinks and run on batteries

LoRaWAN is not made for continuous data, control loops or video. It fits values that change slowly or events: levels, temperatures, counters, alarms, states.

LoRaWAN device classes A, B and C

ClassWhen it can receivePowerTypical device
AOnly in two short receive windows after each uplink. All devices must support itLowestBattery sensors that report and sleep
BAlso in scheduled ping slots, synchronised by beacons from the gatewaysMediumDevices that need downlinks at known times
CAll the time, except while transmittingHighestMains powered devices that receive commands, such as a PLC that drives outputs

LoRaWAN with an industrial PLC

A PLC is a good LoRaWAN end device when the site has no cable or cellular coverage, or when many small values must reach a central system: remote tanks and pumps, wells, solar fields, farms, cold rooms. The PLC reads its local inputs, packs a few bytes and sends an uplink every few minutes or when an alarm changes. Local control stays in the PLC; LoRaWAN only carries the data and, if needed, slow commands.

See LoRaWAN in a real installation. In the people counting case study, photocells at the accesses of a square feed an ESP32 PLC with LoRa, and the counts go to a history in the cloud. To try remote telemetry without hardware, open the remote site telemetry simulator: a town water network with alarms and night-flow leak detection.

Read the case studyOpen the simulator

FAQ about LoRaWAN

Is LoRaWAN the same as LoRa?

No. LoRa is the radio modulation. LoRaWAN is the network protocol that runs on LoRa and adds addressing, security, activation and the gateway and server architecture.

How far does LoRaWAN reach?

Several kilometres with line of sight in open terrain, and much less in cities and inside buildings. Antenna height and spreading factor make the biggest difference.

How much data can a LoRaWAN device send?

A few bytes per message and a few messages per hour. In EU868 the maximum payload goes from 51 bytes at SF12 to 222 bytes at SF7, and the duty cycle and network policies limit the total airtime.

Do I need my own gateway?

Not if a public network such as The Things Network covers your site. For a plant or a remote site without coverage, an own gateway and a private network server give full control.

Is LoRaWAN secure?

Yes. Each message has an integrity code and the payload is encrypted end to end with AES-128. With OTAA activation, new session keys are derived at each join.

​Search in our Blog

What is LoRaWAN? How it works and how to use it with a PLC
Boot & Work Corp. S.L, Dani Salvans Quesada November 17, 2020
Share this post

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.

PLC Comparison