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
Top right: sleep current
Bottom right: running current (node with the display)
The code relies on the following hardware:
Any similar hardware should work, but might need some code change.
The Arduino IDE with following libraries (all available from the Arduino Library Manager):
Sample setup with an SH1106 OLED display and a DS18B20 sensor:
arduino_secrets_distr.h
to arduino_secrets.h
and enter your keys obtained from TheThingsNetwork consoleTTNMkrWanNode
uncomment the defines for your sensors.debug.h
choose your debugging option:
#define DEBUG
commented out: no debug code generated#define DEBUG
uncommented: debug on the (USB) serial console.
The node will wait for the console!#define DEBUG
and #define OLED
uncommented: debug messages on the OLED display.ttn.h
you can set your LoRaWan default port and data rateDisconnect power coming from the TPL5110 (DRV) when powering from USB.
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.
Before sleeping the node will check for downlink message:
pp
when sending data