Dragino - LSN50v2-D23
- Manufacturer: Dragino
- Product: LSN50v2-D23
The LSN50v2-D23 is a LoRaWAN Waterproof Outdoor Temperature Sensor with 3 external Probes.
Table of contents
- Specifications
- Documents/Links
- Ordering Info
- Device specific Information
- Adding the Device to TTN
- Optional Settings
- Payload formatter
Specifications
- indoor/outdoor device
- Price ca. CHF 70.- (09.08.2023)
- 3 External Sensors
- Temperature, -55 … +125 [°C], ± 0.5 (max ±2.0 °C)
- Power Supply: 1 built in 8500mAh Li-SOCI2 battery
- Expected life time: depending on usage, 5 … 10 years
- LoRaWAN version: 1.0.3
- LoRaWAN device class: A
- Protection: IP66
- Operating Temperature: -40 … 85°C
- Size: 124 × 63 × 42 mm
- Weight: 295 g
Documents/Links
- Payload description (2023-08-09)
- Datasheet from dragino.com (2023-08-09)
- User Manual (online)
- Datasheet Temperaturesensor DS18B20
Ordering Info
- Part Number: LSN50v2-D23-EU868
- Ordering Link
Device specific Information
Switch on the device
Out of the factory the device is switched off. To power on the LSN50v2-D20, open the case and set the jumper (connect the two pins):
Adding the Device to TTN
- Before a device can communicate via “The Things Network” we have to add it to an application.
- Create a new application
- Under
Overview
click(+) Register device
- Under
Input method
selectSelect the end device in the LoRaWAN Device Repository
- Enter the following device information
End device brand
selectDragino Technology Co., Limited
Model
selectLSN50v2-D20-D22-D23
Hardware Ver.
selectUnknown Ver.
or whatever is possible or on the stickerFirmware
select1.7.5
or whatever is possible or on the stickerProfile (Region)
selectEU_863_870
- Under
Frequency plan
selectEurope 863-870 Mhz (SF9 for RX2 - recommended)
- Under
JoinEUI
enter theApp EUI
from the sticker - Enter as well the
DevEUI
and theAppKey
from the sticker - Set an end-device name
- Press
Register end device
- Switch on the device
- Close the case
- Now the device should join the network and you can see the incoming telegrams in the
Live data
section - The payload formatter should already be preset. If not, you can copy/paste it from below
Optional Settings
Change sampling interval
To change the sampling interval, you have to send the device configuration telegrams (Downlink-Messages) The time interval in minutes at which the sensor queries the current values.
- In the TTN Console on the device view, select the device and change to the tab
Messaging
, selectDownlink
- Change the
FPort to 2
- Copy/paste the payload, e.g.
0100012C
into thePayload
field to set interval to 5 minutes - Press
Send
- In the
Data
tab you should now see the scheduled telegram. The wisely sensor only receives downlink data after a transmission. Therefore start a transmission by pressing the button on the back of the sensor (push once short, green led will illuminate)
Examples
‘0100’ is an identifier, the rest represents the sampling interval in hex
- 5 Minutes Interval: ‘0100012C’ (300s in hex are ‘012C’)
- 15 Minutes Interval: ‘01000384’ (900s in hex are ‘0384’)
- 60 Minutes Interval: ‘01000E10’ (3600s in hex are ‘0E10’)
Payload formatter
function Decoder(bytes, port) {
var mode = (bytes[6] & 0x7C) >> 2;
var decode = {};
if ((mode != 2) && (mode != 31)) {
decode.BatV = (bytes[0] << 8 | bytes[1]) / 1000;
decode.TempC1 = parseFloat(((bytes[2] << 24 >> 16 | bytes[3]) / 10).toFixed(2));
decode.ADC_CH0V = (bytes[4] << 8 | bytes[5]) / 1000;
decode.Digital_IStatus = (bytes[6] & 0x02) ? "H" : "L";
if (mode != 6) {
decode.EXTI_Trigger = (bytes[6] & 0x01) ? "TRUE" : "FALSE";
decode.Door_status = (bytes[6] & 0x80) ? "CLOSE" : "OPEN";
}
}
if (mode == '0') {
decode.Work_mode = "IIC";
if ((bytes[9] << 8 | bytes[10]) === 0) {
decode.Illum = (bytes[7] << 24 >> 16 | bytes[8]);
} else {
decode.TempC_SHT = parseFloat(((bytes[7] << 24 >> 16 | bytes[8]) / 10).toFixed(2));
decode.Hum_SHT = parseFloat(((bytes[9] << 8 | bytes[10]) / 10).toFixed(1));
}
} else if (mode == '1') {
decode.Work_mode = " Distance";
decode.Distance_cm = parseFloat(((bytes[7] << 8 | bytes[8]) / 10).toFixed(1));
if ((bytes[9] << 8 | bytes[10]) != 65535) {
decode.Distance_signal_strength = parseFloat((bytes[9] << 8 | bytes[10]).toFixed(0));
}
} else if (mode == '2') {
decode.Work_mode = " 3ADC";
decode.BatV = bytes[11] / 10;
decode.ADC_CH0V = (bytes[0] << 8 | bytes[1]) / 1000;
decode.ADC_CH1V = (bytes[2] << 8 | bytes[3]) / 1000;
decode.ADC_CH4V = (bytes[4] << 8 | bytes[5]) / 1000;
decode.Digital_IStatus = (bytes[6] & 0x02) ? "H" : "L";
decode.EXTI_Trigger = (bytes[6] & 0x01) ? "TRUE" : "FALSE";
decode.Door_status = (bytes[6] & 0x80) ? "CLOSE" : "OPEN";
if ((bytes[9] << 8 | bytes[10]) === 0) {
decode.Illum = (bytes[7] << 24 >> 16 | bytes[8]);
} else {
decode.TempC_SHT = parseFloat(((bytes[7] << 24 >> 16 | bytes[8]) / 10).toFixed(2));
decode.Hum_SHT = parseFloat(((bytes[9] << 8 | bytes[10]) / 10).toFixed(1));
}
} else if (mode == '3') {
decode.Work_mode = "3DS18B20";
decode.TempC2 = parseFloat(((bytes[7] << 24 >> 16 | bytes[8]) / 10).toFixed(2));
decode.TempC3 = parseFloat(((bytes[9] << 24 >> 16 | bytes[10]) / 10).toFixed(1));
} else if (mode == '4') {
decode.Work_mode = "Weight";
decode.Weight = (bytes[7] << 24 >> 16 | bytes[8]);
} else if (mode == '5') {
decode.Work_mode = "Count";
decode.Count = (bytes[7] << 24 | bytes[8] << 16 | bytes[9] << 8 | bytes[10]);
} else if (mode == '31') {
decode.Work_mode = "ALARM";
decode.BatV = (bytes[0] << 8 | bytes[1]) / 1000;
decode.TempC1 = parseFloat(((bytes[2] << 24 >> 16 | bytes[3]) / 10).toFixed(2));
decode.TempC1MIN = bytes[4] << 24 >> 24;
decode.TempC1MAX = bytes[5] << 24 >> 24;
decode.SHTEMPMIN = bytes[7] << 24 >> 24;
decode.SHTEMPMAX = bytes[8] << 24 >> 24;
decode.SHTHUMMIN = bytes[9];
decode.SHTHUMMAX = bytes[10];
}
if ((bytes.length == 11) || (bytes.length == 12)) {
return decode;
}
}