Skip to content

DYP-A17 Ultrasonic Level Sensor Integration Guide

Model catalog

Search for these models in ThinkLink by name or ID.

Model typeNameid_namePlatform model ID
RPC[A17 GET] 22112dyp_a17_get_22112115860154150187009
RPC[A17 SET] 22112dyp_a17_set_22112115860154150187008
RPC[A17 SET ALARM] 22112dyp_a17_set_alarm_22112115861829380370432
RPC[A17 ACT] 22112dyp_a17_set_filter_22112115860154150187010
TemplateDYP-A17115862917407993856
Thing Model[A17]dyp_a17_22112115859351784026112
Thing Model[DYP-22112-A17资产] 区域聚合dyp_a17_asset_22112119677174411063307
Parameter Thing Model[A17-PARA]dyp_a17_para_22112115859352627081216
Trigger[A17] Level Alarm Triggerdyp_a17_trigger_22112115861828692504576

1. Sensor Overview

ItemValue
DeviceA17 Ultrasonic Level (Distance) Sensor
ModelDYP-A17-V1.0 (RS485 model DYP-A17NY4W-V1.0)
ManufacturerShenzhen Dianyingpu Technology Co., Ltd. (DYP / Best Sensor)
ProtocolModbus-RTU (RS-485)
ConnectivityEdgeBus DTU (KC21 battery), LoRaWAN Class A
Business Code22112
TemplateDYP-A17

The A17 uses reflective ultrasonic ranging to measure the non-contact distance from the probe to the liquid surface (range 25cm~1000cm). It connects to ThinkLink via a KC21 battery DTU over Modbus-RTU, for sewage/drainage well level monitoring with high-level/overflow, low-level, and sensor-fault alarms.

⚠️ Level semantics: the A17 measures the probe-to-liquid distance, so a higher liquid level means a SMALLER distance. Therefore the high-level alarm uses a small distance threshold and the low-level alarm uses a large one.

2. Product Features

  1. Smart signal processing, small blind zone, range 25cm~1000cm, min error < 1cm.
  2. Non-contact measurement — the probe never touches the sewage, avoiding corrosion, tangling and scaling.
  3. Anti-water-accumulation housing mitigates probe condensation (critical in humid wells).
  4. On-board temperature compensation (-15℃~60℃) auto-corrects temperature drift.
  5. Low power: static current < 10µA, measuring < 15mA; long battery life with the battery DTU + COV reporting.
  6. Adjustable step-filter level, probe excitation strength and blind-zone value for complex well conditions.
  7. ESD protection per IEC61000-4-2.

3. Application Scenarios

  • Sewage / drainage well level monitoring (this integration)
  • Municipal drainage network / rain-well flood early warning
  • Sump / pump-station level monitoring

4. Gateway (DTU) Information

4.1 Hardware

ItemValue
DTU modelKC21 (battery version)
InterfaceRS-485
PowerBattery (confirmed), LoRaWAN Class A
Device templateMT-EB-BATTERY
HeartbeatFactory/binding ships a short heartbeat (900s, for commissioning); after configuration the SET RPC sets it to 8h (28800s) to save power
Sensor voltageDC 3.3~5.0V (static < 10µA, measuring < 15mA)

⚠️ Power compatibility (verify on site before deployment): the A17 sensor operates at DC 3.3~5.0V. The voltage the KC21 battery DTU outputs to power the sensor must match this (some KC21 battery versions offer 3.3V/5V output). Similar battery ultrasonic level sensors have been integrated successfully, but verify the actual KC21 supply output before deployment to avoid a power mismatch that prevents the sensor from working.

4.2 Wiring

PinLabelFunctionTo KC21 (battery)
VCC3.3~5V powerKC21 VCC output (verify voltage)
GNDGroundKC21 GND
RXRS485-B (inverting)KC21 RS485-B
TXRS485-A (non-inverting)KC21 RS485-A

Note: on the A17, ③RX = 485-B and ④TX = 485-A; do not swap the A/B pairing.

5. Data Acquisition

Via Modbus-RTU (FC03 read holding registers, CRC-16, default address 0x01, 9600/8/N/1, big-endian) the following points are read:

  • 0x0100 processed distance (filtered stable value) → primary level telemetry, alarm basis
  • 0x0101 real-time distance (single-shot, 130ms response) → COV trigger source
  • 0x0102 ambient temperature

5.1 Register Map

RegisterItemData TypeR/WNotes
0x0100Processed distanceuint16BE (mm)RFiltered stable value, response 0.9~2.5s (acquired, alarm basis — filtered/stable)
0x0101Real-time distanceuint16BE (mm)RSingle-shot, response 130ms (acquired, COV trigger source — fastest, for overflow early-warning; noisier so NOT used for alarms)
0x0102Ambient temperatureint16BE (0.1℃)RModule temperature, 0.5℃ resolution (acquired)
0x0200Slave addressuint16BER/W0x01~0xFE, default 0x01
0x0201Baud rateuint16BER/WDefault 0x03=9600
0x0210Blind-zone valueuint16BE (cm)R/W25~100, default 25; affects blind-zone stability
0x0211Step-filter leveluint16BER/W0~5, default 4; higher = stronger filtering
0x0212Probe excitationuint16BER/W5~15, default 10
0x0213Small-angle modeuint16BER/W0 normal / 1 small-angle, default 0

5.2 Communication Examples

Read distance:   M 01 03 01 00 00 01 85 F6 -> S 01 03 02 02 F2 38 A1 (0x02F2=754mm)
Read temp:       M 01 03 01 02 00 01 24 36 -> S 01 03 02 01 2C B8 09 (0x012C=30.0℃)
Write step filt: M 01 06 02 11 00 03 98 76 -> S 01 06 02 11 00 03 98 76 (step filter = 3)

6. EdgeBus Model

6.1 EB Configuration

ParamValue
namedyp-a17
port22
version0x87
dataType0x12
upPeriodIndex70 (upload period app_70)
periodIndex74 (collect period app_74)
indexAPP150 (Modbus address app_150)
COVenabled on distance_realtime (real-time distance 0x0101, covAppIndex 110 / cov_distance)
Serial9600 / 8 / NONE / 1
Batterytrue (Class A)
BzType / BzVersion22112 / 2

6.2 EB Code

typescript
import { Buffer } from "buffer";
import { buildOtaFile } from "@EBSDK/run";
import { EBModel } from "@EBSDK/EBCompiler/EBModel/EBModel";
import { EventInfoItem } from "@EBSDK/EBCompiler/plugins/EBHelper";
import type { UserConfUPItem } from "@EBSDK/EBCompiler/plugins/EBHelper";
import { CheckbitEnum, getOtaConfig } from "@EBSDK/otaConfig";

// DYP-A17 超声波液位(测距)传感器 · Modbus-RTU FC03
//   0x0100 处理值距离 (uint16BE, mm)  ← 告警判据(滤波稳定),每帧上报
//   0x0101 实时值距离 (uint16BE, mm)  ← COV 上报触发源(130ms 响应,溢出早预警),阈值 app_110(cov_distance)
//   0x0102 环境温度   (int16BE, 0.1℃)
// 采集周期 app_74 / 上传周期 app_70 / Modbus 地址 app_150
// 2026-06-07 amend:加回 0x0101 实时值并把 COV 由 0x0100 移到 0x0101;BzVersion 1→2。
const eventInfo: UserConfUPItem[] = [
  {
    name: "dyp-a17", port: 22, version: "0x87", dataType: "0x12", upPeriodIndex: 70,
    quInfo: [
      {
        protocol: "modbus", addr: "0x01", code: "0x03", periodIndex: 74,
        indexAPP: 150, indexCMD: 0, copySize: 1,
        listVal: [
          { start: "0x0100", end: "0x0100" },
          { start: "0x0101", end: "0x0101", covType: "Uint16BE", covAppIndex: 110 },
          { start: "0x0102", end: "0x0102" }
        ]
      }
    ]
  }
];

let otaConfig = getOtaConfig({
  BaudRate: 9600,
  StopBits: 1,
  DataBits: 8,
  Checkbit: CheckbitEnum.NONE,
  Battery: true, // 电池供电,Class A
  ConfirmDuty: 60,
  BzType: 22112,
  BzVersion: 2
});

const MODBUS_TT = (ebModel: EBModel) => {
  for (let i = 0; i < eventInfo.length; i++) {
    let event = new EventInfoItem(eventInfo[i]);
    event.upEventSetup();
    event.eventInstall();
  }
  return JSON.stringify(ebModel, null, 2);
};
buildOtaFile(import.meta.url, otaConfig, MODBUS_TT);

6.3 Notes

  • One query event: FC03 reads registers 0x0100 (processed distance), 0x0101 (real-time distance) and 0x0102 (temperature) — three data points.
  • COV reporting: COV is enabled on distance_realtime (real-time distance 0x0101), threshold from app_110 (cov_distance); the real-time value responds fastest (130ms) for earlier overflow warning, and a level change >= threshold uploads immediately while saving battery. The real-time value is noisier, so in fluctuating wells the threshold may need raising; alarms still use the stable processed distance (0x0100).
  • Separate collect/upload periods: collect app_74, upload app_70 (COV window cap).
  • Uplink frame layout: standard 6-byte DTU header + distance (index 6-7, uint16BE) + distance_realtime (index 8-9, uint16BE) + temperature (index 10-11, int16BE), dataLen = 12.
  • Dynamic Modbus address: app_150 (indexAPP).

7. Thing Models

7.1 Basic Info

TypeDisplay nameid Name
Telemetry[A17]dyp_a17_22112
Parameter[A17-PARA]dyp_a17_para_22112

frameInfo: port 22, dataLen 12, rssi true, battery 4, tagList [{index:0,tag:0x87},{index:1,tag:0x12}]

indexfieldtypeunitcoefficient
6distanceuint16BEmm1
8distance_realtimeuint16BEmm1
10temperatureint16BE0.1

7.3 Scripts

Telemetry dyp_a17_22112.js and parameter dyp_a17_para_22112.js are under thinklink/thingModel/.

8. Third-Party Data Subscription

8.1 MQTT Topic

/v32/{Organization Account}/tkl/up/telemetry/{eui}

8.2 Sample Payload

json
{
    "eui": "0102030405060708",
    "active_time": "2026-06-06T08:35:48.000Z",
    "thingModelId": "115859351784026112",
    "thingModelIdName": "dyp_a17_22112",
    "telemetry_data": {
        "snr": 12.5,
        "rssi": -68,
        "battery": 3.55,
        "distance": 754,
        "distance_realtime": 752,
        "temperature": 23.5
    }
}

9. RPC

9.1 RPC Names

TypeDisplay nameid Name
Set parameters[A17 SET] 22112dyp_a17_set_22112
Get parameters[A17 GET] 22112dyp_a17_get_22112
Device-register tune (variant)[A17 ACT] 22112dyp_a17_set_filter_22112
Alarm threshold config[A17 SET ALARM] 22112dyp_a17_set_alarm_22112

9.2 Parameter Definitions

ParamSlot/RegisterNameUnitTypeDefaultDescription
period_upapp_70Upload periodsuint32LE3600How often data is pushed to the cloud (COV window cap)
period_readapp_74Collect periodsuint32LE300How often the DTU polls the sensor
cov_distanceapp_110COV distance thresholdmmint16BE50Real-time distance (0x0101) change >= this uploads immediately; the real-time value is noisier, raise it in fluctuating wells
period_heartapp_40Heartbeat periodsuint32LE28800Battery power-saving default 8h (short factory heartbeat is for commissioning only)
addr_modbusapp_150Modbus addressuint81DTU query target address
step_filter0x0211Step-filter leveluint164Transparent FC06 write to device register
blind_zone0x0210Blind-zone valuecmuint1625Transparent FC06 write to device register

9.3 RPC Notes

  • dyp_a17_set_22112: writes upload/collect period, COV threshold, Modbus address and heartbeat in one shot (PTL-D01 port 214). Battery devices keep heartbeat >= 1h (default 8h) to save power.
  • dyp_a17_get_22112: reads current DTU app parameters.
  • dyp_a17_set_filter_22112 (variant): dropdown chooses step-filter level or blind-zone value; transparent FC06 write to the device register, echo-validated then written back to shared_attrs. One item per call, current value prefilled.
  • dyp_a17_set_alarm_22112: configures per-well alarm thresholds (writes server_attrs.alarm_config, read by the alarm trigger).

Full RPC scripts are under thinklink/rpc/.

10. Alarms

The trigger dyp_a17_trigger_22112 ([A17] Level Alarm Trigger) evaluates after each telemetry frame; thresholds come from server_attrs.alarm_config (set per well via dyp_a17_set_alarm_22112; safe defaults apply if unset).

AlarmCondition (distance semantics)Default thresholdLevel
High level / overflowdistance <= high_level_dist (liquid near probe)300mmhigh
Low leveldistance >= low_level_dist (well near empty)8000mmmid
Sensor reading faultdistance abnormal (< 250mm blind zone / >= 10000mm over range / = 0)mid
  • Distance thresholds use a 50mm hysteresis dead-band to prevent chatter near thresholds.
  • Run dyp_a17_set_alarm_22112 first to set thresholds, and set the notify group on the device.
  • Offline / no-data is handled by the platform offline alarm (the trigger only evaluates on uplink and cannot detect "no uplink").

11. Template Selection

In the ThinkLink platform, find the template by:

  • Template name: DYP-A17
  • Business code: 22112 (ultrasonic level sensor)

12. Additional Notes

  • Factory defaults: slave address 0x01, baud 9600, blind zone 25cm, step filter level 4, probe excitation 10.
  • Change slave address: FC06 write 0x0200; change baud: FC06 write 0x0201 (effective after reboot).
  • In humid wells with large temperature swings the probe can develop condensation, affecting the ultrasonic signal; the A17 anti-water housing mitigates this — if needed, raise the step-filter level via dyp_a17_set_filter_22112.