Dragino LSN50 LoRa Sensor Node User manual

Category
Gateways/controllers
Type
User manual
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 1 / 69
LSN50 LoRaWAN Sensor Node User Manual
Document Version: 1.7.4
Image Version: v1.7.0
Version
Description
Date
1.0
Release
2018-Dec-4
1.1
Add steps of install STM320x; Add ST-Link Upload firmware method
2018-Dec-27
1.2
Add trouble shooting for UART upload, Add change log for firmware v1.4
2019-Jan-23
1.2.1
More detail description for 8 channel mode and trouble shooting for using in
US915/AU915
2019-Feb-21
1.2.2
Modify trouble shooting for upload via Flashloader
2019-Mar-13
1.2.3
Add ISP Mode / Flash mode different/
Add working flow diagram (Chapter 2.1 how it works)
Add FAQ for how to configure the Keys
2019-Apr-1
1.5.0
Upgrade to v1.5 version firmware
Add ultrasonic sensor support and description.
Add downlink description
Change decoder for v1.5
Add working flow chart
Add Datacake support
2019-Apr-19
1.5.1
Improve Interrupt feature, change interrupt example to use door sensor
1.5.2
Various minor text and format edits.
2019-Jun-10
1.6.0
Update to firmware v1.6 version, add 3ADC mode
2019-Aug-7
1.6.1
Trouble shooting for AT Command input
Add support for 3 * DS18B20 (MOD4)
2019-Sep-18
1.6.2
Add door sensor detail/ power, Add battery connector info
2019-Dec-13
1.6.3
Add firmware version 1.6.2 change log, Add support for HX711 Weight Sensor
2019-Dec-31
1.6.4
Add New AT Command for 1.6.3. Add LSN50 v2.0 Hardware info
2020-Jan-13
1.6.5
Add battery measure suggestion, Add ADC range, Add change log for v1.6.4
2020-May-19
1.6.6
Add MOD=6 (counting) for firmware version v1.6.5, Update description for
interrupt and 5v out, correction of digital input payload, change description for
MOD=2 and MOD=5.
2020-Jul-15
1.7.0
Upgrade manual for v1.7.0. See change log.
2020-Nov-6
1.7.1
Add working mode payload, Add illumination sensor
2020-Dec-5
1.7.2
Correct ADC payload position error for MOD1 and MOD2, Add boot mode
description, add VDD, +5v Out description.
2021-Jan-23
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 2 / 69
1.7.3
Add Power on photo for LSN50v2, add jumper info.
Add New order option for Battery
LSn50 v2.1 hardware change log
2021-Mar-17
1.7.4
Change to TTN v3
Add note for 3 x DS18B20 mode
2021-Sep-1
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 3 / 69
1. Introduction 5
1.1 What is LSN50 LoRa Sensor Node 5
1.2 Specifications 6
1.3 Features 7
1.4 Applications 7
1.5 Pin Definitions and Switch 8
1.5.1 Jumper JP2 9
1.5.2 BOOT MODE / SW1 9
1.5.3 Reset Button 10
1.5.4 LED 10
1.6 Hardware Change log 10
1.7 Hole Option 11
2. Use LSN50 with LoRaWAN firmware 12
2.1 How it works 12
2.2 Quick guide to connect to LoRaWAN server (OTAA) 14
2.3 Working Mode & Uplink Payload 20
2.3.1 MOD=1 (Default Mode) 20
2.3.2 MOD=2 (Distance Mode) 20
2.3.3 MOD=3 (3 ADC + I2C) 25
2.3.4 MOD=4 (3 x DS18B20) 25
2.3.5 MOD=5(Weight Measurement by HX711) 26
2.3.6 MOD=6(Counting Mode, Since firmware v1.6.5) 29
2.3.7 Decode payload in The Things Network 30
2.4 Payload Explanation and Sensor Interface 31
2.4.1 Battery Info 31
2.4.2 Temperature (DS18B20) 31
2.4.3 Digital Input 31
2.4.4 Analogue Digital Converter (ADC) 32
2.4.5 Digital Interrupt 34
2.4.6 I2C Interface (SHT20) 37
2.4.7 Distance Reading 38
2.4.8 Ultrasonic Sensor 38
2.4.9 +5V Output 40
2.4.10 Weigh Sensor HX711 40
2.4.11 BH1750 Illumination Sensor 40
2.4.12 Working MOD 41
2.5 Configure LSN50 via AT or Downlink 43
2.5.1 Common Commands: 43
2.5.2 Sensor related commands: 43
2.6 Show Data in Datacake IoT Server 45
2.7 Firmware Change Log 48
2.8 Use VDD or +5V to Power External Sensor 48
2.9 Battery Analysis 49
2.9.1 Battery Type 49
2.9.2 Power consumption Analyze 49
2.9.3 Battery Note 51
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 4 / 69
2.9.4 Replace the battery 51
3. Using the AT Commands 51
3.1 Access AT Commands 51
3.2 Common AT Command Sequence 53
3.2.1 Multi-channel ABP mode (Use with SX1301/LG308) 53
3.2.2 Single-channel ABP mode (Use with LG01/LG02) 53
4. Upload Firmware 54
4.1 Upload Firmware via Serial Port 54
4.2 Upload Firmware via ST-Link V2 57
5. Developer Guide 59
6. FAQ 61
6.1 Why there is 433/868/915 version? 61
6.2 What is the frequency range of LT LoRa part? 61
6.3 How to change the LoRa Frequency Bands/Region? 61
6.4 Can I use Private LoRa protocol? 61
6.5 How to set up LSN50 to work in 8 channel mode 62
6.6 How to set up LSN50 to work with Single Channel Gateway such as
LG01/LG02? 64
6.7 How to configure the EUI keys in LSN50? 65
7. Trouble Shooting 66
7.1 Connection problem when uploading firmware. 66
7.2 Why I can’t join TTN V3 in US915 / AU915 bands? 66
7.3 AT Command input doesn’t work 67
8. Order Info 68
9. Packing Info 68
10. Support 69
11. References 69
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 5 / 69
1. Introduction
1.1 What is LSN50 LoRa Sensor Node
LSN50 is a Long Range LoRaWAN Sensor Node. It is designed for outdoor data logging and
powered by Li/SOCl2 battery for long term use and secure data transmission. It is designed
to facilitate developers to quickly deploy industrial level LoRa and IoT solutions. It helps
users to turn the idea into a practical application and make the Internet of Things a reality. It
is easy to program, create and connect your things everywhere.
It is based on SX1276/SX1278 allows the user to send data and reach extremely long ranges
at low data-rates. It provides ultra-long range spread spectrum communication and high
interference immunity whilst minimizing current consumption. It targets professional
wireless sensor network applications such as irrigation systems, smart metering, smart cities,
smartphone detection, building automation, and so on.
LSN50 uses STM32l0x chip from ST, STML0x is the ultra-low-power STM32L072xx
microcontrollers incorporate the connectivity power of the universal serial bus (USB 2.0
crystal-less) with the high-performance ARM® Cortex®-M0+ 32-bit RISC core operating at a
32 MHz frequency, a memory protection unit (MPU), high-speed embedded memories (192
Kbytes of Flash program memory, 6 Kbytes of data EEPROM and 20 Kbytes of RAM) plus an
extensive range of enhanced I/Os and peripherals.
LSN50 is an open source product, it is based on the STM32Cube HAL drivers and lots of
libraries can be found in ST site for rapid development.
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 6 / 69
1.2 Specifications
Micro Controller:
STM32L072CZT6 MCU
MCU: STM32L072CZT6
Flash: 192KB
RAM: 20KB
EEPROM: 6KB
Clock Speed: 32Mhz
Common DC Characteristics:
Supply Voltage: 2.1v ~ 3.6v
Operating Temperature: -40 ~ 8C
I/O pins: Refer to STM32L072 datasheet
LoRa Spec:
Frequency Range,
Band 1 (HF): 862 ~ 1020 Mhz
or
Band 2 (LF): 410 ~ 528 Mhz
168 dB maximum link budget.
+20 dBm - 100 mW constant RF output vs.
+14 dBm high efficiency PA.
Programmable bit rate up to 300 kbps.
High sensitivity: down to -148 dBm.
Bullet-proof front end: IIP3 = -12.5 dBm.
Excellent blocking immunity.
Low RX current of 10.3 mA, 200 nA register retention.
Fully integrated synthesizer with a resolution of 61 Hz.
FSK, GFSK, MSK, GMSK, LoRaTM and OOK modulation.
Built-in bit synchronizer for clock recovery.
Preamble detection.
127 dB Dynamic Range RSSI.
Automatic RF Sense and CAD with ultra-fast AFC.
Packet engine up to 256 bytes with CRC.
LoRaWAN 1.0.2 Specification
Battery:
Li/SOCI2 un-chargeable battery
Capacity: 4000mAh
Self Discharge: <1% / Year @ 25°C
Max continuously current: 130mA
Max boost current: 2A, 1 second
Power Consumption
STOP Mode: 2.7uA @ 3.3v
LoRa Transmit Mode: 125mA @ 20dBm 44mA @ 14dBm
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 7 / 69
1.3 Features
LoRaWAN 1.0.3 Class A, Class C
STM32L072CZT6 MCU
SX1276/78 Wireless Chip
Pre-load bootloader on USART1/USART2
MDK-ARM Version 5.24a IDE
I2C, LPUSART1, USB, SPI2
3x12bit ADC, 1x12bit DAC
20xDigital I/Os
LoRa™ Modem
Preamble detection
Baud rate configurable
CN470/EU433/KR920/US915/IN865
EU868/AS923/AU915
Open-source hardware / software
Available Band:433/868/915/920 Mhz
IP66 Waterproof Enclosure
Ultra-Low Power consumption
AT Commands to change parameters
4000mAh or 8500mAh Battery for long term use
1.4 Applications
Smart Buildings & Home Automation
Logistics and Supply Chain Management
Smart Metering
Smart Agriculture
Smart Cities
Smart Factory
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 8 / 69
1.5 Pin Definitions and Switch
No.
Signal
Direction
Function
1
VDD (3v)
OUTPUT
VCC
2
PA0
In/Out
Directly from STM32 chip
3
PA1
In/Out
Directly from STM32 chip
4
PA2
In/Out
Directly from STM32 chip,
10k pull up to VCC
5
PA3
In/Out
Directly from STM32 chip,
10k pull up to VCC
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 9 / 69
6
PB6
In/Out
Directly from STM32 chip,
10k pull up to VCC
7
PB7
In/Out
Directly from STM32 chip,
10k pull up to VCC
8
PB3
In/Out
Directly from STM32 chip,
10k pull up to VCC
9
PB4
In/Out
Directly from STM32 chip
10
PA9
In/Out
Directly from STM32 chip,
10k pull up to VCC
11
PA10
In/Out
Directly from STM32 chip,
10k pull up to VCC
12
GND
Ground
13
VCC(2.9V)
OUTPUT
VCC
14
Jumper
Power on/off jumper
15
PA4
In/Out
Directly from STM32 chip
16
NRST
In
Reset MCU
17
PA12
In/Out
Directly from STM32 chip
18
PA11
In/Out
Directly from STM32 chip
19
PA14
In/Out
Directly from STM32 chip
20
PB13
In/Out
Directly from STM32 chip
21
PB12
In/Out
Directly from STM32 chip
22
PB15
In/Out
Directly from STM32 chip
23
PB14
In/Out
Directly from STM32 chip
24
PA13
In/Out
Directly from STM32 chip
25
PA8
In/Out
Directly from STM32 chip
26
GND
Ground
27
+5V
Out
5v output power
28
LED1
Controlled by PA8
29
BOOT
MODE/ SW1
Configure device in working
mode or ISP program mode
30
NRST
In
Reset MCU
1.5.1 Jumper JP2
Power on Device when put this jumper.
1.5.2 BOOT MODE / SW1
1) ISP: upgrade mode, device won't have any signal in this mode. but ready for upgrade firmware.
LED won't work. Firmware won’t run.
2) Flash: work mode, device starts to work and send out console output for further debug
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 10 / 69
1.5.3 Reset Button
Press to reboot the device.
1.5.4 LED
It will flash:
1) When boot the device in flash mode
2) Send an uplink packet
1.6 Hardware Change log
Note: Hardware version is marked in the PCB.
LSN50 v2.1:
1. Change R14 to 1M ohm
2. Change R3, R4 to 4.7Kohm. So no need to modify them for 3 DS18B20
connection.
3. Add ESD to each I/O
LSN50 v2.0:
Change to a new enclosure. Improve with external antenna, IP68, ear hook.
LSN50 v1.3:
Add P-MOS to control 5V output
LSN50 v1.2:
Add LED. Turn on for every LoRa transmit
Add pin PA4, PB13, NRST
Add 5V Output, on/off control by PB5(Low to Enable, High to Disable)
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 11 / 69
1.7 Hole Option
The LSN50 provides different hole size options for different size sensor cable. The options
provided are M12, M16 and M20. The definition is as below:
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 12 / 69
2. Use LSN50 with LoRaWAN firmware
2.1 How it works
The LSN50 is pre-loaded with a firmware and is configured as LoRaWAN OTAA Class A mode
by default. It has OTAA keys to join LoRaWAN network. To connect a local LoRaWAN
network, you just need to input the OTAA keys in the LoRaWAN IoT server and power on the
LSN50. It will automatically join the network via OTAA.
The diagram below shows the working flow in default firmware (ver 1.7.0):
In case you can’t set the OTAA keys in the LoRaWAN OTAA server, and you have to use the
keys from the server, you can use AT Commands to set the keys in the LSN50.
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 13 / 69
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 14 / 69
2.2 Quick guide to connect to LoRaWAN server (OTAA)
Following is an example for how to join the TTN V3 LoRaWAN Network. Below is the
network structure; we use the LG308 as a LoRaWAN gateway in this example.
The LG308 is already set to connected to TTN V3 network , so what we need to now is
configure the TTN V3 server.
Step 1: Create a device in TTN V3 with the OTAA keys from LSN50.
Each LSN50 is shipped with a sticker with the default device EUI as below:
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 15 / 69
You can enter this key in the LoRaWAN Server portal. Below is TTN V3 screen shot:
Add APP EUI in the application
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 16 / 69
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 17 / 69
You can also choose to create the device manually.
Add APP KEY and DEV EUI
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 18 / 69
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 19 / 69
Step 2: Power on LSN50
Put a Jumper on JP2 to power on the device.
For LSn50v2:
Step 3: The LSN50 will auto join to the TTN V3 network. After join success, it will start to
upload messages to TTN V3 and you can see the messages in the panel.
www.dragino.com
LSN50 LoRaWAN Sensor Node User Manual 20 / 69
2.3 Working Mode & Uplink Payload
LSN50 has different working mode for the connections of different type of sensors. This
section describes these modes. Use can use the AT Command AT+MOD to set LSN50 to
different working modes.
For example:
AT+MOD=2 // will set the LSN50 to work in MOD=2 distance mode which target to measure
distance via Ultrasonic Sensor.
NOTE:
1. Some working modes has payload more than 12 bytes, The US915/AU915/AS923
frequency bands definition has maximum 11 bytes in DR0. Server sides will see NULL
payload while LSn50 transmit in DR0 with 12 bytes payload.
2. All modes share the same Payload Explanation from HERE.
3. By default, the device will send an uplink message every 5 minutes.
2.3.1 MOD=1 (Default Mode)
In this mode, uplink payload includes in total 11 bytes. Uplink packets use FPORT=2.
2.3.2 MOD=2 (Distance Mode)
This mode is target to measure the distance. The payload of this mode is totally 11
bytes. The 8th and 9th bytes is for the distance.
Size(bytes
)
2
2
2
1
2
2
Value
BAT
Temperature
(DS18B20)
ADC
Digital in &
Digital
Interrupt
Temperature
(SHT20 or SHT31 or
Ultrasonic Sensor)
Humidity
(SHT20)
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69

Dragino LSN50 LoRa Sensor Node User manual

Category
Gateways/controllers
Type
User manual

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI