Optimizing automatic watering using sensors

Optimizing automatic watering using sensors

At the beginning of the Summer, we showed you in this blog the installation of a SenseCAP S700 V2 weather station with the aim of collecting data to optimize the watering of a vegetable garden. After a few weeks of measures, it's time to analyze the data collected to see whether or not it provides any useful information...




Our measuring system is based on three instruments connected to the same SDI-12 bus: a SenseCAP S700 V2 weather station, a Delta-T WET150 soil moisture sensor and another Acclima TDR-315N soil moisture sensor.

Vegetable garden with weather station and two soil moisture probes
Vegetable garden with weather station and two soil moisture probes


The SDI-12 bus is formed by a simple 3-wire outdoor cable several tens of meters long, which goes inside where it is connected to a Yocto-SDI12 mounted on a YoctoHub-Ethernet, which sends measures every 30 seconds to a PHP server with VirtualHub (for Web). Measurements are displayed using our Yocto-Visualization (for Web) application.

Wet weather measures

Let's start by looking at the measures recorded during the first 6 weeks of the experiment, i.e. since May 30. From the outset, we've omitted wind measures, which as we saw in the first tests are not really usable, probably due to the positioning of the weather station.

Air temperature (in red) and ground temperature
Air temperature (in red) and ground temperature


Air humidity (red) and soil moisture (green and blue)
Air humidity (red) and soil moisture (green and blue)


Atmospheric pressure
Atmospheric pressure


Rainfall duration
Rainfall duration


Rainfall intensity
Rainfall intensity


Illuminance
Illuminance


During this first period, the weather ensured natural irrigation - in more straightforward terms, June and early July were downright rotten. In fact, the tomato plants all died suddenly, probably due to a fungal attack caused by the excessive humidity...

First observation: measuring precipitation provides an indication that it would not have been possible to deduce from simpler sensors, such as an atmospheric humidity sensor or a light sensor. The classic method of turning off the sprinkler when the air is saturated with humidity is therefore not very reliable. The same applies to atmospheric pressure: we can see that heavy rainfall is generally linked to a sharp drop in atmospheric pressure, but sometimes the storm just passes by and it rains little or not at all, without it being possible to detect it using simple atmospheric measures.

The sensors that seem to provide the most relevant information are the soil moisture sensors. Although there is a difference in scale between the two measured values, probably due to the measuring technique or the configuration of the sensors, they evolve in a coherent manner and the increases in soil moisture correspond well to rainfall. After rainfall, we can clearly see the "steps" formed by the alternation of sharp drops in humidity due to evaporation during the hottest hours, and a stabilization of the value during the night and morning.

Dry weather measures

Let's take a look at the six most recent weeks (there is an overlap of around 2 weeks with the previous graphs). During these weeks, there were a few periods of watering as the drought set in:

Air temperature (in red) and ground temperature
Air temperature (in red) and ground temperature


Air humidity (red) and soil moisture (green and blue)
Air humidity (red) and soil moisture (green and blue)


Atmospheric pressure
Atmospheric pressure


Rainfall duration
Rainfall duration


Rainfall intensity
Rainfall intensity


Illuminance
Illuminance


At the end of this period, soil humidity drops dangerously. This can also be seen on the plants, which were not very happy when we returned from vacation... But the effect of watering on July 19 and 20, July 24, July 26 and several times between August 5 and 7 is clearly visible on the soil humidity graph.

Observing the effects of watering

Let's take a closer look at the effect of the latest waterings on soil moisture:

  • August 5 at 9 pm, 60 minutes of drip irrigation
  • August 6 at 9:30 am, 30 minutes of drip irrigation
  • August 6 at 9:30 pm, 30 minutes of drip irrigation
  • August 7 at 9:30 pm, 30 minutes of drip irrigation

Air humidity (red) and soil moisture (green and blue)
Air humidity (red) and soil moisture (green and blue)


The first hour's watering effectively lifted the soil moisture out of the danger zone - before this watering, the plants were seriously starting to die back. On the other hand, the additional watering at 9.30 a.m. on August 6 had no significant long-term impact, compared with the situation on the following two days, when watering was only carried out after 24 hours: this was therefore wasted water.

Heuristics

We can now imagine heuristics for knowing when to activate watering optimally.

  • The most decisive criterion is clearly the soil moisture sensor. SDI-12 soil moisture sensors are unfortunately rather expensive, but the most affordable one (Delta-T WET150) seems to give results as good as the other one.
  • The absolute value of the soil moisture sensor is not necessarily usable as such, given the difference in value between the two sensors, but its relative variation with respect to the average value for a known wet period is fully decisive.
  • If you have a rain sensor, for example, you can automatically calibrate the system by taking the soil moisture measured 3 hours after a heavy rainfall as the reference value, and trigger watering every evening when the soil moisture level is less than half the reference value.

This kind of heuristic can be coded with our API, but it can also be simply implemented with automation in a system like Home Assistant: use an absolute time as trigger (the watering time, preferably in the evening or very early in the morning), and add the soil moisture value test as an additional condition.

We'll be doing some tests along these lines in the coming weeks - as long as there's still a need to water, otherwise it'll be next year - and let you know what happens...




1 - univ. helsinki pedro Friday,august 16,2024 20H19

Hi. I have a couple of comments on this very interesting setup. The difference between the readings from the two soil sensors is not necessarily a difference between the sensors. The soil volumetric water content can vary a lot in a short distance, depending on the local texture of the soil and its compaction. This does not affect your conclusions about tracking changes in the reported soil water content, but in my experience Delta-T sensors are reliable and readings from them are usually close to the true water content, and would expect readings from both sensors to be comparable if located in soil of identical properties. Another point to keep in mind is that the concepts of relative humidity used for air and volumetric water content used for the soil are very different. Air RH is relative to saturation at a given temperature, while volumetric water content, is independent of temperature, simply cubic meters of water per cubic meter of soil. Consequently, when expressed as a percentage soil volumetric water content can never even approach 100%, because water can ony occupy the air spaces in the soil. I think one point worthwhile highlighting is that as the analogue to digital conversion is done in the sensors, the quality of the readings with the Yocto SDI-12 module is not different to those done using a much more expensive datalogger or high-end weather station with the same sensors.

2 - mvuilleu (Yocto-Team)Monday,august 19,2024 7H45

@pedro Thank you for your expert feedback. The only reason for which I was suspecting a sensor setting to explain the difference was that there is a setting for the type of soil on the WET150, but there was no equivalent setting on the TDR-315N...

Yoctopuce, get your stuff connected.