11 LoRaWAN Link Budget and ADR
11.1 Learning Objectives
By the end of this chapter, you will be able to:
- Calculate Link Budget: Compute maximum transmission range based on TX power, antenna gains, and receiver sensitivity
- Analyze Spreading Factor Trade-offs: Evaluate how SF affects range, data rate, airtime, and battery life across deployment scenarios
- Apply ADR Algorithm: Configure and assess how Adaptive Data Rate optimizes network performance per device
- Design LPWAN Deployments: Use worked examples to plan LoRaWAN coverage and capacity
11.2 Prerequisites
Before diving into this chapter, you should be familiar with:
- LoRaWAN Network Topology: Understanding network architecture
- LoRaWAN Device Classes: Device communication patterns
- LoRaWAN Security: OTAA and ABP activation
Key Concepts
- Link Budget: Sum of transmit power, antenna gains, and receiver sensitivity, minus path loss; determines maximum range for reliable communication.
- Path Loss: Reduction in signal power as radio waves propagate through space; modeled using Okumura-Hata or log-distance path loss equations for urban/rural environments.
- RSSI (Received Signal Strength Indicator): Measured power level of a received radio signal in dBm; used to assess link quality and proximity to gateway.
- SNR (Signal-to-Noise Ratio): Ratio of desired signal power to background noise; LoRa can decode signals at negative SNR values (down to −20 dB at SF12).
- Sensitivity: Minimum signal power level a receiver can decode; LoRa sensitivity ranges from −123 dBm (SF7) to −137 dBm (SF12).
- Coverage Estimation: Technique combining theoretical link budget with terrain and environment factors to predict gateway coverage radius.
- ADR Optimization: Process of using link budget measurements to set optimal spreading factors, maximizing network capacity while meeting range requirements.
Link Budget is like calculating whether someone can hear you shouting across a field:
- TX Power: How loud you shout (measured in dBm)
- Antenna Gain: Using a megaphone to focus your voice (measured in dBi)
- Path Loss: Sound gets quieter with distance (depends on frequency and obstacles)
- Receiver Sensitivity: How quiet a whisper the listener can hear (measured in dBm)
If your “voice” (signal) is still louder than the listener’s “hearing threshold” (sensitivity) after traveling the distance, communication succeeds!
Spreading Factor (SF) is like speaking slowly vs quickly: - SF7 (fast): Like normal speech—clear if close, but hard to hear far away - SF12 (slow): Like spelling out each word slowly—can be understood from farther away, but takes much longer
| Term | Simple Explanation |
|---|---|
| Link Budget | Total signal strength calculation (TX power + gains - losses) |
| Path Loss | Signal weakening over distance (follows physics) |
| Spreading Factor | Trade-off between range and speed (SF7=fast, SF12=far) |
| ADR | Network automatically adjusts SF for each device |
| Duty Cycle | Regulatory limit on how much you can transmit (1% in EU) |
“Link budget is the math that tells us whether my signal will reach the gateway!” Sammy the Sensor said. “I start with my transmit power, add antenna gain like using a megaphone, then subtract all the losses as the signal travels through air, walls, and trees. If there is still enough signal at the end, communication succeeds!”
“Spreading factor is the magic dial,” Lila the LED explained. “Turn it to SF7 for speed – your message arrives quickly but can only travel a few kilometers. Turn it to SF12 for distance – your message can reach over fifteen kilometers but takes much longer to send. Each step up doubles the airtime but adds about three decibels of sensitivity.”
Max the Microcontroller added, “ADR is the automatic optimizer. After receiving twenty messages from a device, I look at the signal quality and decide whether the spreading factor needs to change. If the signal is strong with lots of margin, I lower the SF to save energy. If it is weak, I raise the SF for more range. The goal is always to use the minimum power needed.”
“The link budget equation is your deployment planning tool,” Bella the Battery said. “Before installing sensors, you calculate whether the signal can make it from each sensor location to the nearest gateway. If the math does not work, you either add another gateway, use a higher antenna, or accept that you need a higher spreading factor, which costs more of my energy.”
11.3 Interactive: Wireless Range and Link Budget Calculator
Estimate the maximum transmission range for your LoRaWAN deployment (and other sub-GHz links with similar parameters) based on transmit power, antenna gains, receiver sensitivity, operating frequency, and environment:
Interactive Animation: This animation is under development.
Link Budget is the total gain/loss in a wireless transmission path: - TX Power: How much power your device transmits (14 dBm typical for LoRa) - Antenna Gains: Better antennas focus energy in desired directions - RX Sensitivity: How weak a signal your gateway can detect (-137 dBm for SF12) - Path Loss: Signal weakens with distance and obstacles
Range Factors:
- Free-space range: Ideal line-of-sight with no obstacles (satellite-like conditions)
- Rural range: Often ~50-70% of free-space due to terrain and vegetation
- Suburban range: Buildings and trees reduce range further
- Urban range: Dense buildings and interference may reduce range to ~20% of free-space
- Spreading Factor: For LoRaWAN, SF12 has better sensitivity (-137 dBm) than SF7 (-123 dBm), which directly increases the link budget
- Use the sliders above to model your own deployment (sensor power, antenna gains, environment).
- You can also open this calculator directly from the Simulation Playground via LoRaWAN Range & Link Budget, where it sits alongside other networking tools.
11.4 Interactive: Spreading Factor Demo
Explore how LoRa’s Spreading Factor (SF) dramatically affects transmission characteristics. SF controls the trade-off between range, data rate, power consumption, and airtime.
11.4.1 What is Spreading Factor?
LoRa uses chirp spread spectrum (CSS) modulation where each symbol is represented by a frequency sweep (“chirp”). The Spreading Factor determines how many chips encode each bit:
- SF7: 128 chips per symbol (fastest, shortest range)
- SF12: 4096 chips per symbol (slowest, longest range)
Higher SF = longer symbols = more robust against noise = more range, but slower data rate and longer airtime.
11.4.2 Interactive SF Explorer
Interactive Animation: This animation is under development.
11.4.3 Key Takeaways
| SF | Best For | Trade-off |
|---|---|---|
| SF7-8 | Near gateways, high data rate needs | Short range, fast |
| SF9-10 | Most urban/suburban deployments | Balanced |
| SF11-12 | Rural, weak signals, deep indoor | Long range, slow |
In Plain English: Higher spreading factor stretches each bit over more time. Like shouting slowly vs speaking quickly - slower is heard farther, but you can say less per minute.
Higher SF = longer airtime = hits duty cycle limits faster!
- EU868: 1% duty cycle = max 36 seconds per hour TX time
- SF12 @ 51 bytes = ~1.8 seconds per message = only 20 messages/hour
- SF7 @ 51 bytes = ~0.1 seconds per message = 360 messages/hour
ADR helps maximize messages within duty cycle limits.
The Misconception: SF12 has the longest range, so use it for reliable communication.
Why It’s Wrong:
- SF12 airtime: 1.3 seconds vs SF7: 41ms (32x longer)
- Duty cycle limit: SF12 allows only 27 messages/hour vs 878 for SF7
- Energy: SF12 uses 32x more battery per message
- Collision probability increases with longer airtime
Real-World Example:
- Smart parking sensor in city center (good coverage)
- Using SF12 “to be safe”: 27 updates/hour max
- Parking turnover: 4 cars/hour average
- Result: Can’t report all events!
- With SF7: 878 updates/hour capacity, plenty of margin
The Correct Understanding:
- Use ADR (Adaptive Data Rate) to automatically optimize
- Start with SF7, only increase if packets are lost
- SF12 is for extreme range cases only (rural, basement)
- Higher SF = diminishing returns on range, major cost in capacity
Let the network optimize, don’t manually set SF12.
11.5 Adaptive Data Rate (ADR) Algorithm
11.5.1 How ADR Works
Interactive Animation: This animation is under development.
11.6 Worked Example: LoRaWAN Airtime and Duty Cycle Calculation
This worked example demonstrates how to calculate time-on-air for LoRaWAN transmissions and determine maximum message rates under EU868 regulatory duty cycle constraints.
A municipality is deploying 500 smart parking sensors across their city center. Each sensor detects vehicle presence using a magnetometer and reports status changes to a central parking management system. The deployment must comply with EU868 regulations (1% duty cycle limit on the 868.0-868.6 MHz band).
Design Questions:
- How long does each transmission take at different spreading factors?
- How many messages can each sensor send per hour/day while remaining compliant?
- What is the trade-off between range and message capacity?
11.6.1 Given Parameters
| Parameter | Value | Notes |
|---|---|---|
| Payload | 10 bytes | Parking status (occupied/vacant) + battery level + timestamp |
| Region | EU868 | Sub-band g1: 868.0-868.6 MHz, 1% duty cycle |
| Bandwidth (BW) | 125 kHz | Standard LoRaWAN bandwidth |
| Coding Rate (CR) | 4/5 | Standard CR = 1 |
| Preamble | 8 symbols | Standard LoRaWAN preamble |
| Header | Explicit (enabled) | Includes payload length |
| CRC | Enabled | 16-bit CRC |
11.6.2 Step 1: Symbol Time Calculation
The fundamental timing unit in LoRa is the symbol time (\(T_s\)):
\[T_s = \frac{2^{SF}}{BW}\]
Where: - \(SF\) = Spreading Factor (7 to 12) - \(BW\) = Bandwidth in Hz (125,000 Hz)
Calculations for each SF:
| SF | \(2^{SF}\) | Symbol Time (\(T_s\)) |
|---|---|---|
| SF7 | 128 | \(\frac{128}{125000} = 1.024\) ms |
| SF8 | 256 | \(\frac{256}{125000} = 2.048\) ms |
| SF9 | 512 | \(\frac{512}{125000} = 4.096\) ms |
| SF10 | 1024 | \(\frac{1024}{125000} = 8.192\) ms |
| SF11 | 2048 | \(\frac{2048}{125000} = 16.384\) ms |
| SF12 | 4096 | \(\frac{4096}{125000} = 32.768\) ms |
Key Insight: Each SF increase doubles the symbol time, which doubles the airtime but improves receiver sensitivity by ~2.5 dB (extending range by ~40%).
Let’s calculate the exact range extension from increasing spreading factor. LoRaWAN receiver sensitivity improves approximately 2.5 dB per SF step. The Friis path loss equation relates distance to signal strength:
\(\text{PL}(d) = 20\log_{10}(d) + 20\log_{10}(f) + 32.44\)
For a given frequency \(f\), path loss scales as \(20\log_{10}(d)\). A 2.5 dB improvement in receiver sensitivity means the signal can tolerate 2.5 dB more path loss:
\(20\log_{10}\left(\frac{d_{\text{new}}}{d_{\text{old}}}\right) = 2.5\)
\(\frac{d_{\text{new}}}{d_{\text{old}}} = 10^{2.5/20} = 10^{0.125} = 1.334\)
So each SF step extends range by 33.4%. Going from SF7 to SF12 (5 steps):
\(\text{Range multiplier} = 1.334^5 = 4.21\)
Practical example: A gateway with 3 km range at SF7 reaches 12.6 km at SF12. But the trade-off is severe:
Airtime penalty: SF doubles each step, so SF12 airtime is \(2^5 = 32\times\) longer than SF7.
For a 20-byte payload at 125 kHz BW: - SF7: \(T_s = 1.024 \text{ ms}\), ~40 symbols → 41 ms airtime - SF12: \(T_s = 32.768 \text{ ms}\), ~35 symbols → 1147 ms airtime
Energy impact: If SF7 uses 0.2 mAh per transmission (40 ms at 180 mA), SF12 uses 6.4 mAh (1147 ms) — draining a 2000 mAh battery 32× faster. A device sending 1 message/hour lasts 285 days at SF7 vs 8.9 days at SF12. This is why ADR is critical: use the minimum SF that maintains link margin.
11.6.3 Step 2: Total Time-on-Air
Complete calculations:
| SF | Symbol Time | Preamble Symbols | Payload Symbols | Total Symbols | Time-on-Air |
|---|---|---|---|---|---|
| SF7 | 1.024 ms | 12.25 | 28 | 40.25 | 41.2 ms |
| SF8 | 2.048 ms | 12.25 | 28 | 40.25 | 82.4 ms |
| SF9 | 4.096 ms | 12.25 | 23 | 35.25 | 144.4 ms |
| SF10 | 8.192 ms | 12.25 | 23 | 35.25 | 288.8 ms |
| SF11 | 16.384 ms | 12.25 | 23 | 35.25 | 577.5 ms |
| SF12 | 32.768 ms | 12.25 | 23 | 35.25 | 1155.1 ms |
11.6.4 Step 3: EU868 Duty Cycle Compliance
EU868 sub-band g1 (868.0-868.6 MHz) has a 1% duty cycle limit:
\[T_{allowed} = 0.01 \times 3600 \text{ seconds} = 36 \text{ seconds per hour}\]
Maximum messages per hour:
\[N_{max/hour} = \frac{T_{allowed}}{T_{packet}}\]
| SF | Time-on-Air | Max Messages/Hour | Max Messages/Day | Typical Range (Suburban) |
|---|---|---|---|---|
| SF7 | 41 ms | \(\frac{36000}{41}\) = 878 | 21,072 | 2-3 km |
| SF8 | 82 ms | \(\frac{36000}{82}\) = 439 | 10,536 | 3-4 km |
| SF9 | 144 ms | \(\frac{36000}{144}\) = 250 | 6,000 | 4-6 km |
| SF10 | 289 ms | \(\frac{36000}{289}\) = 124 | 2,976 | 6-9 km |
| SF11 | 578 ms | \(\frac{36000}{578}\) = 62 | 1,488 | 9-12 km |
| SF12 | 1155 ms | \(\frac{36000}{1155}\) = 31 | 744 | 12-15+ km |
11.6.5 Final Answer: Design Recommendations
| Deployment Scenario | Recommended SF | Daily Message Budget | Justification |
|---|---|---|---|
| City center (gateway every 500m) | SF7-SF8 | 10,000-21,000 | Dense gateway coverage, maximize message capacity |
| Suburban streets (gateway every 2km) | SF9-SF10 | 3,000-6,000 | Balance range and capacity, typical municipal deployment |
| Remote parking lots (sparse coverage) | SF11-SF12 | 700-1,500 | Prioritize range, accept lower message rate |
For our 500-sensor deployment:
- With SF10: Each sensor can send 124 status changes/hour
- Parking turnover: Average 4 status changes per spot per day (2 arrivals + 2 departures)
- Margin: \(\frac{2976}{4}\) = 744x safety margin for status updates
- Heartbeat messages: Can add 1 heartbeat/hour (24/day) and still have 2952 messages/day capacity
Conclusion: SF10 provides 6-9 km range with comfortable margin for parking status + hourly heartbeats + occasional retransmissions.
11.6.6 Interpretation: The Range vs. Capacity Trade-off
Key Takeaways:
- SF12 has 28x longer airtime than SF7 (1155ms vs 41ms)
- Duty cycle limits scale inversely with airtime - SF12 allows only 31 messages/hour vs 878 for SF7
- ADR is essential - The network automatically optimizes SF per device based on link quality
- Design for worst case - Size your deployment assuming devices at coverage edge use SF10-SF12
- Regulatory compliance is non-negotiable - Exceeding duty cycle can result in fines and interference
The calculations above assume 100% delivery rate. In practice, include margin for:
- Confirmed uplinks: Require acknowledgment, may need 1-2 retries
- Interference: Other devices, weather, temporary obstacles
- Network congestion: Gateway capacity limits
Rule of thumb: Design for 50% of theoretical maximum to ensure reliable operation.
11.7 Worked Example: Link Budget and ADR Optimization
Scenario: A smart agriculture deployment covers 500 soil moisture sensors across a 10 km x 10 km farm. One gateway is positioned at the farm center. Some sensors are at the farm perimeter (7 km from gateway). The network uses EU868 and must achieve 99% packet delivery reliability.
Given:
- Gateway TX power: 27 dBm (500 mW, maximum allowed EU)
- Gateway antenna gain: 6 dBi (omnidirectional, 6m height)
- Sensor TX power: 14 dBm (25 mW, typical module)
- Sensor antenna gain: 2 dBi (PCB antenna)
- Frequency: 868 MHz
- Environment: Rural agricultural (moderate foliage)
- Required link margin: 10 dB (for fading, rain attenuation)
Step 1: Calculate free-space path loss at maximum distance
Using the Friis formula: \[FSPL = 20 \log_{10}(d) + 20 \log_{10}(f) + 32.45\]
For 7 km at 868 MHz:
FSPL = 20 x log10(7) + 20 x log10(868) + 32.45
FSPL = 16.9 + 58.8 + 32.45 = 108.15 dB
Step 2: Add environmental losses
Rural environment factor: +8 dB (vegetation, terrain)
Seasonal variation: +3 dB (wet foliage in rainy season)
Total path loss = 108.15 + 8 + 3 = 119.15 dB
Step 3: Calculate uplink link budget (sensor to gateway)
Transmit power (sensor): +14 dBm
Sensor antenna gain: +2 dBi
Path loss: -119.15 dB
Gateway antenna gain: +6 dBi
----------------------------------------
Received signal at gateway: -97.15 dBm
Step 4: Determine required spreading factor
Compare received signal to LoRa sensitivity at each SF:
| SF | Sensitivity | Link Margin | Status |
|---|---|---|---|
| SF7 | -123 dBm | 25.85 dB | Excellent |
| SF8 | -126 dBm | 28.85 dB | Excellent |
| SF9 | -129 dBm | 31.85 dB | Excellent |
| SF10 | -132 dBm | 34.85 dB | Excellent |
With -97.15 dBm received signal, even SF7 provides 25.85 dB margin.
Required margin: 10 dB
Excess margin: 25.85 - 10 = 15.85 dB
Step 5: ADR recommendation
ADR analysis for 7 km sensors:
- Current link margin with SF7: 25.85 dB (15.85 dB excess)
- Recommendation: SF7 is optimal (maximum throughput)
- Capacity: 878 messages/hour under 1% duty cycle
For sensors closer to gateway (e.g., 1 km):
- FSPL at 1 km: 91.3 dB
- Received signal: -69.3 dBm
- Link margin with SF7: 53.7 dB (43.7 dB excess!)
- ADR could reduce TX power to save battery
Result: All 500 sensors can operate at SF7 with comfortable margin. The ADR algorithm will: 1. Confirm SF7 for perimeter sensors (25+ dB margin) 2. Potentially reduce TX power for sensors closer to gateway (energy savings) 3. Only increase SF if packet loss detected (interference, temporary obstruction)
Key Insight: Start with SF7 and let ADR optimize. Many deployments over-provision spreading factor “to be safe,” wasting 90% of potential throughput and battery life. The link budget calculation proves SF7 works at 7 km in rural conditions with 16 dB margin to spare.
11.8 Practice Exercises
11.9 Common Pitfalls
Scenario: 500-space parking garage, 5 floors, LoRaWAN sensors on every space. Gateway mounted on top floor ceiling.
Initial Deployment (No ADR):
Configuration:
- All 500 sensors: SF12 (configured "for safety")
- Transmission: On occupancy change (average 4/day per sensor)
- Payload: 20 bytes (status + battery + timestamp)
- Region: EU868 (1% duty cycle)
Results after 1 week:
- Packet loss: 35-40%
- Battery drain: 15% in first week (extrapolated: 6.7 weeks total life)
- User complaints: Outdated occupancy data
Problem Analysis:
Airtime Calculation (SF12, 20 bytes):
Symbol time at SF12: 32.768ms
Preamble: 12.25 symbols = 401ms
Payload: ~23 symbols = 754ms
Total airtime: 1,155ms per transmission
Duty Cycle Capacity:
EU868 1% limit: 36 seconds per hour per sub-band
Messages per hour per sensor: 1,155ms per message
Maximum: 36,000ms / 1,155ms = 31 messages/hour per sensor
Actual usage:
- 500 sensors × 4 messages/day = 2,000 messages/day
- 2,000 / 24 hours = 83 messages/hour average
- Peak hour (6-9 AM): 400 messages/hour
Collision Probability at SF12:
400 messages in peak hour, 1.155s airtime each:
Total airtime demand: 400 × 1.155s = 462s
Available airtime (8 channels): 8 × 36s = 288s per hour
Oversubscription: 462 / 288 = 1.6x (60% collision risk!)
Solution: Enable ADR:
ADR Analysis After 48 Hours:
Gateway receives 20 uplinks from each sensor
Calculates SNR margin for each sensor
Floor 5 (near gateway): SNR = +12 dB
- Required SNR for SF7: -7.5 dB
- Margin: 12 - (-7.5) = 19.5 dB
- ADR Decision: Reduce to SF7
Floor 3 (moderate distance): SNR = +3 dB
- Required SNR for SF10: -12.5 dB
- Margin: 3 - (-12.5) = 15.5 dB
- ADR Decision: Reduce to SF9
Floor 1 (far + concrete floors): SNR = -9 dB
- Required SNR for SF12: -20 dB
- Margin: -9 - (-20) = 11 dB
- ADR Decision: Keep SF12 (or try SF11)
Final SF Distribution:
Floor 5 (top): 100 sensors → SF7 (airtime: 41ms)
Floor 4: 100 sensors → SF8 (airtime: 82ms)
Floor 3: 100 sensors → SF9 (airtime: 144ms)
Floor 2: 100 sensors → SF10 (airtime: 289ms)
Floor 1 (bottom): 100 sensors → SF11-SF12 (airtime: 578-1155ms)
Results After ADR Optimization:
Airtime Reduction:
Peak hour total airtime:
- SF7 (100 sensors): 100 × 41ms = 4.1s
- SF8 (100 sensors): 100 × 82ms = 8.2s
- SF9 (100 sensors): 100 × 144ms = 14.4s
- SF10 (100 sensors): 100 × 289ms = 28.9s
- SF11-12 (100 sensors): 100 × 867ms = 86.7s (average SF11.5)
Total: 142.3s demand vs 288s capacity
Capacity utilization: 49% ✓ (safe margin)
Battery Life Improvement:
Before ADR (all SF12): 6.7 weeks
After ADR (mixed SF):
- Floor 5 (SF7): 95 weeks (27x improvement)
- Floor 3 (SF9): 47 weeks (7x improvement)
- Floor 1 (SF12): 6.7 weeks (unchanged)
- Average: 49 weeks (7.3x improvement)
Packet Loss Reduction:
Before: 35-40% loss (collision-dominated)
After: 2-3% loss (expected RF conditions)
Improvement: 92% reduction in packet loss
Key Insights:
| Metric | Before ADR | After ADR | Improvement |
|---|---|---|---|
| Average Airtime | 1,155ms | 267ms | 4.3x faster |
| Capacity Utilization | 160% (overloaded) | 49% (healthy) | 3.3x better |
| Battery Life | 6.7 weeks | 49 weeks avg | 7.3x longer |
| Packet Loss | 37% | 2.5% | 14.8x reduction |
Lessons Learned:
- Never use fixed SF12 “for safety” - it wastes 90% of capacity and battery
- ADR needs 20+ uplinks to optimize - wait 48 hours after deployment
- SF distribution follows distance - closer = lower SF
- Collision probability is the hidden killer in dense LoRaWAN networks
- Multi-story buildings create natural SF gradients (concrete floors = path loss)
The Mistake: Setting all uplinks to “confirmed” mode expecting acknowledgments will improve reliability, then experiencing worse performance due to downlink congestion and duty cycle exhaustion.
Why It Happens: Developers familiar with TCP expect acknowledgments to improve reliability. However, LoRaWAN’s asymmetric architecture has severe downlink constraints: gateways have their own duty cycle limits, and Class A devices only have brief receive windows.
The Fix: Use unconfirmed uplinks as the default (95%+ of messages). Reserve confirmed uplinks for truly critical data (alarms, billing events). Implement application-level retry logic instead: if no response received within expected time, retransmit. Design for eventual consistency rather than guaranteed delivery.
The Mistake: Developers configure devices to transmit at maximum allowed power (14 dBm ERP for EU868, 30 dBm EIRP for US915) during OTAA join and initial operation, leaving ADR no room to reduce power consumption when the link is stronger than needed.
Why It Happens: The intuition “more power = better reliability” leads developers to maximize TX power:
- Join anxiety: Fear that join will fail at lower power leads to maximum power configuration
- Ignoring ADR bidirectional optimization: ADR can both increase AND decrease power, but can’t go above the initial maximum
- Testing at desk: Device next to gateway always works at max power, hiding the inefficiency
The Fix: Configure sensible initial TX power and let ADR optimize:
- Start at moderate power: Use 10 dBm for EU868, 20 dBm for US915 as defaults
- Allow power range: Configure TXPowerMin (e.g., 2 dBm) and TXPowerMax (14 dBm)
- Trust ADR: After 20-50 uplinks, ADR will find optimal power for actual link conditions
- Monitor LinkADRReq: Check if network server is sending power reduction commands
11.10 Interactive Lab: LoRaWAN Network Server Simulation
11.10.1 Embedded Simulation
Getting Started:
- Click “Start Simulation” in the Wokwi window above
- Open the Serial Monitor (bottom panel) to see network activity
- The simulation will automatically perform an OTAA join and start sending uplinks
What You’ll See:
- Join Request/Accept: OTAA activation sequence with key derivation
- Uplink Messages: Periodic sensor data transmissions with frame counter
- RX Windows: RX1 (1s) and RX2 (2s) receive windows after each uplink
- MAC Commands: LinkADRReq/Ans for spreading factor optimization
- ADR Updates: Automatic adjustment of SF based on link quality
- Duty Cycle: Transmission timing respecting 1% duty cycle limits
Understanding the Output:
[JOIN] DevEUI: 0x1122334455667788
[JOIN] AppEUI: 0x7766554433221100
[JOIN] Sending Join Request...
[JOIN] Join Accept received!
[JOIN] DevAddr: 0x26011234
[JOIN] NwkSKey and AppSKey derived
[UPLINK] FCnt: 0, SF: 10, Power: 14dBm
[UPLINK] Payload: Temperature=22.5C
[RX1] Window opened (1000ms after TX)
[ADR] LinkADRReq received: SF9, TxPower=11dBm
[ADR] LinkADRAns sent, new settings applied
11.10.2 Challenge Exercises
Try these hands-on experiments to deepen your understanding:
11.11 Summary
This chapter covered:
- Link Budget Calculation: How to estimate maximum range using TX power, antenna gains, and receiver sensitivity
- Spreading Factor Trade-offs: Higher SF = longer range but slower data rate and more airtime
- ADR Algorithm: How the network automatically optimizes SF and TX power per device
- Duty Cycle Constraints: Regulatory limits that restrict message rates, especially at higher SF
- Practical Design: Worked examples for sizing deployments and ensuring compliance
Key Takeaway: Let ADR optimize your network. Start with lower SF (SF7-SF8) and trust the algorithm to increase SF only when needed. This maximizes throughput and minimizes battery consumption while ensuring reliable delivery.
11.12 Knowledge Check
11.13 What’s Next?
| Direction | Chapter | Description |
|---|---|---|
| Continue | LoRaWAN Topic Review | Deeper coverage of specific LoRaWAN topics |
| Review | LoRaWAN Architecture Overview | Summary of all architecture topics |
| Back | LoRaWAN Network Topology | Star-of-stars topology and network components |
| Related | LoRaWAN Device Classes | Class A, B, and C device communication patterns |