Automated Irrigation Controller

Tool Concept
Stage: 
Functional Prototype


Primary problem statement:
I am a Grower and I want a tool to water my fields easily because watering tranplants quickly is important to for good establishment.
Read more about this problem statement

Description: 
Using a moisture sensor, an Arduino, and a valve we document how to create a simple, battery powered, irrigation controller. Further info (including code) can be found in our [GitHub project](https://github.com/foss-wales/farmhack-watering-system)
Documentation
Documentation Wiki: 
Farmhack Watering System

The watering system we created on the farmhack at the Organic Growers Gathering 2023. This doc is taken from the github project, please go there for further details, code etc.

Videos

Hardware Requirements

References

Valve

The [valve] is described like this:

As per header, the product itself is excellent, well-made and extremely reliable. However, it is handicapped by absolutely abysmal documentation, which could be very frustrating. I have a serious background in IoT and electronics, but I were almost on the verge of returning it, before figuring out how to make it work. Once I understood it - it is perfect.

  1. This is an indirect pilot operated asymmetrical valve. It means that it only operates in one direction (watch the arrow on the body showing the direction of slow of water. It also requires a minimum pressure differential of at least 1 bar (in my experience). The more water pressure is applied - the better it will work. It works perfectly with standard UK water mains and garden hoses, but not with micro irrigation systems (not enough pressure)
  2. If the intake water pressure is lost - the valve will automatically shut
  3. The thread is UK standard BSP 1/2 inch
  4. The box includes mesh water filter
  5. The valve is latching. It means that you only need to apply power to switch its state (open or close) and then it stays in this state indefinitely (as far as water flow continues) - so extremely power efficient
  6. Control voltage could be anything from 3.3 to 5 volts DC. In my experience 4-5 volts are 100% reliable, as the voltage drops, the operations become less reliable - the valve will sometimes misfire, but eventually will work.
  7. When switching, the valve draws a significant amount of current - 300-500mA depending on water pressure. It could be operated from a stack of conventional AA batteries, but NOT from GPIO of small IoT devices - you will need a relay.
  8. To switch state, all you need is to apply a a short (circa 30ms) DC pulse to the two wires. Applying positive to RED and negative to BLACK opens the valve, reversing the polarity closes the valve
  9. 30 ms pulse is sufficient, however you could apply a longer one - even a few seconds. The only caveat is that you do should not leave it on for prolonged periods of time (hours) - you will eventually damage (burn) solenoid.
  10. The valve is sensitive to orientation - it must be positioned with the main body parallel to earth an the top assembly vertical. Significant deviations from this angle will affect operations - the valve might not be able to open or close fully.
  11. The valve is very fast and extremely quiet. The click of switching could only be heard if you are standing right next to it and listening intently.

Motor Driver

The LH293d PDF drives the valve because the Arduino cannot provide enough current to switch it.

Setup

Install the Arduino IDE software.

Open the watering_system.ino file. Flash it onto the microcontroller.

Live Plot

  1. Attach your phone to the Arduino.
  2. Install and open USB Serial Telnet Server (binds a USB serial converter to a Telnet client)
  3. Using the terminal, connnect to the server. This uses ip 172.16.0.135 cd plot # we will work in the plot directory telnet 172.16.0.135 2323 >> data.txt &
  4. Create the virtual environment and install dependencies. virtualenv ENV python3 source ENV/bin/activate pip install -r requirements.txt
  5. Live-plot the chart. source ENV/bin/activate python chart.py

You should see the live plot: Example plot image

CHANGELOG

  • day-1: The watering system has one threshold: If the moisture is below the threshold, it switches the valve on. If the moisture is above, switch the valve off.
  • day-2: The watering system has two threaholds: One to switch the watering on, one to switch it off.

Related Work

up
0 users have voted.
up
0 users have voted.