AmedeeBulle / TTNMkrWanNode

Ultra Low Power with Arduino MKR WAN
21 stars 3 forks source link
arduino lora lorawan mkr1300 thethingsnetwork

TTN MKRWAN Node Build Status

Background

Proof of concept for an "ultra low power" LoRaWAN / The Things Network node using the Arduino MKR WAN 1300.

The MKR WAN 1300 uses too much power in sleep mode to be used as ultra low power device (a bit more than 1mA).

This proof of concept uses a Texas Instrument TPL5110 Ultra Low Power Timer to bring the sleep current under 50nA.
As the device is completely powered off during sleep time we use a FRAM module to save the LoRaWAN session keys and frame counters.

Two test nodes:
Top left: display and Maxim DS18B20 temperature sensor
Bottom left: Bosch BME280 temperature humidity and pressure sensor
Nodes
Top right: sleep current
Bottom right: running current (node with the display)

Theory of operation

  1. TPL5110 wakes up and power on the MKR WAN 1300
  2. Read saved data from FRAM
  3. Join the network
    1. OTAA the first time (no data in FRAM)
    2. ABP using the saved session keys and frame counters afterwards
  4. Collect data from sensors
  5. Send LoRaWAN payload in Cayenne LPP format
  6. Check for downlink message
  7. Enter sleep mode (raise the Done pin of the TPL5110)

Hardware requirement

The code relies on the following hardware:

Any similar hardware should work, but might need some code change.

Software dependencies

The Arduino IDE with following libraries (all available from the Arduino Library Manager):

Sample setup

Sample setup with an SH1106 OLED display and a DS18B20 sensor:

Fritzing

Operations

Software configuration

Power

Disconnect power coming from the TPL5110 (DRV) when powering from USB.

Initialisation

If the FRAM does not contain valid data or if the button is pressed when the MKR WAN 1300 starts, the device will perform an OTAA join.

Downlink messages

Before sleeping the node will check for downlink message:

Sleep time