If you want to save water, talk to a farmer. California farmers, including us, target voluntarily to reduce agricultural water consumption by 25%. This reduction (25% of 42 million acre feet/year) is more than the annual urban water use (8 million acre feet/year), and is much more effective than any residential water reduction measure. 

Last year The Hackaday Prize began a movement. 
This year the Hackaday community of technology enthusiasts is solving serious issues, like pollution, food, water, and energy.

We have entered the contest with our Vinduino project to reduce agricultural irrigation water use. Hope you like it and will give  your vote on Hackaday (actually, Hackaday uses skulls :-)).

Saving water is more important than ever, and for that reason the Vinduino soil moisture measurement project is made more easy and affordable to build!
You can use low cost DIY gypsum sensors, but now also commercial Watermark sensors can be supported

All the programming and documentation is available for free under the GNU
General Public License 3.0, and can be downloaded from: https://github.com/ReiniervdL/Vinduino

Printed circuit boards are also available
for ordering at cost price:
For the handheld soil moisture meter (Vinduino-H): https://oshpark.com/shared_projects/QWzdU5S6
For the 3-sensor connectivity platform (Vinduino-R): https://oshpark.com/shared_projects/EroKVTqF

Please feel free to share questions, contributions, suggestions, and results with us.
This will help continuing development, and more irrigation water saving!

A reader asked about the sensor condition after one year.
Very timely, I had been wondering about the same. So I dug one up to check. This one still looks pretty good after one year of operation at one foot (30 cm) depth. Only minimal loss of gypsum at the outer layer. Part of the mesh has come loose, but that has no major effect on the sensor performance.

I monitored resistance before, during, and after removal from the soil (see graph). When removed, it starts to dry out quickly and resistance shoots up. I put it back in the soil and watered to field capacity. The sensor's response and reading appear correct.
Should be good for at least another season.

Continuing live measurement results can be found at this link:

For automated irrigation, it is useful to have feedback that shows that the system is working as expected. Flow meters -like magflow- are the standard tools of the trade here.
An alternative solution is to measure the pressure drop when irrigation valves are opened. When calibrated with the utility company water meter, this can give a good indication of irrigation times and irrigation water volume.

The following is a quick setup to accomplish this, but not intended for permanent use as the power consumption is such that a 6V lantern battery lasts only 6 days.
Three main components are needed: an Arduino Uno board, an Adafruit data logger shield, and a 200 PSI pressure transducer (
Eyourlife Universal 200PSI Pressure Transducer Sender Solenoid for Oil Fuel Gas Air Water, $21 @ Amazon.com).
See for transducer also: http://www.vanderleevineyard.com/1/post/2015/03/vinduino-water-pressure-meter.html
The pressure transducer replaces the PSI gauge before the main valve of the irrigation system.

The programming code is available at Github:

Below graph shows the data that was recorded and written on an SD card in the datalogger over a period of 6 days. It shows two main irrigation events per day (block 1 and block 2), where pressure drops from 120 PSI to 30 PSI. The fluttering pressure during block 2 irrigation indicates that the landscaping sprinklers were set to start around the block 2 irrigation time.
This can cause incomplete watering of our lawn due to low pressure, so we'll adjust the sprinkler timer to start later.

Cost management and water use reduction have been the main reasons why we wanted to automate the irrigation of our vineyard.
So far, our vineyard irrigation was done manually. Labour intensive, and probably not the most efficient use of irrigation water.
In order to optimize water usage, it is better to irrigate more frequently using shorter times and avoid evaporation by scheduling at night.

Our irrigation system uses 2" pipes, and water pressure
at our water mains connection is around 120 PSI. We have 2 irrigation blocks of approximately 1500 vines, each vine is served with 2 drippers of 1 gallon/hr. To avoid excessive pressure drop, we irrigate only one block at a time @ 50 gallons/minute.

We found that the Hunter Sprinkler ICV201GDC ICV irrigation control valves are very suitable for our purpose. These valves come optionally with a DC latching solenoid (Hunter Sprinkler 458200 DC Latching Solenoid) that can be used in combination with a battery operated controller. That saves trench digging and running wires to operate the irrigation valves with a controller from the house.
Added bonus of the Hunter valve is the option of being controlled by a micro controller like the Arduino.

The latching solenoid can easily be controlled with an Arduino board and a low cost motor driver module. 
We purchased a driver module (L9110S DC Stepper Motor Driver Module H Bridge) on-line for less than $6.
The module needs 2 digital control lines (Arduino pin 13: latching on, and pin 12: latching off) per solenoid. The L9110S is a dual motor driver, so 2 valves can be controlled by one single module.
The solenoid needs 9V to operate, a small battery provides this to the motor driver module.
The solenoid requires only a 10 msec
-or longer- pulse to switch state, so the average consumed energy from the battery can be very low.
The motor driver board comes with an indicator LED that should be removed to avoid battery drain.

Here is a simple Arduino demo sketch:

  Turns on a Hunter DC latching solenoid on for one second, then off for one second, repeatedly.
  This example code is in the public domain.
int a = 13;
int b = 12;

void setup() {                
  // initialize the digital pin as an output.
  pinMode(a, OUTPUT);
  pinMode(b, OUTPUT);    

void loop() {
  digitalWrite(a, HIGH);   // turn the valve on (HIGH is the voltage level)
  delay(10);               // wait 10 milliseconds
  digitalWrite(a, LOW);    // end drive pulse by making the voltage LOW
   delay(1000);               // wait for a second
 digitalWrite(b, HIGH);   // turn the valve off (HIGH is the voltage level)
  delay(10);               // wait 10 milliseconds
  digitalWrite(b, LOW);    // end drive pulse by making the voltage LOW

Measuring water pressure in agricultural irrigation systems is standard practice. One application is checking for pressure drop when irrigation valves are opened, and thus give feedback that valves work correctly.
Pressure difference can also be used to measure the amount of water flowing, and help tune for even distribution of irrigation water.

Here's how to make a digital water pressure meter, based on the Arduino Pro Mini micro controller board, and the Vinduino PCB.
The used pressure sensor is a $20 device, available on-line. It has a stainless steel housing and comes complete with a watertight connection cable. There are several ranges available. We purchased the 200 PSI version, the same range as the analog meters installed in our vineyard.

This sensor gives an output voltage between 0.5V and 4.5V that scales linearly with the measured pressure, 50 psi per volt.

Hooking the sensor up to the Arduino board is easy. Only 3 wires are required: 5V supply (connect to Arduino Vcc pin), ground, and a sensor_out signal (connect to Arduino A0 analog in pin).

Here is example code to test the pressure sensor:

// "Vinduino" portable PSI sensor code V1.00
// Date March 7, 2015
// Reinier van der Lee
// www.vanderleevineyard.com

// include the library code only for LCD display version
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // initialize serial communications at 9600 bps:

  // set up the LCD's number of columns and rows:
  lcd.begin(8, 2);
  lcd.print ("Pressure");  

void loop() {

float sensorVoltage = analogRead(0);   // read the sensor voltage
int psi = ((sensorVoltage-95)/204)*50;
lcd.setCursor (0,1);
lcd.print (psi);
lcd.print (" PSI");
Serial.println (psi);

delay (1000);

Meet the next generation of Vinduino!
The prototype picture shows the main parts:

  • lowest cost Arduino board
  • 3 inputs for gypsum soil sensors
  • RTC board for timed measurement and battery saving system sleep/wake up
  • low cost APC220 RF module for miles of coverage with a suitable antenna
Future plans include: making a PCB available for easy reproduction, solar battery charging support, Arduino code improvements. Stay tuned for further updates!

In cases where soil is extremely dry or wet, the Vinduino measurement becomes less accurate. This is due to the Arduino 10-bit ADC (voltage measurement) resolution, that will become an increasingly stronger factor in the extreme corners of the measurement range.

The graph on the left shows how the measurement accuracy changes with the sensor resistance value. A lower reference resistor value gives better accuracy in the lower sensor resistor range, and for better measurement accuracy at high sensor resistance a higher value reference resistor helps. 

The goal of Vinduino is to help with irrigation management, so we are not really interested in high accuracy when the soil is totally soaked or bone dry, beyond the point of permanent plant wilting. We need best accuracy at the target soil moisture level. With this data in mind, my choice is for using 4700 Ohm, as this gives good accuracy in the most common soil moisture range.  With the described sensor design, 100% moisture gives a sensor value around 300 Ohm, at 50% soil moisture the sensor reads 1 kilo Ohm. Refer to the Vinduino sensor calibration blog post for more details.

Whatever resistance value you choose for the R1 and R2 resistors connected to the sensor, should be declared in the software code. So for using 4k7 Ohm resistors (4700 Ohm), the Arduino code should be changed to:
const long knownResistor = 4700;  // Constant value of known resistor in Ohms
For ultimate accuracy, as resistors usually come with a tolerance of 5% or 1%, you can measure the real resistance with a multimeter and enter that as known resistor value.

Checking the accuracy based on ADC resolution for a reference resistor of 4700 Ohm, shows better than 3% measurement accuracy for soil moisture between 80%-20%, and 1% accuracy for the lowest moisture level (where irrigation should switch on). This should be good enough for our purpose.

I received many questions about the details of the gypsum soil moisture sensor, so here is a picture overview of the casting step details. Please make sure to use stainless steel machine screws only, the galvanized types oxidize rendering the sensor useless.
The mould I used is a 3/4" PVC pipe coupler. Sand down the inside to make it smooth, helping to release the cast when hardened. Use tape to keep the gypsum from leaking out. The saw cut allows for prying the mould open with a screw driver, you should be able to push out the cast easily.

After connecting the wires, isolate the external electrodes and connections with liquid tape to make sure that the there is no external parallel electrical path
And here is another way of making a gypsum sensor. Check out below link for more details: http://unpuntilloalambre.blogspot.com.es/2014/01/gypsum-block-for-soil-moisture-sensor.html

The Vinduino project goal is to provide an accessible measurement tool for smart irrigation management. Although the Vinduino soil moisture measurement project was originally developed for saving the irrigation cost of our vineyard, it can equally well be used for other agricultural applications, a school science project, or even to reduce the water consumption of sprinklers in your own backyard. While this is a "technical" project, we have tried to keep it low cost, accessible, and easy to reproduce.

The updated version 3.0 of the Vinduino code for the Arduino open source micro controller board is now available for free download, thanks to contributions from Theodore H. Kaskalis. Technology Management Department, University of Macedonia, Greece.
Theodore co-authored a paper about smart digital farming: An Embedded System for Smart Vineyard Agriculture

Vinduino 3.0 improvements include:
  • streamlined and corrected code
  • sensor calibration equation
  • median noise filter instead of averaging filter

Download the Vinduino code here (5kb) ("save link as")

For an overview of all Vinduino project related postings click here

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.