Read the plant's own temperature — the earliest signal of water stress — with a no-contact infrared eye.
| Status | Source release — build & flash it yourself |
| Interface | MLX90614 non-contact IR thermometer (I²C) |
| Delivers | Webhook (HTTP POST) · MQTT — oat-ods/0.3 |
| Site page | openagriculturetechnology.com/build/sketches/cwsi-node/ |
| License | Apache-2.0 |
A plant tells you it's thirsty before it wilts: its canopy runs warmer than the air as stomata close. This node reads canopy temperature with a no-contact infrared thermometer pointed at the canopy and reports three measurements under one stream:
canopy_temperature — the leaf/canopy surface temp (IR object temp)air_temperature — the sensor's ambient temp (an air-temp proxy)canopy_air_delta — canopy minus air, the core water-stress signalCWSI is a derived index, not a raw reading. It needs the canopy–air delta and vapor-pressure deficit (from air temp + RH). This node provides the canopy ingredient; the CWSI index is computed in the Use layer where VPD is known. The quick read: a cool canopy (negative delta) = transpiring / well-watered; a warm canopy (positive delta) = stomata closing / water stress.
MLX90614 is I²C (3.3 V): SDA, SCL, 3V3, GND. Default pins SDA=21 / SCL=22 (configurable on the setup page — C3/C6 boards differ). Aim it at the canopy, not the soil or pot, and avoid sun glinting into the sensor.
Flash (see Build), join OAT-CWSI-xxxx, open the setup page (admin / oatsetup),
set Wi-Fi + delivery + the stream id (the canopy spot, e.g. gh2-canopy) +
interval. Point delivery at the test endpoint
to confirm.
pipx install platformio # or: pip install --user platformio
cd oat-cwsi-node
./build.sh
This is a source release: it compiles against the pinned deps but hasn't
earned the bench-verified badge the live sketches carry — build it, flash it, and
prove it on your bench before you trust it in the field. Deps (pinned in
platformio.ini): Adafruit MLX90614 Library, PubSubClient, ArduinoJson,
and the local oat_ods module.
How do you measure crop water stress with a sensor? Point a non-contact infrared thermometer at the canopy and compare leaf temperature to air temperature. A canopy warmer than the air indicates closing stomata and water stress; a cooler canopy indicates active transpiration. Combined with vapor-pressure deficit, the canopy–air difference yields the Crop Water Stress Index (CWSI).
What sensor reads leaf or canopy temperature? A non-contact infrared thermometer such as the MLX90614 reads surface temperature from a short distance without touching the leaf. Aimed at the canopy it reports the canopy surface temperature, and its onboard ambient sensor gives a nearby air-temperature reference.
oat-sht30-node/ — pairs naturally: its temp + RH gives the VPD the CWSI calculation needs.../lib/oat_ods/ — the shared oat-ods encoder + measurand vocabulary.Shared core: this sketch carries its own copy of the config / Wi-Fi / delivery scaffolding; as the shared
oat-node-corelibrary is adopted, only the MLX read + emit stays sketch-specific.
Code: Apache-2.0 · Docs: CC BY 4.0 · An OAT sketch — an OpenCDC initiative.