Example irrigation logic

Maarten Hemker
Maarten Hemker Administrator
October 2022 aangepast in Logica
This logic contains 3 separate parts, that can also be used individually.



Part 1) A time counter for visualization purposes
The first part counts the time a component has been active, which is reset every day. The time trigger is set from 23:59 to 00:00, so it will give a reset pulse every day around midnight. The irrigation time component (which is a 4bit numeric value) can be added as a statistic, allowing a graph of how long the irrigation has been active each day.

Part 2) Calculating a set time, based on a percentage value
The second part creates a timer (4bit numeric value) based on the measured ground humidity. To do this, we first invert the percentage so a high measured humidity of say 70% results in the value 30, and a low humidity of say 5% results in the value 95. This is easily done by the math function "a - b" where a = 100 and b = humidity.

Then, the curve alteration is used to map the scale from 0 - 100 to relevant irrigation times in seconds. When the humidity is 70% or higher (value "30"), we will not irrigate, and when the humidity is extremely low (value "100") we will irrigate a maximum of 30 minutes (1800 seconds).



Part 3) Actually controlling the irrigation
In the last part, we will actually control the irrigation. With a time trigger, we will trigger half an hour before sunrise and end it always at sunrise itself. This way, the maximum irrigation time is always 30 minutes.

When the time trigger activates, the irrigation set time is used as a timer for the period of the irrigation. So if the calculated time from part 2 is set to say 900 seconds (15 minutes), the irrigation will run for that time.

To allow manual override, either to stop an active irrigation, or to activate an additional irrigation cycle, a switch is connected to a bit toggle. When the irrigation is currently active, a flick of the switch will turn it off. When the irrigation is currently stopped, a flick of the switch will activate the irrigation timer for the irrigation set time. To make sure this works, the light timer option "allow immediate off" is set to "yes".