Link Search Menu Expand Document

Dragino - LSN50v2-D23

The LSN50v2-D23 is a LoRaWAN Waterproof Outdoor Temperature Sensor with 3 external Probes.


Table of contents

  1. Specifications
  2. Documents/Links
  3. Ordering Info
  4. Device specific Information
    1. Switch on the device
  5. Adding the Device to TTN
  6. Optional Settings
    1. Change sampling interval
      1. Examples
  7. 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


Ordering Info


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):

Switching between active and sleep mode (switch off / on, reset)


Adding the Device to TTN

  • Before a device can communicate via “The Things Network” we have to add it to an application.
  1. Create a new application
  2. Under Overview click (+) Register device
  3. Under Input method select Select the end device in the LoRaWAN Device Repository
  4. Enter the following device information
    • End device brand select Dragino Technology Co., Limited
    • Model select LSN50v2-D20-D22-D23
    • Hardware Ver. select Unknown Ver. or whatever is possible or on the sticker
    • Firmware select 1.7.5 or whatever is possible or on the sticker
      • Profile (Region) select EU_863_870
  5. Under Frequency plan select Europe 863-870 Mhz (SF9 for RX2 - recommended)
  6. Under JoinEUI enter the App EUI from the sticker
  7. Enter as well the DevEUI and the AppKey from the sticker
  8. Set an end-device name
  9. Press Register end device
  10. Switch on the device
  11. 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.

  1. In the TTN Console on the device view, select the device and change to the tab Messaging, select Downlink
  2. Change the FPort to 2
  3. Copy/paste the payload, e.g. 0100012C into the Payload field to set interval to 5 minutes
  4. Press Send
  5. 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;
  }
}