Lesson plan

LoRa long-range radio lesson plan

Two Unos, two SX1278 radios and no wire: chirps and spreading factors, an SX1278 driver from its datasheet, real airtime math, binary packets with IDs, duty cycle and dwell rules, what LoRaWAN adds, and an ocean buoy reporting to a shore station.

4 chapters, 7 lessons, about 7 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • Chirps, spreading factors and the SX1278 from its registers.
  • What every packet costs, and how to make each byte count.
  • Duty cycle and dwell time rules, and the network LoRaWAN builds on top.
  • An ocean buoy reporting to a shore station.

Materials for the whole unit

  • Arduino Uno R3 x 2
  • Character LCD with I2C backpack
  • LED
  • LoRa module, SX1278 (Ra-02) x 2
  • Potentiometer
  • Pushbutton
  • Resistor

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 2 h

The radio

Chirps, spreading factors and the SX1278 from its registers.

LessonTimeWhat students do
Spread spectrum: chirps across the seaTwo Unos, two LoRa radios and no wire: a buoy pings the shore every two seconds. What a chirp is, what the spreading factor buys, and how LoRa hears signals below the noise.55 min
  1. Run it: a buoy and a shore station
  2. The shore hears it
  3. What a chirp is
  4. Hearing below the noise
  5. Your own call
  6. The link budget
SX1278 setup, register by registerNo library: the buoy sets up its SX1278 from the datasheet with plain SPI. Reset, version check, LoRa mode, the frequency in three bytes, the modem config, and a packet sent through the FIFO.65 min
  1. Run it: a radio with no library
  2. Sleep, then LoRa mode
  3. The frequency in three bytes
  4. The modem config
  5. Send through the FIFO
  6. Move the channel
  7. On a real bench

Materials

  • Arduino Uno R3 x 2
  • LoRa module, SX1278 (Ra-02) x 2

Check for understanding

Each student finishes "SX1278 setup, register by register" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "On a real bench".

Chapter 2. About 1 h 50 min

Airtime and packets

What every packet costs, and how to make each byte count.

LessonTimeWhat students do
Spreading factor and airtimeThe datasheet formula for time on air, worked out for SF7 to SF12 and two coding rates: why one packet at SF12 takes as long as twenty-four at SF7, and why both ends must agree.55 min
  1. Run it: the price of range
  2. The formula
  3. The coding rate
  4. Time a real packet
  5. Go long: SF12
  6. Picking a spreading factor
Packets and IDsLoRa has no addresses: everyone hears everything. Pack readings into eight binary bytes with a destination, a source, a sequence number and a type, drop what is not yours, and count lost packets.55 min
  1. Run it: binary reports
  2. Eight bytes on the wire
  3. Count what goes missing
  4. The sync word
  5. Not for me
  6. Design your own frame

Materials

  • Arduino Uno R3 x 2
  • LoRa module, SX1278 (Ra-02) x 2

Check for understanding

Each student finishes "Packets and IDs" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Design your own frame".

Chapter 3. About 2 h 10 min

Sharing the air

Duty cycle and dwell time rules, and the network LoRaWAN builds on top.

LessonTimeWhat students do
Duty cycle and the lawThe airwaves are shared, and the law says how much of them you may use. A 1 percent duty cycle guard as the EU 868 MHz rules require, and the US 915 MHz 400 ms dwell limit checked with the airtime formula.55 min
  1. Run it: a buoy that waits its turn
  2. Off time
  3. Held
  4. The US rules: dwell time
  5. The 10 percent sub-band
  6. Good citizens
What LoRaWAN addsLoRa is the radio; LoRaWAN is the network on top. A LoRaWAN-shaped exchange on two plain radios: the frame, the frame counter, Class A receive windows, a queued downlink and an ACK. Explained and modeled, not run.75 min
  1. Run it: a network in miniature
  2. The frame
  3. Keys, the MIC and joining
  4. Class A: listen only after you talk
  5. A downlink waits for you
  6. The frame counter
  7. Ask for an ACK
  8. What the network server does

Materials

  • Arduino Uno R3 x 2
  • LoRa module, SX1278 (Ra-02) x 2

Check for understanding

Each student finishes "What LoRaWAN adds" on their own, without opening the hints. The simulator checks 8 of its 8 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "What the network server does".

Chapter 4. About 1 h 5 min

Boss project

An ocean buoy reporting to a shore station.

LessonTimeWhat students do
Boss: an ocean buoyA buoy at sea reads its wave sensor and reports to a shore station with an LCD: binary frames, a duty cycle budget, a storm mode that reports faster and lights the shore's storm lamp, and an acknowledged SOS.65 min
  1. Run it: buoy 7 at sea
  2. The first report
  3. The shore display
  4. A storm rolls in
  5. SOS
  6. Tune the storm line
  7. Taking it to sea

Materials

  • Arduino Uno R3 x 2
  • Character LCD with I2C backpack
  • LED
  • LoRa module, SX1278 (Ra-02) x 2
  • Potentiometer
  • Pushbutton
  • Resistor

Check for understanding

Each student finishes "Boss: an ocean buoy" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Taking it to sea".

Your class

Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.