TapHome

ComWinTop CWT-ULS Ultrasonic Level Sensor

Modbus RTU
Submitted by
Last updated: 03. 2026
ComWinTop CWT-ULS Ultrasonic Level Sensor

The ComWinTop CWT-ULS is a non-contact ultrasonic level sensor that connects to TapHome via Modbus RTU over RS-485. The sensor measures distance to a liquid surface using ultrasonic pulses and calculates the liquid level based on a configurable mounting height. Two models are available: CWT-ULS-I-10M (integrated) and CWT-ULS-S-10M (split probe with cable).

The TapHome template exposes liquid level height, distance to surface, a built-in temperature sensor, and two virtual relays with configurable hysteresis thresholds. All register values use 32-bit IEEE 754 floating point encoding, each occupying two Modbus registers.

Hardware connection

Technical specifications
ParameterValue
Measurement range0.5–20 m
Blind area0.35–0.5 m
Accuracy0.5%
Resolution1 mm
Power supply12–28 VDC
Power consumption< 0.6 W
Operating temperature-40°C to +80°C
Protection ratingIP65
ProtocolModbus RTU Slave, RS-485
Baud rate9600 (default), configurable 600–115200
ThreadG2, diameter 60 mm
RS-485 wiring

The sensor uses a 4-wire connection with color-coded cables:

Wire colorFunctionTerminal pair
BrownPower + (12–28 VDC)05–06
BlackPower - (GND)05–06
Yellow/GreenRS-485 A+01–02
BlueRS-485 B-01–02

Connect the RS-485 wires to TapHome:

  • A+ (Yellow/Green) → A+/D+ on TapHome RS-485
  • B- (Blue) → B-/D- on TapHome RS-485

The sensor also has two relay output terminals:

Terminal pairFunction
08–09Relay 1 output
10–11Relay 2 output

Blind area limitation

The sensor cannot measure distances shorter than 0.35–0.5 m from the sensor face (the blind area). Position the sensor so the maximum liquid level stays below this minimum distance.

Installation guidance
  • Position the sensor away from tank inlets to avoid turbulence interference
  • Avoid obstacles in the ultrasonic measurement cone
  • Account for tank geometry — conical or spherical shapes may affect readings
  • If the liquid surface has debris or turbulence, use a guide tube with a diameter greater than 120 mm

Configuration

Modbus RTU communication is always active on the RS-485 interface — no activation steps are required.

Slave ID and baud rate

The default Slave ID is 1 and the default baud rate is 9600 (8N1). Both can be changed via TapHome service actions on the module after the template is imported:

  • Slave ID service action — writes H:20 (Float), range 1–254
  • Baud rate service action — writes H:22 (Float), configurable 600–115200

The current Slave ID and baud rate are readable as module-level service attributes.

After changing the Slave ID or baud rate via service actions, the sensor will respond on the new address/speed immediately. Update the TapHome module connection settings to match.

Mounting height setup

To enable liquid level calculation, the mounting height (distance from the sensor face to the tank bottom) must be configured:

  1. Open the Liquid Level Height device in TapHome
  2. Go to service settings
  3. Use the Mounting height service action to set the installation height in meters (0–11 m)

Without a configured mounting height, the Liquid Level Height device displays a warning and returns 0. The Distance to Surface device continues to report the raw measured distance regardless of the mounting height setting.

Device capabilities

Level measurement

The template provides two complementary measurement devices:

  • Liquid Level Height (H:0 + H:10, Float) — calculated liquid level in meters. The sensor reads the display value from H:0 and the mounting height from H:10, returning the calculated level. If the mounting height is not set (H:10 = 0), a warning is generated and the value returns 0. The mounting height can be viewed as a service attribute and configured via a service action.

  • Distance to Surface (H:0 + H:10, Float) — distance from the sensor to the liquid surface in meters. When the mounting height is not set, this returns the raw display value. When the mounting height is set, it returns the inverse calculation (mounting height minus the display value).

Temperature sensor
  • Temperature Sensor (H:2, Float) — built-in temperature sensor in °C. The sensor uses this value internally for ultrasonic sound velocity compensation, but it is also exposed as a readable temperature. Useful for monitoring the ambient temperature at the sensor location.
Relay outputs

The template exposes two virtual relays with hysteresis control:

  • Relay 1 (H:0 vs H:28/H:30, Float) — activates or deactivates based on the measured distance crossing configurable ON and OFF thresholds
  • Relay 2 (H:0 vs H:32/H:34, Float) — same logic as Relay 1 with independent thresholds

Hysteresis logic: The relay behavior depends on the relationship between the ON and OFF thresholds:

  • If ON threshold < OFF threshold — the relay activates when the measured value drops below the ON threshold and deactivates when it rises above the OFF threshold. Use this for low-level alarms (e.g., activate pump when tank level is low).
  • If ON threshold > OFF threshold — the relay activates when the measured value rises above the ON threshold and deactivates when it drops below the OFF threshold. Use this for high-level alarms (e.g., close valve when tank is nearly full).

Each relay has two service attributes showing the current ON and OFF thresholds in meters, and two service actions to configure them (range 0–10 m).

The relay thresholds operate on the raw display value (H:0), not the calculated liquid level. When configuring thresholds, consider whether the mounting height is set — the display value represents the calculated level when mounting height is configured.

Additional capabilities

The CWT-ULS sensor also exposes registers for supply voltage monitoring, cumulative operating time, liquid level vs. object level mode selection, measurement media type (Air, Water, Custom) for sound velocity calculation, measurement period, blind area configuration, and signal filtering levels (None, Rapid, Fast, Normal, Stable). The 4–20 mA analog output range can be calibrated via start/end point registers. These can be added in a future template update.

Troubleshooting

No Modbus communication
  1. Check RS-485 cables — verify A+ (Yellow/Green) is connected to A+/D+ on TapHome and B- (Blue) is connected to B-/D- on TapHome. Swapped wires are the most common cause of communication failure
  2. Verify power supply — the sensor requires 12–28 VDC on terminals 05–06
  3. Check Slave ID — default is 1. If changed via the sensor display or a previous Modbus write, ensure TapHome is configured with the matching address
  4. Confirm baud rate — default is 9600 baud, 8 data bits, no parity, 1 stop bit. Verify TapHome bus settings match
  5. Bus termination — for long cable runs or multiple devices, ensure proper RS-485 bus termination (120 Ω resistor at each end of the bus)
Liquid level shows 0 with warning

The mounting height has not been configured. Open the Liquid Level Height device → service settings → set the mounting height via the service action. The value must be greater than 0.

Unstable or erratic readings
  1. Check for obstructions — ensure the ultrasonic measurement cone is free of obstacles
  2. Reduce turbulence — if the liquid surface is agitated, consider using a guide tube (diameter > 120 mm) or adjusting the filtering mode via register H:70 (0=None through 4=Stable)
  3. Verify media type — if measuring through a medium other than air, the sound velocity setting (register H:54) may need adjustment
  4. Check blind area — if the target is closer than 0.35–0.5 m from the sensor face, measurements will be unreliable

Available devices

ComWinTop CWT-ULS Module
Service Attributes
Slave ID
Baud rate
Service Actions
Slave ID
Baud rate

ComWinTop - Ultrasonic Level Sensor

Service Attributes
Slave ID
modbusr(H, 20, float)
Baud rate
modbusr(H, 22, float)
Service Actions
Slave ID
Parameters: ID (1–254 ID)
modbusw(H, 20, float, ID)
Baud rate
Parameters: baud (1–500000 baud)
modbusw(H, 22, float, baud)
Relay 1 Reed Contact Read-only

Virtual relay with hysteresis — activates when measured distance crosses the ON threshold, deactivates at the OFF threshold

Register: H:0 Float numeric
Service Attributes
Relay ON [m]
Relay OFF [m]
Service Actions
Relay ON
Relay OFF

Relay 1

Read
if D < H
	if X < D
		return(1);
	elseif X > H
		return(0);
	else
		return(Rc);
	end
elseif D > H
	if X > D
		return(1);
	elseif X < H
		return(0);
	else
		return(Rc);
	end
else
	return(0);
end
Read (module)
D := modbusr(H, 28, float);
H := modbusr(H, 30, float);
X := modbusr(H, 0, float);
Service Attributes
Relé ON [m]
D
Relé OFF [m]
H
Service Actions
Relé ON
Parameters: Vzdialenost (0–10 m)
modbusw(H, 28, float, m)
Relé OFF
Parameters: Vzdialenost (0–10 m)
modbusw(H, 30, float, m)
Relay 2 Reed Contact Read-only

Virtual relay with hysteresis — activates when measured distance crosses the ON threshold, deactivates at the OFF threshold

Register: H:0 Float numeric
Service Attributes
Relay ON [m]
Relay OFF [m]
Service Actions
Relay ON
Relay OFF

Relay 2

Read
if D < H
	if X < D
		return(1);
	elseif X > H
		return(0);
	else
		return(Rc);
	end
elseif D > H
	if X > D
		return(1);
	elseif X < H
		return(0);
	else
		return(Rc);
	end
else
	return(0);
end
Read (module)
D := modbusr(H, 32, float);
H := modbusr(H, 34, float);
X := modbusr(H, 0, float);
Service Attributes
Relé ON [m]
D
Relé OFF [m]
H
Service Actions
Relé ON
Parameters: Vzdialenost (0–10 m)
modbusw(H, 32, float, m)
Relé OFF
Parameters: Vzdialenost (0–10 m)
modbusw(H, 34, float, m)
Temperature Sensor Temperature Sensor Read-only
Register: H:2 Float Unit: °C numeric

Temperature Sensor

Read temperature
MODBUSR(H, 2, float)
Liquid Level Height Variable Read-only

Calculated liquid level — requires mounting height to be configured via service action

Register: H:0 Float Unit: m numeric
Service Attributes
Mounting height [m]
Service Actions
Mounting height

Liquid Level Height

Read
var mnt := MODBUSR(H, 10, float);
var val := MODBUSR(H, 0, float);
if mnt = 0
	addwarning("Montážna výška nie je nastavená");
	return(0);
else
	return(val);
end
Service Attributes
Montážna výška [m]
MODBUSR(H, 10, float)
Service Actions
Montážna výška
Parameters: Výška (0–11 m)
modbusw(H, 10, float, m)
Distance to Surface Variable Read-only

Distance from sensor to liquid surface — raw measurement when mounting height is not set, inverse calculation otherwise

Register: H:0 Float Unit: m numeric

Distance to Surface

Read
var mnt := MODBUSR(H, 10, float);
var val := MODBUSR(H, 0, float);
if mnt = 0
	return(val);
else
	return(mnt - val);
end
Connection: Modbus RTU • 9600 baud• 8N1 • Slave ID: $[SlaveId]
Possible improvements (13)
  • H:4 Supply Voltage — Read-only supply voltage — useful for remote power monitoring and diagnostics
  • H:6 Operating Time — Read-only cumulative operating time — useful for maintenance scheduling
  • H:8 Liquid Level / Object Level Mode — 1=Liquid level, 0=Object level — determines measurement interpretation
  • H:14 Open/Closed State — 1=Open, 0=Closed — relay output mode configuration
  • H:16 Output Starting Point — 4–20mA analog output starting point calibration
  • H:18 Output End Point — 4–20mA analog output end point calibration
  • H:44 Units — Display unit selection — 0 for mm
  • H:54 Media Type — 0=Air, 1=Water, Custom — affects sound velocity calculation
  • H:56 Custom Sound Velocity — Custom sound velocity value — used when Media Type is set to Custom
  • H:60 Measurement Period — Measurement cycle period in milliseconds
  • H:62 Blind Area — Minimum measurable distance from sensor face (0.35–0.5m typical)
  • H:70 Filtering — Signal filtering level: 0=None, 1=Rapid, 2=Fast, 3=Normal, 4=Stable
  • H:76 Range — Maximum measurement range in meters

Sources