image-20220519085532-1.png

SW3L LoRaWAN Outdoor Flow Sensor Manual

Table of Contents:

1. Introduction

1.1 What is CPL01 LoRaWAN Pulse/Contact Sensor

The Dragino SW3L is a LoRaWAN Flow Sensor. It detects water flow volume and uplink to IoT server via LoRaWAN network. User can use this to monitor the water usage for buildings.

SW3L is powered by 8500mAh Li-SOCI2 battery, It is designed for long term use up to 10 years. (Actually Battery life depends on the use environment, update period.)

The SW3L will send water flow volume every 20 minutes. It can also detect the water flow status and send Alarm, to avoid the waste for water usage such as broken toilet case.

SW3L is designed for both indoor and outdoor use. It has a weatherproof enclosure and industrial level battery to work in low to high temperatures.

Each SW3L is pre-load with a set of unique keys for LoRaWAN registration, register these keys to LoRaWAN server and it will auto connect after power on

*Battery life depends on how often to send data, please see battery analyzer.

1.2 Features

  • LoRaWAN v1.0.3 Class A protocol.
  • Frequency Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915/IN865/RU864
  • Upload water flow volume
  • Monitor water waste
  • 8500mAh industrial battery(none-rechargeable)
  • AT Commands to change parameters
  • Uplink on periodically and open/close event
  • Datalog feature
  • Remote configure parameters via LoRa Downlink
  • Firmware upgradable via program port
  • Wall Mountable
  • Outdoor Use

1.3 Installation

Each SW3L package is shipped with a flow sensor. Install the flow sensor into water pipe with correct flow direction to start monitoring.

1.4 Storage & Operation Temperature

-40°C to +85°C

1.5 Applications 

  • Flow Sensor application
  • Water Control
  • Toilet Flow Sensor
  • Monitor Waste water

1.6 Flow Sensor Spec

SW3L-004: DW-004 Flow Sensor: diameter: G1/2” / DN15.  450 pulse = 1 L

SW3L-006: DW-006 Flow Sensor: diameter: G3/4” / DN20.  360 pulse = 1 L

SW3L-010: DW-010 Flow Sensor: diameter: G 1” / DN25.   60 pulse = 1 L

1.7 Mechanical

1652922789057-479.png

1652922797548-885.png

DW-004 Flow Sensor: diameter: G1/2” / DN15.  450 pulse = 1 L

image-20220519091350-1.png

006: DW-006 Flow Sensor: diameter: G3/4” / DN20.  360 pulse = 1 L

image-20220519091423-2.png

  •  
    • 010: DW-010 Flow Sensor: diameter: G 1” / DN25.   60 pulse = 1 L

image-20220519091423-3.png

1.8 Pin Definitions and Switch

1652923899427-927.png

1.8.1 Pin Definition

SW3L is pre-configured to connect to two external wires. The other pins are not used. If user wants to know more about other pins, please refer to the user manual of LSN50v2 at: http://www.dragino.com/downloads/index.php?dir=LSN50-LoRaST/ 

1.8.2 Jumper JP2(Power ON/OFF)

Power on Device when putting this jumper. 

1.8.3 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, the device starts to work and send out console output for further debug

1.8.4 Reset Button

Press to reboot the device. 

1.8.5 LED

It will flash:
1)    Boot the device in flash mode
2)    Send an uplink packe

2. Operation Mode

2.1 How it works?

Each SW3L is shipped with a worldwide unique set of OTAA keys. To use SW3L in a LoRaWAN network, user needs to input the OTAA keys in the LoRaWAN network server. So SW3L can join the LoRaWAN network and start to transmit sensor data.

2.2 Example to use for LoRaWAN network

This section shows an example of how to join the TTN V3 LoRaWAN IoT server. Usages with other LoRaWAN IoT servers are similar.

1652924183429-136.png

  • In this use case, the SW3L is connected into water line to measure water flow and send the status to the LoRaWAN server. The SW3L will uplink different types of messages to the LoRaWAN server. See Uplink payload for detail.

Assume the DLOS8 is already set to connect to the TTN V3 network . We need to add the SW3L device in TTN V3:

Step 1: Create a device in TTN V3 with the OTAA keys from SW3L.

Each SW3L is shipped with a sticker with the default device EUI as below:

1652858451221-297.png

Users can enter these keys in the LoRaWAN Server portal. Below is the TTN V3 screenshot:

Add APP EUI in the application.

1652858478050-325.png

1652858498638-881.png

1652858507748-628.png

1652858520534-791.png

Add APP KEY and DEV EUI

Step 2: Power on SW3L

image-20220519094347-1.png

Put the jumper to power on SW3L and it will auto-join to the TTN V3 network. After join success, it will start to upload sensor data to TTN V3 and the user can see it in the panel.

1652924675638-547.png

2.3 Uplink Payload

Uplink payloads have two types:

  • Open/Close Status: Use FPORT=2
  • Other control commands: Use other FPORT fields.

The application server should parse the correct value based on FPORT settings.

2.3.1 Device Status, FPORT=5

Include device configure status. Once SW3L Joined the network, it will uplink this message to the server. After that, SW3L will uplink Device Status every 12 hours.

Users can also use the downlink command(0x26 01) to ask SW3L to resend this uplink. This uplink payload also includes the DeviceTimeReq to get time.

Device Status (FPORT=5)
Size (bytes)12112
ValueSensor ModelFirmware VersionFrequency BandSub-bandBAT

Example parse in TTNv3

1652925144491-755.png

  • Sensor Model: For SW3L, this value is 0x11
  • Firmware Version: 0x0100, Means: v1.0.0 version
  • Frequency Band:

*0x01: EU868

*0x02: US915

*0x03: IN865

*0x04: AU915

*0x05: KZ865

*0x06: RU864

*0x07: AS923

*0x08: AS923-1

*0x09: AS923-2

*0x0a: AS923-3

*0x0b: CN470

*0x0c: EU433

*0x0d: KR920

*0x0e: MA869

  • Sub-Band:

    • AU915 and US915:value 0x00 ~ 0x08
    • CN470: value 0x0B ~ 0x0C
    • Other Bands: Always 0x00
  • Battery Info:

Check the battery voltage.

Ex1: 0x0B45 = 2885mV

Ex2: 0x0B49 = 2889mV

2.3.2 Sensor Configuration, FPORT=4

SW3L will only send this command after getting the downlink command (0x26 02) from the server.

Sensor Configuration FPORT=4
Size (bytes)31121
ValueTDC (unit: sec)N/AStop TimerAlarm TimerReserve
  • TDC: (default: 0x0004B0)

Uplink interval for the total pulse count, default value is 0x0004B0 which is 1200 seconds = 20 minutes.

  • STOP Duration & Alarm Timer

Shows the configure value of Alarm for continuously water flow

image-20220519095747-2.png

2.3.3 Water Flow Value, Uplink FPORT=2

SW3L will send this uplink after Device Status once join the LoRaWAN network successfully. And SW3L will:

periodically send this uplink every 20 minutes, this interval can be changed.

Uplink Payload totals 11 bytes.

Water Flow Value,  FPORT=2
Size (bytes)14114
ValueCalculate Flag  & Alarm

Total pulse Or Last Pulse

MODReserve(0x01)Unix TimeStamp
Status & Alarm field
Size (bit)611
ValueCalculate FlagAlarm: 0: No Alarm; 1: AlarmN/A

image-20220519095946-3.png

  • Calculate Flag

The calculate flag is a user define field, IoT server can use this filed to handle different meter with different pulse factor. For example, if there are 100 Flow Sensors, meter 1 ~50 are 1 liter/pulse and meter 51 ~ 100 has 1.5 liter/pulse.

Example: in the default payload:

  • calculate flag=0: for SW3L-004 Flow Sensor: 450 pulse = 1 L

  • calculate flag=1: for SW3L-006 Flow Sensor: 360 pulse = 1 L

  • calculate flag=2: for SW3L-010 Flow Sensor: 60 pulse = 1 L

Default value: 0.  

Range (6 bits): (b)000000 ~ (b) 111111

NOTE: User need to set Calculate Flag to proper value before use Flow Sensor. Downlink or AT Command see: Refer: Set Calculate Flag

  • Alarm

image-20220519095946-4.png

  • Total pulse

Total pulse/counting since factory

Range (4 Bytes) : 0x00000000~ 0xFFFFFFFF .

  • Last Pulse

Total pulse since last FPORT=2 uplink. (Default 20 minutes)

Range (4 Bytes) : 0x00000000~ 0xFFFFFFFF .

  • MOD: Default =0

MOD=0 --> Uplink Total Pulse since factory

MOD=1 --> Uplink total pulse since last FPORT=2 uplink.

  • Water Flow Value

Total Water Flow Volume = (Calculate Flag) x (Total Pulse)=9597/450=21.3L

image-20220519095946-5.png

Total Water Flow for TDC timer = (Calculate Flag) x (Last Pulse)=79/450=0.2L

image-20220519095946-6.png        

2.3.4 Historical Water Flow Status, FPORT=3

SW3L stores sensor values and users can retrieve these history values via the downlink command.

The historical payload includes one or multiplies entries and every entry has the same payload as Real-Time water flow status.

  • Each data entry is 11 bytes and has the same structure as real time water flow status, to save airtime and battery, SW3L will send max bytes according to the current DR and Frequency bands.

For example, in the US915 band, the max payload for different DR is:

a) DR0: max is 11 bytes so one entry of data

b) DR1: max is 53 bytes so devices will upload 4 entries of data (total 44 bytes)

c) DR2: total payload includes 11 entries of data

d) DR3: total payload includes 22 entries of data.

If SW3L doesn’t have any data in the polling time. It will uplink 11 bytes of 0

Downlink:

0x31 62 46 B1 F0 62 46 B3 94 07

1652926690850-712.png

Uplink:

00 00 01 00 00 00 00 62 46 B2 26 00 00 01 00 00 00 00 62 46 B2 5D 00 00 01 00 00 00 00 62 46 B2 99 00 00 01 00 00 00 00 62 46 B2 D5 00 00 01 00 00 01 15 62 46 B3 11 00 00 01 00 00 01 1F 62 46 B3 7E

Parsed Value:

[Alarm, Calculate Flag, MOD, Total pulse or Last Pulse, Water Flow Value, TIME]

 

[FALSE,0,0,0,0.0,2022-04-01 08:04:54],

[FALSE,0,0,0,0.0,2022-04-01 08:05:49],

[FALSE,0,0,0,0.0,2022-04-01 08:06:49],

[FALSE,0,0,0,0.0,2022-04-01 08:07:49],

[FALSE,0,0,277,0.6,2022-04-01 08:08:49],

[FALSE,0,0,287,0.6,2022-04-01 08:10:38],

1652926777796-267.png

2.4 Datalog Feature

When a user wants to retrieve sensor value, he can send a poll command from the IoT platform to ask the sensor to send value in the required time slot.

2.4.1 Unix TimeStamp

SW3L uses Unix TimeStamp format based on

1652926852443-847.png

Users can get this time from the link:  https://www.epochconverter.com/ :

Below is the converter example

1652926913271-611.png

2.4.2 Set Device Time

Through LoRaWAN MAC Command

Once SW3L Joined the LoRaWAN network, it will send the MAC command (DeviceTimeReq) and the server will reply with (DeviceTimeAns) to send the current time to SW3L. If SW3L fails to get the time from the server, SW3L will use the internal time and wait for the next time request [via Device Status (FPORT=5)].

Note: LoRaWAN Server needs to support LoRaWAN v1.0.3(MAC v1.0.3) or higher to support this MAC command feature.

2.4.3 Poll sensor value

Users can poll sensor values based on timestamps. Below is the downlink command.

Downlink Command to poll Open/Close status (0x31)
1byte4bytes4bytes1byte
31Timestamp startTimestamp endUplink Interval

Timestamp start and Timestamp end-use Unix TimeStamp format as mentioned above. Devices will reply with all data logs during this period, using the uplink interval.

For example, downlink commandimage-20220518162852-1.png 

Is to check 2021/11/12 12:00:00 to 2021/11/12 15:00:00’s data

Uplink Internal =5s,means CPL01 will send one packet every 5s. range 5~255s.

2.4.4 Decoder in TTN V3

1652862574387-195.png

Please check the decoder from this link:

https://docs.google.com/document/d/1LFTp2IupfM3O4rQ1gJgZHJNP49BZFnm2xThiErnJYPQ/edit?usp=sharing

2.5 Show data on Datacake

Datacake IoT platform provides a human-friendly interface to show the sensor data, once we have sensor data in TTN V3, we can use Datacake to connect to TTN V3 and see the data in Datacake. Below are the steps:

Step 1: Link TTNv3 to Datacake https://docs.datacake.de/lorawan/lns/thethingsindustries#create-integration-on-tti

Step 2: Configure CPL01 in Datacake

  1652862663124-805.png

1652862686700-576.png

1652862716106-261.png

1652862734313-990.png

1652862744310-982.png

1652862755419-628.png

1652862763975-153.png

1652862773781-198.png

1652862794151-835.png

1652862807472-427.png

Tags:
    
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0