background image

 

 

www.dragino.com

 

LSN50 LoRa Sensor Node User Manual

 

  

1

 / 

60

 

 
 
 

 

 
 

LSN50 LoRa Sensor Node User Manual 
 

Document Version: 1.6.1  
Image Version: v1.6  
 
 

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 Mydevices 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 

 

 

Summary of Contents for LSN50 LoRa

Page 1: ...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...

Page 2: ...2 4 2 Temperature DS18B20 21 2 4 3 Digital Input 21 2 4 4 Analogue Digital Converter ADC 22 2 4 5 Digital Interrupt 23 2 4 6 I2C Interface SHT20 25 2 4 7 Distance Reading 26 2 4 8 Ultrasonic Sensor 26...

Page 3: ...ge the LoRa Frequency Bands Region 52 6 4 Can I use Private LoRa protocol 52 6 5 How to set up LSN50 to work in 8 channel mode 53 6 6 How to set up LSN50 to work with Single Channel Gateway such as LG...

Page 4: ...spread spectrum communication and high interference immunity whilst minimizing current consumption It targets professional wireless sensor network applications such as irrigation systems smart meteri...

Page 5: ...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 resol...

Page 6: ...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 En...

Page 7: ...In Out Directly from STM32 chip 10k pull up to VCC Used as UART_RXD in LSN50 image 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 P...

Page 8: ...5 PA8 In Out Directly from STM32 chip Default use to turn on off LED1 in LSN50 image 26 GND Ground 27 5V Out 5v output power Controlled by PB5 Low to Enable High to Disable 28 LED1 Controlled by PA8 B...

Page 9: ...no com LSN50 LoRa Sensor Node User Manual 9 60 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...

Page 10: ...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 dia...

Page 11: ...the TTN 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 network so what we need to now is configure th...

Page 12: ...www dragino com LSN50 LoRa Sensor Node User Manual 12 60 You can enter this key in the LoRaWAN Server portal Below is TTN screen shot Add APP EUI in the application Add APP KEY and DEV EUI...

Page 13: ...e User Manual 13 60 Step 2 Power on LSN50 Put a Jumper on JP2 to power on the device Step 3 The LSN50 will auto join to the TTN network After join success it will start to upload messages to TTN and y...

Page 14: ...or 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...

Page 15: ...to measure the distance The payload of this mode is totally 11 bytes The 8th and 9th bytes is for the distance Connection of LIDAR Lite V3HP Size bytes 2 2 1 2 2 2 Value BAT Temperature DS18B20 Digita...

Page 16: ...r the sleep current will jump to 250uA It is recommend to use external power source for ultrasonic sensor 2 3 3 MOD 3 3 ADC I2C This mode has total 12 bytes Include 3 x ADC 1x I2C Size bytes 2 2 2 1 2...

Page 17: ...ion since v1 6 1 Hardware connection is as below Note R3 R4 should change from 10k to 4 7k to support DS18B20 Software set to AT MOD 4 This mode has total 11 bytes As shown below Size bytes 2 2 2 1 2...

Page 18: ...sing TTN network you can add the payload format to decode the payload The payload decoding function is as follows function Decoder bytes port Decode an uplink message from a buffer array of bytes to a...

Page 19: ...alue 0xFFFF0000 var temp_SHT value 10 toFixed 2 SHT20 temperature units value bytes 9 8 bytes 10 var hum_SHT value 10 toFixed 1 SHT20 Humidity units var batV bytes 11 10 Battery units V else if mod1 I...

Page 20: ...7 0x80 value 0xFFFF0000 var tempc2 value 10 toFixed 2 DS18B20 PB3 units value bytes 9 8 bytes 10 if bytes 9 0x80 value 0xFFFF0000 var tempc3 value 10 toFixed 2 DS18B20 PB3 units return BatV batV Temp...

Page 21: ...there is a DS18B20 connected to PB3 pin The temperature will be uploaded in the payload More DS18B20 can check the 3 DS18B20 mode Connection Example If payload is 0105H 0105 FC00 0 temp 0105H 10 26 1...

Page 22: ...eps 1 Solder a 10K resistor between PA0 and VCC 2 Screw oil sensor s two pins to PA0 and PB4 The equipment circuit is as below 1 0 7 0c m Bouy on top the oil sensor act as a 10K resistor Bouy on botto...

Page 23: ...detecting the open close status of doors or windows When the two pieces are close to each other the 2 wire output will be short or open depending on the type while if the two pieces are away from eac...

Page 24: ...oor The software by default uses the falling edge on the signal line as an interrupt We need to modify it to accept both the rising edge 0v VCC door close and the falling edge VCC 0v door open as the...

Page 25: ...HT20 Temperature and Humidity Sensor This is supported in the stock firmware since v1 5 with AT MOD 1 default value Below is the connection to SHT20 The device will be able to get the I2C sensor data...

Page 26: ..._proof_Ultrasonic_Sensor_with_Separate_Probe_SKU___SEN0208 The LSN50 detects the pulse width of the sensor and converts it to mm output The accuracy will be within 1 centimeter The usable range the d...

Page 27: ...a Sensor Node User Manual 27 60 You can see the serial output in ULT mode as below In TTN server 2 4 9 5V Output Since v1 2 hardware version a 5v output is added in the hardware The 5V output will be...

Page 28: ...ransmit Time Interval Any 01 4 RESET Any 04 2 AT CFM Any 05 4 INTMOD Any 06 4 Examples Set TDC If the payload 0100003C it means set the END Node s TDC to 0x00003C 60 S while type code is 01 Payload 01...

Page 29: ...ce we have data in TTN we can use Mydevices to connect to TTN and see the data in Mydevices Below are the steps Step 1 Be sure that your device is programmed and properly connected to the network at t...

Page 30: ...3 Create an account or log in Mydevices Step 4 Search the LSN50 and add DevEUI Use the LSN50 v1 6 for the firmware version v1 6 After added the sensor data arrive TTN it will also arrive and show in M...

Page 31: ...www dragino com LSN50 LoRa Sensor Node User Manual 31 60 MOD 3...

Page 32: ...d new AT command which can adjust RX window time for LG01 LG02 Add AT command to print all parameters Any FPORT can accept downlink message and print v1 3 Firmware Add new AT Commands AT CHS AT CHE Ch...

Page 33: ...com LSN50 LoRa Sensor Node User Manual 33 60 Proximity switch I2C Device Example V1 0 Firmware Support ADC monitoring See how to in the case study of Oil Sensor and DS18B20 See how to in the case stud...

Page 34: ...minimum system with DS18B20 and Oil Sensor and default firmware the power consumption includes 1 Deep Sleep Stop mode for STM32 5uA 2 Sampling current while reading DS18B20 and Oil Sensor Oil Sensor s...

Page 35: ...lysis Below is the analysis result Note Ignore the 18 year result because the battery has a max 2 discharge per year 2 8 3 Battery Note The Li SICO battery is designed for small current long period ap...

Page 36: ...ry and main board 3 Using the AT Commands 3 1 Access AT Commands LSN50 supports AT Command set in the stock firmware You can use a USB to TTL adapter to connect to LSN50 for using AT command as below...

Page 37: ...y Joining and sending date on LoRa network AT CFM Confirm Mode AT CFS Confirm Status AT JOIN Join LoRa Network AT NJM LoRa Network Join Mode AT NJS LoRa Network Join Status AT RECV Print Last Received...

Page 38: ...Channel Mode AT CHE Get or Set eight channels mode Only for US915 AU915 CN470 3 2 Common AT Command Sequence 3 2 1 Multi channel ABP mode Use with SX1301 LG308 If device has not joined network via OTA...

Page 39: ...fault after an update image If the update is from image v1 3 to another image version v1 3 then the keys will be kept after running AT FDR Otherwise e g from v1 2 to v1 3 AT FDR may erase the keys 4 1...

Page 40: ...www dragino com LSN50 LoRa Sensor Node User Manual 40 60 Board detected...

Page 41: ...www dragino com LSN50 LoRa Sensor Node User Manual 41 60 Step4 Switch SW1 back to flash state and push the RESET button The LSN50 will then run the new firmware...

Page 42: ...50 PA14 ST LINK v2 SWDIO LSN50 PA13 ST LINK v2 RST LSN50 NRST Step1 Install ST LINK driver first and then install ST LINK Utility Step2 Download the LSN50 Image files Step3 Open ST LINK utility file o...

Page 43: ...dragino com LSN50 LoRa Sensor Node User Manual 43 60 NOTE If this step fails ST LINK can t establish connection to LSN50 please try to swap SWDIO SWCLK pin Some ST LINK v2 devices are incorrectly mar...

Page 44: ...com dragino Lora tree master LSN50 5 2 Compile Source Code 5 2 1 Set up Keil Compile Environment Assuming you already have Keil uVision5 installed the steps below show how to install the MDK support a...

Page 45: ...ual 45 60 5 Open the dialog File License Management and select the Single User License tab 6 Click the button Get LIC via Internet then click the button OK to register the product This action opens th...

Page 46: ...Sensor Node User Manual 46 60 7 Enter the Product Serial Number 4PPFW QBEHZ M0D5M along with your contact information and click the button Submit An e mail is sent back with the License ID Code LIC w...

Page 47: ...ww dragino com LSN50 LoRa Sensor Node User Manual 47 60 8 To activate the Software Product enter the LIC in the field New License ID Code LIC of the dialog License Management and click Add LIC 9 Finis...

Page 48: ...or Node User Manual 48 60 5 2 2 Install STM32L0 Series Device 1 Open the webpage http www keil com dd2 pack eula container 2 Find the STMicroelectronics STM32L0 Series Device and download it 3 Find th...

Page 49: ...www dragino com LSN50 LoRa Sensor Node User Manual 49 60 4 Add the Device then you can rebuild the project...

Page 50: ...his error 5 2 3 Compile Source Code 1 Download the source code from Software Source Code Download Link 2 Use Keil to open the project file STM32CubeExpansion_LRWAN Projects Multi Applications LoRa DRA...

Page 51: ...www dragino com LSN50 LoRa Sensor Node User Manual 51 60 4 If you want to change frequency modify the Preprocessor Symbols For example change EU868 to US915 5 Compile and build...

Page 52: ...z 433Mhz CN470 EU433 868 SX1276 Band1 HF 862 1020 Mhz 868Mhz EU868 915 SX1276 Band1 HF 862 1020 Mhz 915Mhz AS923 AU915 KR920 US915 6 3 How to change the LoRa Frequency Bands Region You can follow the...

Page 53: ...50 Use the LoRa RAW code The project file is in MDK ARM STM32L072CZ Nucleo Lora uvprojx Compile it and Upload it to LSN50 the LSN50 will transfer on the frequency 868 3Mhz In the Arduino Console it wi...

Page 54: ...to SF10BW125 904 3 SF7BW125 to SF10BW125 904 5 SF7BW125 to SF10BW125 904 7 SF7BW125 to SF10BW125 904 9 SF7BW125 to SF10BW125 905 1 SF7BW125 to SF10BW125 905 3 SF7BW125 to SF10BW125 904 6 SF8BW500 Bec...

Page 55: ...elow is the steps Step1 Log in TTN Create an ABP device in the application and input the network session key NETSKEY app session key APPSKEY from the device Note You need to make sure the above three...

Page 56: ...d AT TDC 300000 Set transmit interval to 5 minutes AT CHS 868400000 Set transmit frequency to 868 4Mhz AT DADDR 26 01 1A F1 Set Device Address to 26 01 1A F1 ATZ Reset MCU As shown below 6 7 How to co...

Page 57: ...output level while set the ISP Flash Switch in different position c check if reset button works 3 If you use Windows10 system Please change the flash loader to run in Windows7 compatibility mode 4 We...

Page 58: ...put doesn t work In the case if user can see the console output but can t type input to the device Please check if you already include the ENTER while sending out the command Some serial tool doesn t...

Page 59: ...LoRaWAN EU868 band KR920 LoRaWAN KR920 band US915 LoRaWAN US915 band IN865 LoRaWAN IN865 band CN470 LoRaWAN CN470 band YY 12 With M12 waterproof cable hole 16 With M16 waterproof cable hole 20 With M2...

Page 60: ...ble regarding your enquiry product models accurately describe your problem and steps to replicate it etc and send a mail to support dragino com 11 References Product Page http www dragino com products...

Reviews: