I made U7 just a down counter that preloads to max count each time it gets a RESET. When the counter decrements to zero, it restarts at a count of 256. Why did I do this? Well, we measured the clock at U4D to determine how much water flows for a count of 256 pulses. It turns out that 1 litre is about 248 pulses of the transducer. So we kinda figured that a minimum flow into the wicking bed would be 256/248 litres…a bit over a litre.
U8 is preloaded with the correct amount of litres that we want to add to the bed. A count of 256 here means adding 256 litres. Something we don’t foresee happening. So the value will be much less than that.
The arduino turns the water on (U5B/8) and pre-loads U8 with a value we reckon will get the right amount of water into the soil. Then the counter decrements via the water flow sensing transducer. When it gets to a count of zero, pin 14 on U8 clears U5B and the solenoid turns the water off.
The 40103 is a pretty handy device and is pretty flexible.