-
Notifications
You must be signed in to change notification settings - Fork 0
Applications
The Hydrosys4 system is primary designed for irrigation and environment control.
The irrigation functions are implemented to use the water as efficiently as possible, with a mix of functions that can precisely time the irrigation according to schedule, weather and Sensors, moreover the system can support dozens of lines to provide the right granularity for different scenarios.
The Software provides several irrigation functions:
- Scheduled irrigation,
- Automatic irrigation based on soil moisture measurement
- Mix of the scheduled and automatic.
- Irrigation conditional to Weather forecast to reduce the irrigation time when precipitations are expected.
The above methods can coexist to maximize the irrigation efficiency.
All the configurations can be set using the Software web interface. The Configurations are described in details in the next chapters.
Starting with the scheduler, there is a dedicated menu on the menu bar “WateringPlan”:

in the page is possible to select for each actuator (valve/pump) and for each month the following parameters:
- the watering schema, these are the weekly watering plans, can be configured by clicking the “Schema setup” button.
- the multiplier of the watering time (Graphically indicated with drops) which multiply to the irrigation time defined in the watering schema.
- the pump/valve activation delay (to avoid all the actuators to start simultaneously) respect to the time set in the watering schema.

As in the above picture, it is possible to give each actuator a specific name to easily remember its watering area (the names can be changed in the “setting” page clicking the “edit names” button).
By clicking the “schema setup” button it is possible to customize the watering schema.

As in the above screenshot, for each day of the week, it is possible to setup 5 actuator activation, with time of the day and duration (seconds).
The specific activation can be made conditional to the sensor reading which can be selected in “wateringplan” page clicking the “select Sensors” button .
The Schema name can be changed clicking the button “Schema Name” in the “wateringplan” menu.
For the Automatic irrigation, there is a dedicated menu on the menu bar “AutoWaterng”, according to the Soil moisture sensor feedback, the system will automatically activate the associated valve/pump. Some security rules are included to limit the automatic activation in case anomalies are detected in the sensor reading.

The system supports both analog and digital Soil moisture sensors (according to the description in the hardware page of this site).
I have designed a digital soil moisture sensor specifically for the Raspberry PI which can be found Here: https://www.tindie.com/products/20112/
The analog sensors can be connected to the raspberry using an Analog to Digital converter (ADC – MCP3008). More details about connections of the ADC to the raspberry are described in the “hardware” page of this site. https://hydrosysblog.wordpress.com/hardware/.
As alternative you can also have a look at the Automation/irrigation Hat board in the following link: https://www.tindie.com/stores/angelova/
Moisture sensors can be either resistive or capacitive, as for my experience resistive sensors reading is affected by the temperature more than the capacities sensors and can be prone to corrosion.
On the other side, with right probes made of stainless-steel and right electronics, the resistive sensors are more durable and more sensitive in certain ranges of humidity. Clearly I’m not speaking about the unfortunately popular resistive sensors with probes printed on circuit boards, which I really suggest to avoid.
In the below picture an example of the automation/irrigation HAT board connected to an analog capacitive sensor and a 8xRelat board.

Before configuring the watering automation function, it is necessary to perform the following operations:
- Calibrate the sensors
- Set the correct direction to the sensor values, meaning higher value more wet, lower values dryer.
To perform the two operations above, connect the sensor to the analog inputs, or to the right pin if it is digital type. In case of digital sensor, follow the instructions to set the sensor in the HardwareSetting table as described in the sensor description.
NOTE: If the sensor appear in the setting page but not in the “autowatering” page, it is necessary to go to the HardwareSetting page, edit the hardware table and in the row relevant to the sensor, set the “usedfor” field to “watercontrol”.
Now go to “setting” page and click the button “Sensor Calibration”.

Before proceeding, ensure that all calibration parameters in the relevant row (min,max,scale,offset) are empty and the “direction” field is set to “dir”.
Now you have to read the sensor value, go to “settings” page and in the sensor section, identify the row corresponding to your sensor and click “read” button.

The system will read and display the sensor value about every 3 seconds.

Then make two type of reading, first read the sensor value when the sensor probe is not inserted in any medium (except the Air) and second read the sensor value when its probe is in the water.
Back in the input calibration page, Input the two values in Min and Max field (setting” page and click the button “Sensor Calibration”), in the scale field put 100, and in the direction field, put “dir” if the reading in in the water is higher than the reading when dry, or “inv” in the opposite case.
The sensor values will now range from Zero (Air) to 100 (water).
Now let’s set the automation, below a screenshot of the “Autowatering” page:

Working Mode: Select which mode of working the system should execute:
- Full Auto: system activates the watering based on the moisture reading
- Under Min over Max: The watering schedule set in the WateringPlan is still used, If sensor reading is lower that the MIN threshold irrigation will be automatically activated. If the sensor reading is above MAX threshold the scheduled watering will be stopped.
- Emergency Activation: follow the scheduled watering as configured in the watering plan, additionally activate the watering in case the reading is lower than the set threshold
- Alert Only: Send email when the water is lower than min threshold
Reference Sensor: Associate the soil moisture sensor to the watering valve.
Thresholds: set Min and Max threshold. Min indicated the sensor value when the irrigation will be activated, Max is the value when the watering will stop.
Min watering period (seconds): When the sensor reading is below the Min threshold, the system activate the watering for the number of seconds specified in this filed, several watering activation periods can be actuated during a watering cycle.
Max number of watering periods: This number indicates how many watering periods are allowed to be activated in one cycle. Once the algorithm detects the value of the sensor is below MIN, it will start the watering for a number of seconds set in “Min Watering Period” then it waits a number of minutes set in “Pause between watering”, if the reading is below MAX, then it activates the watering again for a period set in “Min Watering Period”, the system will continue this cycle until the reading is above MAX or the irrigation is repeated for the number of times set in “Max number of watering periods“.
Pause between watering (minutes): The time to wait between watering activations as described in the above parameter.
Interval for Sensor data evaluation: To calculate the soil moisture value to be compared with MIN and MAX threshold, the system makes the average (min and max operations are also supported) of a number of sensor reading samples that it has stored in the past minutes. That number of minutes correspond to this parameter value.
Max Period between cycles (day): In case no irrigation activation is made in a number of days set in this field, if mode is set to “full auto” then the system automatically activate the relay for one “min watering period”. This is a safety feature in case something goes wrong with the sensor, it increases the probability for the plant to survive.
Example:
- Thresholds (volts): Min=48 , Max=54
- Min watering period (seconds): 60
- Max number of watering periods: 5
- Pause between watering (minutes): 90
When the sensor value goes below the Min threshold (48), the system activate the watering for one period of 60 seconds, then it waits for 90 minutes and check if the sensor is below the Max (54) threshold. In case the sensor reading is below the Max threshold then the watering is again activated for 60 seconds. The process repeat until there are maximum 5 activation (in worst case a total period of 5×60 second of water activation)
In case the sensor reading is still below the max threshold after all the activation, then a mail is sent as warning. (if the mail is set)
A watering Cycle is finished in case:
- The sensor reading is above the Max threshold
- The max number of water activations is reached and the sensor reading is above the min threshold
To check the system activity during a period of time, it is possible to go to “data” page.
In the data page there is a specific section dedicated to the monitoring of the automatic watering system: the “Auto water Control Chart“.
Below an actual soil moisture reading with automatic control activated.
When a sensor is associated to a relay in the “autowatering” page, the sensor line became solid and the color of the sensor line and the corresponding “dot” indicating relay activation become of the same color. In case the sensor is not associated, then the sensor line is dotted. In this way it is easier to read the events and the corresponding sensor values (as in below picture).

You can see the solid line is the moisture sensor and the dots (square,cross etc.) are the moment of irrigation activation. The same colors indicates that the irrigation is associated to the sensor.
As expected when the irrigation is activated the moisture sensor reading value goes up.
Below some more examples with longer time period.

Below another example which highlights the resistive sensor sensitivity to temperature, the reading oscillations have daily frequency and are due to the daily temperature changes. In this particular case it was a small vase exposed to the south, the temperature of the soil was changing quite significantly between day and night. Still the system is able to maintain the plant in that vase in good health.

Irrigation duration according to the Weather Forecast :
Starting from the SW release 3.20b , it is now possible to query weather forecast from weather web service provider and automatically adjust the irrigation duration according to the weather forecast.
The setting can be found in the “weatherAPI” menu.
Currently only one Weather provider is supported, anyway providing the right configuration file, the SW can support several different providers.
As said this feature depends on weather providers, in case they change interface or they restrict the use of the data, then the feature will stop working.
The weather provider I have chosen gives free access to the data with a limited amount of query per month, which is more than sufficient to run the feature.
Now let’s go to the configuration interface.
First thing to do is to select a preset API configuration, you can scroll down and go to the section “Select Preset API config” where you can select the weather provider.

Once the you click the button, the Interface will appear like this:

First thing to do is to go the link in the “API provider” section, have a look at the data plan, register and get the “Key” which is necessary to query the forecast data.
Once you have the Key, you need to fill in the Key and Location fields (in this case 4 times each), for the location normally you can make a string with the name of the city, then the region and then the country.
Once all the fields Key and location are ok, click the red button “Save Config”.

Now it is time to test if the connection with the weather service works, Click the green button “Query the provider API”. If things are ok, you should see the gray fields filled with info, as for the example below:

The Parameter 1,2,3 are filled with values 0.4 – 5.7 – 0.0.
It is also important to check if the location from the query matches with the provided location, as in this example:

In white the provided string and in grey the result of the query.
We are now sure that the query works! we are half way…
In the page, there is a section called Rain multiplier:

Weight 1, 2 , 3 are the numbers that will be multiplied to the Parameter 1 , 2, 3 above. In this specific case the Weight 1 multiply with the forecast of rain precipitation (mm) of the current day, Weight 2 multiply with the forecast of rain precipitation (mm) of the next day, Weight 3 multiply with the forecast of rain precipitation (mm) of the next 2 days.
The higher the weight the more influence will have the parameter over the irrigation duration.
The Formula of the value that will be multiplied to the Irrigation duration is in this case:
Value=100 + Weight1 x RainForecast (0 day) + Weight2 x RainForecast (+1 day) + Weight2 x RainForecast (+2 days)
You can adjust the parameters according to your needs, anyway If you are not so good in math, just leave the default values.
It is possible to check the above value by clicking on the button “Test Query and Rain multiplier calculation”, below an example of the result:

So in case the irrigation starts now the duration of the irrigation will be about 84% of the total.
Next step is to select the irrigation lines that will be regulated by this multiplier, here the interface:

Now click “save” and then click “Apply Setting and generate counter”

The last button will generate a counter which can be displayed in the data graph and will represent the percentage of the irrigation duration that will be actually activated by the system for the selected irrigation lines.
This counter is called “RainMultiplier” Below a picture of the graph with the counter in the last few days:

The graph will be very useful to fine tune the weights according to your needs.
As the main purpose of the system is to keep the cost down, a common 12vdc 1/2 inch solenoid valve is used, this can be found on internet for as little as 5 eur each. For the connection I have used plastic pipe which can be found in any hydraulic shop.

The assembly was even easier than expected, below a picture:

By setting the delay, the solenoid valve can be programmed to open in different times this can help to keep the right pressure in the system.
Below a picture of the finished work, 2 lines can be controlled to irrigate my terrace plants.

Testing time of the complete system, below the video of activation of water line 1 for 20 seconds.