Sensor Operation
This page tells how the device samples and reports the supported sensors. It also tells how the Data Caching function keeps failed confirmed uplinks. It also tells how to calibrate the external temperature probe and how battery depassivation works.
Supported Sensors and Functionality
The device supports these sensors through the LoRaWAN interface:
| Sensor Type | Sensors |
|---|---|
| Analog | Thermometer (temperature), Hygrometer (humidity), Barometer (pressure) |
| Binary | Motion, Water Leak, Door/Window (Reed Switch) |
The device does not support the magnetometer and the gyroscope through the LoRaWAN interface.
Note: To discuss more functions or customization, contact your sales representative.
Sensor Reporting
The Reporting Period makes sure that all active sensors send a reading at an interval that is not longer than the Reporting Period. Each time the device sends an asynchronous report, the device resets the Reporting Period timer. The sections that follow give the conditions for these asynchronous reports.
Note: For the first 30 minutes after a device reset or a power cycle, the Reporting Period is 30 seconds. This helps you to verify the installation and to debug the device.
Analog Sensor Operation
Analog Sensors
- Thermometer (temperature)
- Hygrometer (humidity)
- Barometer (pressure)
Default Operation
The device samples the analog sensors at the Sample Rate. The device compares the current sample with the previous sample. If the difference between the two readings is more than the configured delta, the device sends a sensor reading. The Reporting Period makes sure that the device sends a sample at the configured period or at a shorter interval.
Sampling Configuration
Sampling Configuration is available in firmware v0.26.0 and later.
The Sampling Configuration sets the parameters of a median average filter. The filter is very useful when you use Delta Thresholds and long Reporting Periods. The filter stops noise. Noise can cause unnecessary reports that decrease battery life.
- The Sample Window must be equal to or larger than the Average Window.
- The Average Window must be in the center of the Sample Window, with an equal number of samples on each side.
- The device rejects configurations that are not valid.
At each Sample Period, the device puts the sample into a FIFO. The Sample Window sets the length of the FIFO. The device then calculates the average of N samples in the center of the Sample Window. The Average Window sets N. The device reports the result with the Delta Threshold and Reporting Period logic.
Confirmed Messages
Confirmed Messages are available in firmware v0.26.0 and later.
Confirmed Messages are a LoRaWAN function. With this function, the Network Server sends an acknowledgement for each message. The device sends the message again until it gets the acknowledgement. This makes sure that the customer application receives the message. If the device loses the network connection, the device can keep the confirmed sensor reports. You can get the reports at a later time. Refer to Data Caching.
Use a bit mask to activate Confirmed Messages for each analog sensor. Refer to the Confirmed Message parameter in Configuration.
To get the longest battery life, use Confirmed Messages with the median filter and long Reporting Periods. With this configuration, the device sends important changes quickly and reliably. The device also uses less energy when conditions are stable.
Example
This example uses these settings:
- Temperature Report Delta: 5 C
- Sensor Sample Period: 1 minute
- Reporting Period: 5 minutes
- Sample Window: 1
- Average Window: 1
| Time | Temperature Sample (C) | Action | Reason |
|---|---|---|---|
| 0 | 25 | Send Sensor Report | Reporting Period |
| 1 | 31 | Send Sensor Report | Temperature Report Delta |
| 2 | 20 | Send Sensor Report | Temperature Report Delta |
| 4 | 21 | - | - |
| 5 | 22 | Send Sensor Report | Reporting Period |
| 6 | 22 | - | - |
| 7 | 23 | - | - |
| 8 | 24 | - | - |
| 9 | 28 | Send Sensor Report | Temperature Report Delta |
| 10 | 28 | Send Sensor Report | Temperature Report Delta |
Binary Sensor Operation
Binary Sensors
- Motion
- Water Leak
- Door/Window (Reed Switch)
Each binary sensor has a specific operation mode for its use case.
Motion Operation
The motion sensor sends a packet only when the state changes.
- When the acceleration is more than the Movement Threshold for 80 milliseconds, the device sends a packet. The motion state bit is set to 1.
- When the acceleration is less than the Movement Threshold for 41 seconds, the device sends a packet. The motion state bit is set to 0.
Note: You can use a downlink message to change the Movement Threshold. Refer to Configuration.
Water Leak Operation
The water leak sensor measures the resistance between the two gold-plated pins on the battery door. The sensor uses this resistance to find if water is present. The sensor has three sensitivity levels and an adjustable State Change Timeout. Use these parameters to balance a fast response against the risk of a false leak reading.
- The Sensitivity Level sets the threshold that the sensor uses to detect water.
- The State Change Period sets how long the water detect signal must be stable before the sensor changes to the Leak Detected state.
When the state changes from Dry to Leak Detected, the device sends a confirmed message. The device then sends a confirmed message every 5 minutes while it is in the Leak Detected state. When the state changes from Leak Detected to Dry, the device sends 3 confirmed messages at 5-minute intervals. The device also sends the current state at the Reporting Interval.
- In the Leak Detected state, the water leak bit is 1 (True).
- In the Dry state, the water leak bit is 0 (False).
Note: You can use a downlink message to change the Sensitivity Level and the State Change Period. Refer to Configuration.
Door/Window (Reed Switch) Operation
The reed switch sensor detects a magnetic field near the notch on the right side of the device. When the door or window is closed, make sure that the notch on the magnet is in line with the notch on the device. Keep the gap between the magnet and the device as small as possible.
- When the magnet is not near the sensor, the device sets the door/window open bit to 1 (True).
- When the magnet is near the device, the device sets the bit to 0 (False).
The LoRaWAN protocol limits the uplink rate of the device. Doors and windows can open and close faster than the device can send. During a series of fast open and close events, the device sends its current state only one time every 5 seconds. This state is the active state. If no door/window event occurs in the 5 seconds after the last unconfirmed uplink, the device changes to the idle state. The device sends a confirmed uplink when it changes between the two states.
The steps that follow show the door/window operation:
- The first door/window event causes a confirmed uplink. The device changes to the active state.
- Each new event that occurs in 5 seconds of the previous event keeps the device in the active state.
- Every 5 seconds, the device sends an unconfirmed packet. The packet contains the value of the door/window sensor when the device makes the packet.
- After 5 seconds with no events after the last unconfirmed uplink, the device sends a confirmed uplink. The device changes to the idle state.
At each Reporting Period, the device sends one unconfirmed message with the state of all active sensors. A message that a state change causes always starts and ends with a confirmed message.
Data Caching
Data Caching V1 is available in firmware v0.60.0 and later. Data Caching V2 is available in firmware v0.136.0 and later.
The Data Caching function keeps failed confirmed uplinks on the device. You can get these uplinks at a later time.
- Set configuration parameter
0x0Dto activate Data Caching. Refer to Configuration. - Data Caching supports only MQPS uplinks at this time.
- Data Caching V1 keeps only confirmed uplinks. Use configuration parameter
0x0Ato set confirmed uplinks.
Caching Operation
When Data Caching is active, the device waits for the acknowledgement of each confirmed uplink. If the device does not get the acknowledgement in 30 seconds after it sends the uplink, the device keeps the uplink. For the first 30 minutes after power-on, this time is 15 seconds. The device keeps each uplink with a timestamp in non-volatile memory.
- Data Caching V1 uses UTC time for the timestamp. Data Caching V2 uses GPS time.
- The device keeps more than 3000 records.
- When the record memory is full, the device deletes the oldest records first to keep new records.
- Operations such as FUOTA delete all records.
Note: The time limit is 30 seconds after the device sends the uplink. For the first 30 minutes after power-on, the time limit is 15 seconds.
Note: Under good RF conditions, Data Caching has no appreciable effect on battery life. If the PER is high, confirmed messages cause the device to send more often to make sure that the LNS acknowledges the messages. In extreme conditions, the device joins the network again more often. This decreases battery life.
Common Questions
| Question | Answer |
|---|---|
| What is the capacity of the cache? | The capacity is a number of records, not a time period. The cache keeps at least 3000 records. This is about 21 days at a 10-minute reporting interval. |
| What happens when the cache is full? | The device overwrites the oldest messages to make room for new messages. |
| What happens to the records after the device joins the network again? | When the device joins the network again, it sends its cached data to the gateway. The device keeps these records. You can get them again with a Get Records request. |
Changes in Data Caching V2
| Change | Description |
|---|---|
| Time format | The timestamps are in GPS time (seconds since 1980-01-06, no leap seconds). V1 uses UTC. |
| Uplink format | The uplink format for cached records is slightly different. More records fit into one uplink. |
| Automatic send | You do not have to request cached records. The device sends them 5 minutes after it joins the network. The device then sends them every 5 minutes while records remain. After a reset, the device continues from the last position. |
| Manual request | You can still request cached records. The opcode in the request selects the V1 format or the V2 format. |
| Always cached | The device always keeps unsent sensor data. In V1, the device did not keep data when it had no LoRaWAN connection. |
| Optional configuration bit | An optional configuration bit makes the device send all sensor uplinks in the V2 Get Records Response format. Each uplink then has a timestamp. The decoder parses live records and cached records in the same way. This format uses more bandwidth. |
Data Caching Commands
Use downlink commands to:
- Get the number of records in a date and time range.
- Get the records in a date and time range.
All Data Caching messages use FPort 219.
Get Status
The Get Status Request finds records in the range of the timestamps (Unix Epoch) that you give. The end value must be larger than the start value.
- To get a count of all records, use
0x00000000for the start and0xFFFFFFFFfor the end. - To find records in a specific time window, use specific values.
Note:
0xFFFFFFFFas an end time is a special value that means "get all records". Also,0x00000000is a special start time.
Get Status Request (Downlink)
| Field | Size (bytes) | Range / Value | Description |
|---|---|---|---|
| Opcode | 1 | 0x00 | Get Status Opcode |
| Start Timestamp | 4 | 0x00000000 to 0xFFFFFFFF | UTC timestamp. Start of the range for the record search. |
| End Timestamp | 4 | 0x00000000 to 0xFFFFFFFF | UTC timestamp. End of the range for the record search. |
Get Status Response (Uplink)
The Get Status Response gives the number of records found.
| Field | Size (bytes) | Range / Value | Description |
|---|---|---|---|
| Opcode | 1 | 0x00 | Get Status Opcode |
| Record Count | 2 | Count: 0 to 32767. Error: -1 | Number of records found, or an error because the request is not valid |
Get Records
The Get Records Request has the same format as the Get Status Request. But the response contains the records found in the range. If necessary, the device sends more than one response uplink to report all of the records in the request window.
There are two opcodes. They use different time formats:
- Opcode
0x01uses UTC time. This time does not include leap seconds, so it is 18 seconds different from GPS time. - Opcode
0x02uses GPS time (seconds since 1980-01-06, no leap-second offset). This opcode is available in firmware v0.136.0 and later.
Get Records Request (Downlink)
| Field | Size (bytes) | Range / Value | Description |
|---|---|---|---|
| Opcode | 1 | 0x01 to 0x02 | Get Records Opcode |
| Start Timestamp | 4 | 0x00000000 to 0xFFFFFFFF | 0x01: UTC start. 0x02: GPS start. |
| End Timestamp | 4 | 0x00000000 to 0xFFFFFFFF | 0x01: UTC end. 0x02: GPS end. |
Get Records Response (Uplink)
| Field | Size (bytes) | Range / Value | Description |
|---|---|---|---|
| Opcode | 1 | 0x01 to 0x02 | The opcode of the request. For an automatic send of cached unsent messages, the opcode is 0x02. |
| First Record | - | - | The field is empty if the device finds no records. |
| Next Record | - | - | The field repeats for each record found. The format depends on the opcode. |
First Record Field
| Field | Size (bytes) | Range / Value | Description |
|---|---|---|---|
| FPort | 1 | 0 to 63 | FPort of the record |
| Timestamp | 4 | 0x00000000 to 0xFFFFFFFF | 0x01: UTC time when the device made the record. 0x02: GPS time when the device made the record. |
| Payload | 1 to 10 | - | Record payload with a variable length |
Next Record Field
For opcode 0x01, the Next Record field is the same as the First Record field. For opcode 0x02, the Next Record field has this format:
| Field | Size (bytes) | Range / Value | Description |
|---|---|---|---|
| FPort | 1 | 0 to 63 | FPort of the record |
| Time Offset | 1 to 2 | 0x00 to 0xFFFF | Offset from the time of the previous record, in units of 10 seconds. The most significant bit (MSB) of the first byte sets the size of the field. |
| Payload | 1 to 10 | - | Record payload with a variable length |
The Time Offset field has two forms:
- If the MSB is 0, the field is 1 byte. Time = previous time + offset × 10 seconds.
- If the MSB is 1, the field is 2 bytes. Time = previous time + (offset & 0x7FFF) × 10 seconds.
Example: Get All Records
This example requests all available records:
- The first record has the timestamp 1 January 2023 at 00:00. It is a temperature report of 23.0 C.
- The second record has the timestamp 2 January 2023 at 00:00. It is a temperature report of 22.9 C.
- The full report does not fit in one uplink. The device sends more uplinks until it reports all records.
The number of records in one uplink changes with the size of the records. It also changes with the maximum uplink size when the device sends the uplink.
| Description | Downlink / Uplink |
|---|---|
| Request the count of all records | 0000000000FFFFFFFF |
| Response of 4 records | 000004 |
| Request all records, opcode V1 | 0100000000FFFFFFFF |
| Response of the first 2 records (V1) | 010163B0CD0000E60163B21E8000E5 |
| Response of the second 2 records (V1) | 010163B37E4C00E70163B3859000FF |
| Response of all 4 records at the same time (V1) | 010163B0CD0000E60163B21E8000E50163B37E4C00E70163B3859000FF |
| Request all records, opcode V2 | 0200000000FFFFFFFF |
| Response of the first 2 records (V2) | 020150DB8F9200E601A1C000E5 |
| Response of the second 2 records (V2) | 020150DE40DE00E70180BA00FF |
| Response of all 4 records at the same time (V2) | 020150DB8F9200E601A1C000E501A32E00E70180BA00FF |
Example: Decoded V2 Payload
This decoded payload has one report:
{
"data": {
"cache_records": [
{
"data": {
"payload_type": "sensor_data",
"temperature": 23.8
},
"timestamp": "2026-07-26T23:00:52Z"
}
],
"payload_type": "cache_records"
}
}
This decoded payload has more than one report from a cached backlog. The example shows the first 3 of 15 records:
{
"data": {
"cache_records": [
{ "data": { "payload_type": "sensor_data", "temperature": 25 }, "timestamp": "2026-07-23T00:27:35Z" },
{ "data": { "payload_type": "sensor_data", "temperature": 25.2 }, "timestamp": "2026-07-23T00:35:35Z" },
{ "data": { "payload_type": "sensor_data", "temperature": 24.8 }, "timestamp": "2026-07-23T00:50:35Z" }
],
"payload_type": "cache_records"
}
}
External Temperature Probe Calibration
You can calibrate the external temperature probe. Calibration changes the measured temperature to the actual temperature. You can set a maximum of 4 calibration points for each analog sensor. Each point maps a measured value to an actual value.
This example uses these calibration points:
| Measured Value | Actual Value |
|---|---|
| -85 | -80 |
| -5 | 0 |
| 50 | 40 |
| 110 | 100 |
These points make a line that maps the measured temperature to the actual temperature. The device uses piecewise linear interpolation to calculate the actual (calibrated) values between the points. For values outside the calibration points, the device uses the nearest line segment. You must set a minimum of 2 calibration points to activate calibration.
Use LoRaWAN payloads on FPort 218 to add, remove, and examine the calibration points.
Get/Set Calibration Configuration
| Name | Size (octets) | Description |
|---|---|---|
| Directive | 1 | Bits 7-6: 0 = GET, 1 = N/A, 2 = REMOVE POINT, 3 = ADD POINT. Bits 5-4: For Set, the index of the point to change. For Get, this value must be 0. Bits 3-0: Sensor type. 0x00 = RTD Thermometer. More types will follow. |
A Set request also needs these fields:
| Name | Size (octets) | Description |
|---|---|---|
| Measurement (uncorrected) value | 4 | For Sensor Type 0 (RTD): int32, big-endian, value in 0.1 C. |
| Corrected value | 4 | For Sensor Type 0 (RTD): int32, big-endian, value in 0.1 C that the device records for the related measurement. |
Report Calibration Config
The device sends this report as a response to a Get request. The device can also send this report without a request, for example at startup.
| Name | Size (octets) | Description |
|---|---|---|
| Descriptor | 1 | Bits 7-4: Bit flag of the points in the report. Bits 3-0: Sensor type. 0x00 = RTD Thermometer. More types will follow. |
For each point that has a bit set in the bit flag, the report contains these two fields:
| Name | Size (octets) | Description |
|---|---|---|
| Measurement (uncorrected) value | 4 | For Sensor Type 0 (RTD): int32, big-endian, value in 0.1 C. |
| Corrected value | 4 | For Sensor Type 0 (RTD): int32, big-endian, value in 0.1 C that the device records for the related measurement. |
Example
Downlink (Set):
C0 FFFFFCCC FFFFFCE0 D0 00000017 00000000
This downlink sets these points for Sensor Type 0 (RTD):
- Point 0: Measurement value -82. Corrected value -80.
- Point 1: Measurement value 2.3. Corrected value 0.
Response:
30 fffffccc fffffce0 00000017 00000000
This response reports the same points for Sensor Type 0 (RTD):
- Point 0: Measurement value -82. Corrected value -80.
- Point 1: Measurement value 2.3. Corrected value 0.
Response on SF10:
00 fffffccc fffffce0
10 00000017 00000000
Calibration Rules
- Add the points in sequence from the lowest uncorrected value to the highest, and from index 0 to index 3.
- Do not leave gaps in the values or in the indexes.
- The first point can exist alone. But the device ignores it until there are a minimum of 2 points.
- When you remove a point, the device also removes all points that follow it. If you remove point index 0, the device removes all points.
- You can put more than one Get or Set in a packet. If one of them fails, the device rejects all of them and keeps the previous state. The device sends one
FF. - If you try to remove a point that does not exist, the device sends
0xFF.
If the configuration change is successful, the device sends a report with all the points that are set at that time.
Battery Depassivation
The battery looks like a standard alkaline AA battery. But the device uses a high-capacity, long-life, lithium thionyl chloride battery. The property that gives the battery a long shelf life can cause problems at first use. This condition is passivation. Passivation is a thin film that grows around the anode. The film is an insulator that stops the battery from self-discharge.
If the device detects a high level of passivation, the device starts a 2-minute depassivation cycle. During this cycle, the LED gives a slow orange blink. At the end of the depassivation cycle, the device restarts and joins the network again.
What's Next?
- MQPS and Other Data Reporting - Packet format, sensor readings, configuration, reset reasons, and join reasons.
- LoRaWAN Commands and Responses - Device status and device version requests and responses.
- DFU Instructions - Update the device firmware with nRF Connect for Mobile.