Milesight WS201: LoRaWAN Smart Fill-Level Monitoring Sensor

Milesight WS201 LoRaWAN fill-level sensor: own ChirpStack/ThingsBoard decoder, decoded example, ToF distance and remaining-amount alerts.

Milesight WS201
WS201Sensor
LoRaWAN
Class A, OTAA
Band / port
EU868 / port 85
Sensing
Time-of-Flight distance
Detection range
1 to 55 cm, accuracy plus/minus 1 cm
Battery
590 mAh CR2450, around 3.2 years
Mounting
Inside containers and dispensers
Configuration
NFC (Milesight ToolBox)
Measurements

What the WS201 measures

Distance

Time-of-Flight distance to the surface in millimetres, valid across the 1 to 55 cm detection range with plus/minus 1 cm accuracy.

Remaining amount

Fill level derived from distance as a percentage, after you calibrate empty and full.

Battery level

Reported as a percentage so refills and battery swaps can be planned together.

Data into your dashboard

Integration

Sensor / controller

Measures or controls in the field and sends LoRaWAN uplinks.

LoRaWAN gateway

Receives the radio packets and forwards them to the server.

ChirpStack

Network server: manages sessions and decodes the payload.

ThingsBoard / Grafana

Dashboards, alarms, rules and reports.

ChirpStack v4 · decodeUplink
function decodeUplink(input) {
  var bytes = input.bytes;
  var data = {};

  for (var i = 0; i < bytes.length; ) {
    var channel = bytes[i++];
    var type = bytes[i++];

    if (channel === 0x01 && type === 0x75) {          // battery (%)
      data.battery = bytes[i]; i += 1;
    } else if (channel === 0x03 && type === 0x82) {   // distance (mm)
      data.distance = readUInt16LE(bytes, i); i += 2;
    } else if (channel === 0x04 && type === 0xd6) {   // remaining amount (%)
      data.remaining = bytes[i]; i += 1;
    } else {
      break;
    }
  }
  return { data: data };
}

function readUInt16LE(b, i) {
  return ((b[i + 1] << 8) | b[i]) & 0xffff;
}

Implemented from the published Milesight byte specification (Communication Protocol / User Guide).

Channel format: 01 75 battery (%), 03 82 distance (UINT16 little-endian, millimetres), 04 D6 remaining amount (%). Device-info and downlink-response frames start with channel FF and FE and are skipped here. The remaining percentage depends on the empty and full reference distances you calibrate over NFC, so document those for each container. For ThingsBoard the same channel logic goes into an uplink converter. Implemented from the published Milesight byte specification.

Uplink (hex)

0175640382540104D65A

Decoded JSON

{ "battery": 100, "distance": 340, "remaining": 90 }
From the field

Configuration & pitfalls

NFC setup

Keys, reporting interval and the empty/full reference distances are written over NFC with the Milesight ToolBox before rollout.

Calibrate empty and full

The remaining percentage is derived from distance, so set the empty and full reference points per container, otherwise the percentage drifts between container shapes.

Stay inside the detection range

The Time-of-Flight sensor reads from 1 to 55 cm. Mount it so the surface of a full and an empty container both stay within that range, otherwise readings clip at the near or far limit.

Threshold alarms

A low-remaining alarm is sent immediately, outside the reporting interval, so dashboard rules should treat alarm uplinks as priority refill events.

Your partner

How merkaio supports your WS201

From sourcing to day-to-day operation, all from one partner on our own European infrastructure.

Pre-staging & provisioning

We configure the WS201, set keys, intervals and alarms, and ship it ready to deploy.

Own decoder

Payload codec for ChirpStack v4 and ThingsBoard, implemented from the Milesight specification.

Dashboard integration

Data lands in your ThingsBoard or Grafana, with alarms and reports.

Operations & monitoring

We run the LoRaWAN stack and dashboards on European infrastructure, you just use the data.

Frequently asked questions

Yes. It is a standard LoRaWAN device, no Milesight gateway or cloud required. You add the codec to the device profile and provision it via OTAA.
Yes, for both ChirpStack and ThingsBoard, implemented from the published Milesight byte specification. The same channel logic goes into a ThingsBoard uplink converter.
It is a Class A device on LoRaWAN port 85. Each uplink carries the Time-of-Flight distance and remaining amount; battery level is reported as a percentage.
It uses a Time-of-Flight sensor to measure the distance to the surface inside a container, then derives a remaining-amount percentage from the empty and full reference distances you calibrate.
It runs on a 590 mAh CR2450 lithium coin cell rated for around 3.2 years at SF7 on EU868, depending on the reporting interval you configure over NFC.
The percentage is derived from distance, so it depends on the empty and full reference distances. Recalibrate those references for the container shape and confirm both the full and empty surface stay within the 1 to 55 cm detection range.
From the same series

Related devices

Let's discuss your infrastructure. Digital and on-site.

Whether it's IoT platform development, hardware selection, managed hosting for ChirpStack, ThingsBoard, Grafana or NetBird VPN, or migration from a self-hosted setup - we'll find the right solution for your use case. Book a free 30-minute consultation, no commitment required.

Timo Wevelsiep

Your contact

Timo Wevelsiep

Founder, merkaio

15 minutes, no commitment, directly with Timo.

By submitting, you agree to our Privacy Policy.

Decoder for ChirpStack v4. merkaio is an independent integrator and is not affiliated with Milesight.