Learning Goals 5 min
WiFi is great inside your home but dies at 30 m through walls. Bluetooth dies at 10 m. LoRa (Long Range) regularly works at 2–10 km outdoors with milliwatts of transmit power. That's how cattle trackers, parking sensors, and rural weather stations talk to each other. By the end of this lesson you will:
- Explain the three knobs that give LoRa its range: spread-spectrum modulation, sub-GHz frequencies, and very low data rates.
- Identify common LoRa hardware (SX1276 / RFM95 modules, Heltec WiFi-LoRa boards, LoRaWAN gateways).
- Pick the right frequency band for your region (433 MHz in Asia, 868 MHz in EU, 915 MHz in US/AU) and explain why it matters.
Warm-Up 10 min
Hardware (today is mostly theory; build is L04-18):
- 2 × LoRa modules — RFM95W on a breakout, or Heltec WiFi-LoRa boards (popular all-in-one).
- Antennas (don't power on without one — can damage the radio).
The big number
WiFi: ~30 m through walls, ~100 m line-of-sight.
Bluetooth: ~10 m.
LoRa with default settings: 2–10 km line-of-sight with the same milliwatt-class power budget. World records: 700+ km in ideal conditions (mountain top to mountain top).
Trade-off: throughput. LoRa typically does ~300 bps to ~50 kbps — text messages, not video. For sensor telemetry it's plenty.
New Concept · How LoRa achieves range 25 min
Three knobs
- Chirp Spread Spectrum (CSS) modulation: instead of sending a fixed-frequency carrier with bits modulated onto it, LoRa "chirps" — sweeps through a band of frequencies for each symbol. Receivers can correlate noisy chirps and recover the data even when the signal is well below the noise floor. Robust, slow.
- Sub-GHz frequencies (433 / 868 / 915 MHz): lower frequencies penetrate walls and travel farther for the same power, compared to WiFi's 2.4 GHz. The trade-off is lower available bandwidth.
- Low data rates: the slower you transmit, the more energy each bit has, the lower the noise floor your bit needs to clear. LoRa users explicitly trade speed for range with the "spreading factor" (SF).
Spreading factor
| SF | Symbol time | Data rate | Range (typ.) |
|---|---|---|---|
| SF7 | 1 ms | 5.5 kbps | ~2 km |
| SF9 | 4 ms | 1.7 kbps | ~5 km |
| SF12 | 32 ms | 0.3 kbps | ~10 km+ |
SF12 is the "maximum range, glacial speed" setting. SF7 is the "reasonable speed, modest range" default. Pick by need.
Frequency bands by region
Sub-GHz spectrum is regulated. Use the legal band for your country:
| Region | Band | Notes |
|---|---|---|
| Europe (UK, EU) | 868 MHz | Most popular in Europe |
| US, Canada, AU, NZ | 915 MHz | 915 in NA + AU |
| Asia (e.g. Singapore, India, China) | 433 MHz or 920 MHz | Check local rules. 433 widely used. |
Mix the wrong band and your modules don't communicate. Modules sold as "LoRa 433" vs "LoRa 868/915" have different antennas, different tuning, and won't talk across bands.
LoRa vs LoRaWAN
- LoRa: the physical radio layer. Two modules talk peer-to-peer. We'll do this in L04-18.
- LoRaWAN: a network protocol on top of LoRa. Devices talk to a gateway; gateway forwards to the internet via TCP. The Things Network (TTN) is a free public LoRaWAN. We'll do this in L04-19.
Duty cycle limits
EU 868 MHz: max 1% duty cycle per device. That means a device can transmit for ~36 seconds per hour, total. LoRaWAN's SF12 takes 1+ second per packet, so you get ~36 packets per hour max.
US 915 MHz: instead of duty cycle, "dwell time" rules — at most 400 ms continuous transmit per packet.
Both intentionally keep the band uncrowded. Plan messages accordingly.
What LoRa is great for
- Cattle / wildlife trackers.
- Parking-spot occupancy sensors (city-wide deployment).
- Smart utility meters.
- Soil moisture monitors on remote farms.
- Weather stations off-grid.
- Asset trackers (bikes, shipping containers).
What LoRa is NOT good for: video streaming, real-time control, anything with kbps+ data needs.
Worked Example · Plan a deployment 20 min
Brief — farm soil-moisture network
You have a 2 km × 1 km farm. You want 20 soil moisture probes scattered across it, each reporting to a single base station in the farmhouse. The probes are battery-powered (target: 2 years on 2 × AA).
Step 1 — pick a topology
Star: 20 probes each talk to one base. Simple. No mesh routing. LoRa naturally fits.
Alternative mesh: probes relay for each other. More complex, longer range, but overkill for 2 km.
Step 2 — pick frequency
Asia: 433 MHz. Match modules. Tune antennas for 433.
Step 3 — pick spreading factor
Each probe sends 10 bytes of data once per 15 minutes = 24 × 4 × 10 bytes = 960 bytes / hour total per probe. At SF9 (1.7 kbps) one packet takes ~50 ms. Comfortably under the 1% duty cycle. Range: 5 km, well over the 2 km farm. Pick SF9.
Step 4 — pick hardware
Probes: cheap RFM95 module + ATmega328 + soil probe + 2 × AA. Deep sleep between transmissions; wake every 15 min. Battery life: ~2 years.
Base: ESP32 + RFM95. ESP wakes when LoRa packet arrives, forwards to MQTT, sleeps.
Step 5 — power budget
- Probe deep-sleep: ~5 µA.
- Probe transmit burst: 100 mA for 50 ms = ~1 µAh per packet.
- Probe per hour: 4 × (1 µAh + 5 µA × 15 min) = ~5 µAh + 4 packets × 1 µAh ≈ 9 µAh / hour. Two AA = 2500 mAh × 1000 = 2.5M µAh. Runtime ≈ 280,000 hours ≈ 30 years. Battery self-discharge becomes the real limit (~5 years).
The maths checks out. LoRa is the right radio.
Step 6 — what would NOT work
- WiFi: 30 m range. Would need ~50 access points. Infeasible.
- Bluetooth: 10 m. Worse.
- 4G cellular: works range-wise but each module costs several times more, plus a SIM card with data plan per node. Cost-prohibitive.
- LoRa: cheap modules, no service fee, batteries last years. Winner.
Basic 5 min
A sensor sends a 20-byte packet. Ignore headers. Use the data rates in the spreading-factor table.
- Turn 20 bytes into bits.
- Work out the time on air at SF7, SF9 and SF12. Time = bits ÷ bits per second.
- In the US, one packet may last at most 400 ms. Which SFs are legal there?
It works if you give three times in milliseconds and name the SF that breaks the 400 ms rule.
Challenge 1 5 min
In the EU a LoRa device may be on air only 1 % of the time. So the time from one send to the next must be at least 100 × the airtime.
Write a UNO sketch that pretends to send your SF9 packet from the Basic. It prints send packet N at T s to the Serial Monitor, never faster than the rule allows. Use millis(), not delay().
It works if the printed times are at least 9.4 s apart. Then work out how many packets fit in one hour.
Challenge 2 5 min
SF12 packets take ~1 s on air. Duty cycle limit in the EU: 1 %. What is the maximum number of packets per hour per device?
You want to send a 10 KB photo once a second from a hiker to a base station. Work out the time per photo at SF7. Will LoRa do it?
A gate sensor is 7 km from the base, in open country. Use the range column of the SF table to pick the fastest SF that reaches. Then work out the airtime of its 10-byte packet. Is it legal under the US 400 ms rule?
It works if every answer shows the sum that gets there, with units.
Challenge 3 · Power budget for a help button 10 min
A battery help button sits 1 km from its base. It must last at least 5 years on 2 × AA (2,500 mAh).
- Asleep, it draws 5 µA.
- Each send draws 100 mA for 300 ms.
- It sends when pressed (up to 10 times a day), plus one "still alive" message a day.
- Pick the fastest SF from the table that reaches 1 km.
- Work out the charge per send in µAh. (1 mA for 1 hour = 1,000 µAh.)
- Work out the total charge per day: sends plus sleep.
- Work out how many years the batteries last. Does it meet 5 years?
It works if each step shows its sum, and your answer is in years.
Recap 5 min
LoRa = chirp-spread-spectrum + sub-GHz + low data rate = km-range. Spreading factor trades speed for range. Region-specific bands. Duty cycle limits. Plain LoRa is peer-to-peer; LoRaWAN adds gateway-and-network structure (L04-19). Tomorrow we wire two LoRa modules and talk between them.
- LoRa
- Low-power, long-range radio technology using chirp-spread-spectrum at sub-GHz. Owned by Semtech; chip family includes SX1276, SX1278.
- RFM95 / SX1276
- The most popular LoRa chip in hobby modules. RFM95 = breakout board; SX1276 = bare chip.
- Spreading factor (SF)
- LoRa's speed-vs-range tradeoff knob. SF7 = fast (5.5 kbps, 2 km). SF12 = slow (300 bps, 10+ km).
- Sub-GHz
- Radio bands below 1 GHz (433, 868, 915 MHz). Penetrate walls / foliage better than 2.4 GHz.
- Duty cycle
- Maximum fraction of time a device may transmit. EU 868 MHz: 1% per device. Limits packet rate.
- LoRaWAN
- Network protocol on top of LoRa: devices → gateway → internet. Standardised by the LoRa Alliance.
- The Things Network (TTN)
- Free public LoRaWAN network with thousands of community-run gateways worldwide.
- Star topology
- Many devices → one central base / gateway. The natural LoRa shape.
- Mesh
- Devices relay for each other. LoRa doesn't mesh natively; some libraries (LoRa-MAC, Meshtastic) add it.
Extra Mission 5 min
Part 1 — Design a long-range gadget
Pick something too far away for WiFi, such as a letterbox at the end of a long drive. Design a LoRa link for it on paper.
Your design must include:
- What it senses, and what the base does with the message.
- Your region's legal band.
- The distance, and the SF you chose from the table.
- The packet size, how often it sends, and a check against the duty-cycle rule.
- A battery-life estimate, done like Challenge 3.
Part 2 — Make it
Build the sensing half on a UNO now, with a button or switch as the sensor. Use your Challenge 1 timer to print each "packet" it would send. Never send faster than the duty-cycle rule. In ARD-L04-18 you add the radio.
Bring back next class: your design, the uploaded sketch and a Serial Monitor screenshot. Also bring 2 LoRa modules and 2 boards if you have them.