Henglos IO
Built-in packages

Water Sensor

An analog water level / leak sensor (the S + - module and the like): Read gives how much of it is under water, Detect branches Wet or Dry, Water Trigger runs a branch when it gets wet (or dries off), and Calibrate measures its Dry and Wet levels.

An analog water level / leak sensor (the S + - module and the like): Read gives how much of it is under water, Detect branches Wet or Dry, Water Trigger runs a branch when it gets wet (or dries off), and Calibrate measures its Dry and Wet levels.

@henglosio/component-watersensorv1.0.0platform ^1.0.0
NodeKindWhat it does
Water TriggerTriggerRuns its branch when the sensor gets wet — a leak, a tank full — or dries off, or either; read every Interval.
ReadActionHow much of the sensor is under water — level from 0 (dry) to 100 % (as deep as it goes), wet once it reaches Threshold, and the raw reading.
DetectActionBranches Wet or Dry — whether the level reaches Threshold.
CalibrateActionTakes the reading now as the sensor's Dry level (out of the water) or Wet level (as deep as it goes), for Read, Detect and Water Trigger on the same Signal pin — run it once with each.

Triggers

Water Trigger

Runs its branch when the sensor gets wet — a leak, a tank full — or dries off, or either; read every Interval. Already wet when the program starts counts as getting wet.

A trigger: no input, one Out — the first action of its branch.

Settings

SettingTypeDefaultWhat it's for
Signal PinPin (analog in)GPIO36Required. Board pin wired to the sensor's S — an analog input; GPIO32-39 keep working with Wi-Fi on.
Power PinPin (digital out)—Board pin wired to the sensor's + — powered only while it reads, so its traces don't corrode. Empty, wire + to 3.3 V.
ThresholdNumber (1 to 100)10The level it counts as wet from, in % — 1 to 100.
Fires OnOne of: Getting wet, Drying off, BothGetting wetWhich change runs the branch.
IntervalNumber (from 50)500How often it reads, in ms — 50 at least.
SamplesNumber (1 to 64)8Advanced. Readings averaged, 1 to 64 — more is steadier, a little slower.
Dry LevelNumber (0 to 65535)0Advanced. The raw reading out of the water (0 %), 0 to 65535 — until Calibrate measures it on the sensor.
Wet LevelNumber (0 to 65535)35000Advanced. The raw reading as deep as it goes (100 %), 0 to 65535 — until Calibrate measures it on the sensor.

Publishes

OutputTypeWhat it is
levelfloatHow much of it is under water, 0 (dry) to 100 %.
wetboolWhether it's wet now — true when it fired on getting wet.
rawintThe voltage read, 0 (0 V) to 65535 (3.3 V) — to check the wiring and calibrate.

Actions

Read

How much of the sensor is under water — level from 0 (dry) to 100 % (as deep as it goes), wet once it reaches Threshold, and the raw reading.

Settings

SettingTypeDefaultWhat it's for
Signal PinPin (analog in)GPIO36Required. Board pin wired to the sensor's S — an analog input; GPIO32-39 keep working with Wi-Fi on.
Power PinPin (digital out)—Board pin wired to the sensor's + — powered only while it reads, so its traces don't corrode. Empty, wire + to 3.3 V.
ThresholdNumber (1 to 100)10The level it counts as wet from, in % — 1 to 100.
SamplesNumber (1 to 64)8Advanced. Readings averaged, 1 to 64 — more is steadier, a little slower.
Dry LevelNumber (0 to 65535)0Advanced. The raw reading out of the water (0 %), 0 to 65535 — until Calibrate measures it on the sensor.
Wet LevelNumber (0 to 65535)35000Advanced. The raw reading as deep as it goes (100 %), 0 to 65535 — until Calibrate measures it on the sensor.

Publishes

OutputTypeWhat it is
levelfloatHow much of it is under water, 0 (dry) to 100 %.
wetboolWhether level reached Threshold.
rawintThe voltage read, 0 (0 V) to 65535 (3.3 V) — to check the wiring and calibrate.

Detect

Branches Wet or Dry — whether the level reaches Threshold. A leak under the sink, a full tank, rain.

Ends on Wet, Dry — or Fallback when it can't run.

Settings

SettingTypeDefaultWhat it's for
Signal PinPin (analog in)GPIO36Required. Board pin wired to the sensor's S — an analog input; GPIO32-39 keep working with Wi-Fi on.
Power PinPin (digital out)—Board pin wired to the sensor's + — powered only while it reads, so its traces don't corrode. Empty, wire + to 3.3 V.
ThresholdNumber (1 to 100)10The level it counts as wet from, in % — 1 to 100.
SamplesNumber (1 to 64)8Advanced. Readings averaged, 1 to 64 — more is steadier, a little slower.
Dry LevelNumber (0 to 65535)0Advanced. The raw reading out of the water (0 %), 0 to 65535 — until Calibrate measures it on the sensor.
Wet LevelNumber (0 to 65535)35000Advanced. The raw reading as deep as it goes (100 %), 0 to 65535 — until Calibrate measures it on the sensor.

Publishes

OutputTypeWhat it is
levelfloatHow much of it is under water, 0 (dry) to 100 %.
rawintThe voltage read, 0 (0 V) to 65535 (3.3 V) — to check the wiring and calibrate.

Calibrate

Takes the reading now as the sensor's Dry level (out of the water) or Wet level (as deep as it goes), for Read, Detect and Water Trigger on the same Signal pin — run it once with each. Kept on the board (/data/water_sensor.json): it stays across runs and restarts.

Settings

SettingTypeDefaultWhat it's for
Signal PinPin (analog in)GPIO36Required. Board pin wired to the sensor's S — an analog input; GPIO32-39 keep working with Wi-Fi on.
Power PinPin (digital out)—Board pin wired to the sensor's + — powered only while it reads, so its traces don't corrode. Empty, wire + to 3.3 V.
PointOne of: Dry, WetDryWhich level this reading is — the sensor out of the water (Dry), or under it as deep as it goes (Wet).
SamplesNumber (1 to 64)16Advanced. Readings averaged, 1 to 64.

Publishes

OutputTypeWhat it is
rawintThe voltage read, 0 (0 V) to 65535 (3.3 V) — to check the wiring and calibrate.
dryintThe Dry level set so far.
wetintThe Wet level set so far.

On this page