1076  LoRaWAN Device Classes

1076.1 Learning Objectives

By the end of this chapter, you will be able to:

  • Differentiate Device Classes: Compare Class A, B, and C devices and their trade-offs
  • Select Appropriate Class: Choose the right device class based on power and latency requirements
  • Understand Receive Windows: Explain RX1 and RX2 timing for each device class
  • Calculate Power Impact: Estimate power consumption differences between classes

1076.2 Prerequisites

Before diving into this chapter, you should be familiar with:

LoRaWAN has three device classes—Class A (lowest power, sensor sleeps except when transmitting), Class B (scheduled receive windows), and Class C (always listening, for actuators needing commands). Choose based on whether you need to send commands back to devices.

Term Simple Explanation
Class A Device sleeps most of time—ultra low power (battery lasts years)
Class B Device wakes at scheduled times to receive commands
Class C Device always listening—can receive commands anytime (higher power)
Uplink Data from device to server
Downlink Commands/config from server to device
RX Window Brief period when device listens for responses

Analogy: Think of checking your mailbox: - Class A: You only check the mailbox right after you send a letter (very occasionally) - Class B: You check the mailbox at scheduled times each day (whether you sent mail or not) - Class C: You stand by the mailbox 24/7 waiting for mail (most responsive, but tiring!)

1076.3 Device Classes Overview

LoRaWAN defines three device classes with different power/latency trade-offs:

Artistic comparison of LoRaWAN device classes showing timing diagrams. Class A opens two short receive windows after each uplink transmission (lowest power, highest latency). Class B adds scheduled receive windows synchronized by gateway beacons (medium power, predictable latency). Class C keeps receive window open continuously except during transmission (highest power, lowest latency). Shows typical current consumption patterns for each class

LoRaWAN Device Classes
Figure 1076.1: LoRaWAN device classes trade off power consumption against downlink latency. Class A is ideal for battery-powered sensors, Class B for devices needing predictable command delivery, and Class C for mains-powered actuators requiring instant response.

1076.3.1 Class A (All Devices)

Bi-directional with scheduled receive slots

  • Lowest power consumption
  • Device initiates all communication
  • Two short receive windows after each uplink
  • Downlink only possible after an uplink

LoRaWAN Class A timing diagram showing device-initiated uplink transmission followed by two receive windows (RX1 at 1 second, RX2 at 2 seconds). Device sleeps between transmissions for lowest power consumption. Downlinks only possible immediately after uplink.

LoRaWAN Class A Timing Diagram
Figure 1076.2: Source: CP IoT System Design Guide, Chapter 4 - LPWAN Protocols

Mermaid diagram

Mermaid diagram

Class A Timing Details:

Parameter Value Notes
RX1 Delay 1 second Opens on same frequency as uplink
RX2 Delay 2 seconds Fixed frequency (869.525 MHz EU868)
RX Window Duration ~500 ms Just long enough to detect preamble
Sleep Current 10-15 µA Between transmissions
TX Current 100 mA During transmission (14 dBm)

1076.3.2 Class B (Beacon)

Bi-directional with scheduled receive slots

  • Medium power consumption
  • Synchronized receive windows using network beacons
  • Allows server-initiated downlinks at scheduled times
  • Reduced latency compared to Class A

LoRaWAN Class B timing diagram showing beacon-synchronized ping slots for scheduled downlink reception. Device wakes periodically to receive beacons and listens during assigned ping slots, enabling server-initiated communication with moderate power consumption.

LoRaWAN Class B Timing Diagram
Figure 1076.3: Source: CP IoT System Design Guide, Chapter 4 - LPWAN Protocols

Class B Key Features:

  • Beacon Period: 128 seconds between gateway beacons
  • Ping Slots: Configurable number of receive slots per beacon period (1 to 128)
  • Maximum Latency: Depends on ping slot periodicity (128 seconds worst case)
  • Power Consumption: ~100 µA average (beacon reception + ping slots)

1076.3.3 Class C (Continuous)

Bi-directional with continuous receive

  • Highest power consumption
  • Nearly continuous receive window
  • Lowest latency for downlink messages
  • Suitable for mains-powered devices

LoRaWAN Class C timing diagram showing continuous receive mode where device listens continuously except during transmission. Provides lowest latency for downlink messages but highest power consumption, suitable for mains-powered devices.

LoRaWAN Class C Timing Diagram
Figure 1076.4: Source: CP IoT System Design Guide, Chapter 4 - LPWAN Protocols

Class C Characteristics:

  • Downlink Latency: < 1 second (immediate response possible)
  • Power Consumption: 15+ mA continuous (RX mode)
  • Battery Life: Not practical for battery operation
  • Typical Use Cases: Street lights, industrial actuators, gateways

1076.4 Device Class Comparison

Graph diagram

Graph diagram
Figure 1076.5: LoRaWAN Device Classes A, B, and C Power and Latency Comparison
Class Power Downlink Latency Use Case
A Lowest Seconds to hours Battery sensors
B Medium Seconds Actuators needing scheduled control
C Highest Milliseconds Mains-powered devices, street lights

1076.4.1 Detailed Comparison Table

Parameter Class A Class B Class C
Sleep Current 10-15 µA ~100 µA avg 15+ mA (always RX)
Battery Life (2000 mAh) 10+ years 3-5 years Days (not practical)
Downlink Initiation Device only Server scheduled Server anytime
Max Downlink Latency Hours (until next uplink) 128 seconds < 1 second
Beacon Required No Yes No
Firmware Update Slow (multicast Class B) Practical Fast
Typical Devices Sensors, meters, trackers Irrigation valves, HVAC Actuators, displays

1076.5 Device Class Selection Flowchart

This decision flowchart provides an approach to selecting the optimal LoRaWAN device class based on power constraints and downlink requirements:

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#16A085', 'lineColor': '#E67E22', 'secondaryColor': '#16A085', 'tertiaryColor': '#7F8C8D'}}}%%
flowchart TD
    START(["Select Device Class"])
    Q1{"Device<br/>battery-powered?"}
    Q2{"Need downlink<br/>commands?"}
    Q3{"Downlink latency<br/>critical?"}
    Q4{"Scheduled<br/>commands OK?"}

    CLASSA["Class A<br/>Battery Optimized"]
    CLASSB["Class B<br/>Beacon-Synchronized"]
    CLASSC["Class C<br/>Always Listening"]

    EXA["Examples:<br/>• Environmental sensors<br/>• Water meters<br/>• Parking sensors<br/>• Asset trackers"]
    EXB["Examples:<br/>• Irrigation valves<br/>• Street lights (timed)<br/>• Access control<br/>• HVAC scheduling"]
    EXC["Examples:<br/>• Smart locks<br/>• Industrial actuators<br/>• Emergency lighting<br/>• Real-time displays"]

    POWER_A["Power: 10-15 µA sleep<br/>Battery: 10+ years<br/>Latency: Minutes-hours"]
    POWER_B["Power: ~100 µA avg<br/>Battery: 3-5 years<br/>Latency: 128s max"]
    POWER_C["Power: 15+ mA always<br/>Battery: N/A (mains)<br/>Latency: <1 second"]

    START --> Q1
    Q1 -->|"Yes"| Q2
    Q1 -->|"No (mains)"| Q3
    Q2 -->|"No"| CLASSA
    Q2 -->|"Yes"| Q4
    Q4 -->|"Yes"| CLASSB
    Q4 -->|"No, immediate"| CLASSC
    Q3 -->|"Yes (<1s)"| CLASSC
    Q3 -->|"No"| CLASSB

    CLASSA --> EXA
    CLASSB --> EXB
    CLASSC --> EXC

    EXA --> POWER_A
    EXB --> POWER_B
    EXC --> POWER_C

    style START fill:#7F8C8D,color:#fff
    style Q1 fill:#2C3E50,color:#fff
    style Q2 fill:#2C3E50,color:#fff
    style Q3 fill:#2C3E50,color:#fff
    style Q4 fill:#2C3E50,color:#fff
    style CLASSA fill:#27ae60,color:#fff
    style CLASSB fill:#E67E22,color:#fff
    style CLASSC fill:#e74c3c,color:#fff
    style EXA fill:#d5f5e3,color:#2C3E50
    style EXB fill:#fdebd0,color:#2C3E50
    style EXC fill:#fadbd8,color:#2C3E50
    style POWER_A fill:#27ae60,color:#fff
    style POWER_B fill:#E67E22,color:#fff
    style POWER_C fill:#e74c3c,color:#fff

Figure 1076.6: LoRaWAN device class selection flowchart guiding class choice based on power source, downlink requirements, and latency constraints. Class A (green) optimizes battery life for sensors. Class B (orange) balances power with scheduled commands. Class C (red) provides instant response for mains-powered actuators. {fig-alt=“Flowchart for LoRaWAN device class selection. Starts with ‘Device battery-powered?’ If yes and no downlinks needed, choose Class A. If downlinks needed with scheduled timing OK, choose Class B. If mains-powered with low latency critical, choose Class C. Each class shows examples and power characteristics: Class A (10-15 µA sleep, 10+ years battery), Class B (~100 µA avg, 3-5 years), Class C (15+ mA always-on, mains required).”}

1076.6 Knowledge Check

Test your understanding of LoRaWAN device classes.

Question 1: A smart parking system needs to detect vehicle presence and report to a central server. Sensors are battery-powered and only need to send data when a vehicle arrives or leaves (a few times per day). Which LoRaWAN device class is MOST appropriate?

Explanation: Class A is ideal for battery-powered sensors with infrequent, event-driven data. After each uplink (vehicle detected), the device opens two short receive windows, then returns to sleep. Since parking sensors don’t need frequent downlinks (no remote commands needed), Class A’s minimal power consumption maximizes battery life (years on a coin cell). Class B’s periodic beacons add unnecessary wake-ups. Class C’s continuous listening would drain batteries in days. The parking sensor pattern—long sleep, brief transmit, immediate sleep—is exactly what Class A optimizes for.

Question 2: An irrigation system needs to receive valve control commands from a central server. Commands must be delivered within 2 minutes, but immediate response is not required. The valves are solar-powered with a small battery backup. Which device class is most appropriate?

Explanation: Class B is optimal for this scenario. The 2-minute latency requirement (128 seconds) matches Class B’s beacon period. Solar power with battery backup can sustain Class B’s ~100 µA average current. Class A would require waiting for the next uplink (could be hours). Class C would drain the backup battery too quickly (15+ mA continuous). Class A with frequent confirmed uplinks wastes duty cycle and doesn’t guarantee command delivery within 2 minutes.

1076.7 Practice Exercise

NoteExercise: Device Class Selection and Power Analysis

Objective: Select appropriate LoRaWAN device class based on application requirements and calculate power consumption

Tasks: 1. Analyze three scenarios and select Class A, B, or C: - Agricultural soil sensor: Sends moisture reading every 30 minutes, no downlink commands needed, must run 5+ years on 2× AA batteries (3000 mAh) - Smart irrigation valve: Sends status every hour, must respond to ON/OFF commands within 5 minutes during watering season (6am-8pm), solar panel + 1000 mAh battery - Emergency alert siren: Rarely transmits status (once per day), must activate within 10 seconds of emergency command, mains powered 2. Calculate daily power consumption for each: - Class A: 15 µA sleep + (TX current 100 mA × airtime seconds) + (RX current 15 mA × RX window duration 2 seconds) - Class B: Class A power + (beacon RX every 128 seconds: 15 mA × 0.5 seconds) + (ping slot RX if downlink pending) - Class C: Class A TX + (continuous RX: 15 mA × 86,400 seconds per day) 3. Determine battery life: For soil sensor (Class A, 1 msg/30 min, SF10 airtime 370ms), compute days until 3000 mAh depleted

Expected Outcome: - Soil sensor → Class A (5+ year battery life: 15 µA sleep dominates, TX is <0.1% duty cycle) - Irrigation valve → Class B (solar rechargeable, 5-minute downlink latency acceptable via ping slots) - Emergency siren → Class C (mains powered, <10 second response required) - Understanding that Class C consumes 1000× more power than Class A due to continuous RX

1076.8 Common Pitfalls

CautionPitfall: Missing the RX1/RX2 Downlink Windows

The Mistake: Developers configure devices expecting downlink commands (ACKs, MAC commands, application data), but downlinks never arrive. The device firmware processes uplink transmission correctly but fails to open receive windows at the precise times required by the LoRaWAN specification.

Why It Happens: Class A devices must open RX1 exactly 1 second (+/- 20 microseconds) after uplink TX ends, and RX2 exactly 2 seconds after. Common causes of missed windows:

  • Clock drift: Low-cost 32 kHz crystals drift 20-100 ppm. After 1 second, 100 ppm drift = 100 microseconds error
  • Processing delays: MCU waking from deep sleep takes 1-5 ms; if not accounted for, RX1 window opens late
  • Incorrect frequency: RX1 uses same frequency as uplink (for EU868); RX2 uses fixed 869.525 MHz at SF12. Misconfiguration means gateway response goes unheard
  • Wrong spreading factor: RX2 defaults to SF12/BW125; if device expects SF9, it won’t decode the response

The Fix: Implement precise timing with calibration:

  1. Pre-calculate wake time: wake_time = TX_end + 1000ms - MCU_wakeup_time - radio_setup_time
  2. Use hardware timers: Don’t rely on software delays; use RTC or timer interrupts
  3. Calibrate crystal: Measure actual crystal frequency and apply correction factor
  4. Configure RX2 correctly: Always SF12, BW125, 869.525 MHz (EU868) or 923.3 MHz (US915)
  5. Test with confirmed uplinks: Send confirmed messages and verify ACKs arrive

Timing budget example (EU868):

TX ends:          T+0 ms
Target RX1 open:  T+1000 ms
MCU wake time:    2 ms
Radio RX setup:   1 ms
Buffer margin:    5 ms
--------------------------
Start wake:       T+992 ms  (1000 - 2 - 1 - 5 = 992)

Without this precision, expect 30-50% downlink loss even with strong signal.

1076.9 Summary

LoRaWAN device classes provide flexibility for different application requirements:

  • Class A: Lowest power, device-initiated communication only, ideal for battery sensors
  • Class B: Scheduled receive windows via beacons, moderate power, suitable for actuators with latency tolerance
  • Class C: Continuous reception, highest power, required for instant command response

The key to selecting the right class is understanding your power budget and downlink latency requirements.

TipWhat’s Next?

Continue to LoRaWAN Security and Joining to learn about encryption, OTAA, and ABP activation methods.