Picture
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.

Picture
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
  delay(1000);
}

 
 
Picture
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:
  Serial.begin(9600);

  // 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);
}



 
 
Picture
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!

 
 
Picture
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.

Picture
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
.
Picture
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.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
Picture
Merry Christmas! The new version of the Vinduino code for the Arduino open source micro controller board is now available for free download.

Improvements include:
  • moisture percentage indication 1% - 100%
  • sensor calibration equation
  • wider sensor resistance range
  • Support for the "Ohm" character

Download 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.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 
 
Picture
The Arduino micro controller board used in our Vinduino project measures the electrical AC resistance of gypsum soil moisture sensors. As we are interested in the actual soil moisture in our vineyard, we wanted the Vinduino reader to display soil moisture as well as sensor resistance. First step to get there is calibration of the sensors to find the relation between resistance and moisture level.
The calibration method described here is a simplified version of the gravimetric calibration method described on-line by the Arizona university. We assume that there is equilibrium between soil- and sensor moisture.

We measured the weight and electrical resistance of 6 sensors, starting with sensors that were fully soaked and saturated with water, and keep repeating the measurements until the sensors were completely dry. The weight difference between fully saturated and completely dry sensors was used as calibration point for 100% and 0% moisture respectively. The idea behind this is that the soil sensor would reach moisture equilibrium with the surrounding soil, and moisture in the sensor is assumed to be the same as the surrounding soil moisture level.

The measurement results are shown in below scatter chart. Note that the vertical scale (resistance) is logarithmic.
The trend line (continuous line) was used to convert measured electrical resistance into moisture level  percentage. For sensor 3 and sensor 6 we found that trapped air from casting the gypsum was the probable cause for measurement differences between 40-15% moisture. Apart from that, all 6 measured sensors followed the same moisture/resistance curve pretty close. We have not made measurements at different temperatures to check temperature dependency.

Conversion equations (Excel) found for this particular type of sensor are:
Resistance=331.55*POWER(Moisture,-1.695)
Moisture=POWER((Resistance/331.55),(1/-1.695))

Please refer to the Vinduino code for implementation of the conversion equation.

Measurement data tables (Excel file) can be downloaded from this link. Sensor Calibration

For an overview of all Vinduino project related postings click here


Picture

 
 
Picture
With the wine in the tanks and vineyard work winding down, this is a good moment to share the programming part of the Vinduino soil moisture sensor. For a description of the hardware and how to make a gypsum block soil moisture sensor, please refer to the previous "Vinduino" postings.

The program below can be used for a very basic version without LCD display, or for a version with LCD display as shown in the picture.
To use below code without display, you can remove the programming lines starting with "lcd.set" and " lcd.print". Also the library code "LiquidCrystal.h" is not needed.

Programming the Arduino board is easy. Download the latest software code version here and upload the code to the Arduino board.

For an overview of all Vinduino project related postings click here

 
 
At the time of writing this blog article, nearly half of the continental United States is in severe or worse drought. Under these conditions, good management of our water resources is becoming increasingly important.

The Vinduino project's goal is to provide an accessible measurement tool for irrigation management. While 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. Although this is a "technical" project, we have tried to keep it low cost, accessible, and easy to build.

In the previous blog, we explained how to make and calibrate the gypsum soil moisture sensors, using stainless machine screws as electrodes, cast in Plaster of Paris. Now follows a description of the basic reader, using a low cost Arduino micro controller board, and a few widely available electrical components. This board can be obtained for less than $25 via Amazon.com, or you can find it at your local Radio Shack. You do not need a mains power adapter, the board gets it's juice from your PC USB port and it comes with a USB cable.
Picture
Arduino Board
To accurately measure gypsum sensor resistance, we need an Arduino Uno board, connected to a PC with a USB cable, and a few electrical components. Per sensor, we need 2 diodes (1N4148) and 2 resistors of 1500Ω (update: for better accuracy, use 4700 Ohm resistors, see blog post 9/25/2014). One Arduino board can support up to 3 sensors.

The wiring is detailed in the layout drawing left. For more sensors, you just duplicate this circuit.



How does the sensor interface work?
From Kirchoff’s Law we know that voltage measured over two resistors connected in series, divide according to their respective resistance values. In our sensor interface we have one known resistor (1500Ω), and one unknown resistor value (this is our gypsum sensor)

By measuring the voltages over the known and the unknown resistor, using the analog inputs of the Arduino board, we can calculate the sensor resistance value.

To avoid electrochemical effects interfering with the soil moisture measurement, we only apply voltage to the sensor for a very short time, and we use alternating electric polarities while taking the sensor measurement. Here's where the two diodes come in. They block current coming from one direction, and conduct current coming from the other direction. By alternating the Arduino output pins pin 6 and 7 (see drawing: red or blue current path), we can make current flow in two directions through the sensor, depending on which micro-controller output pin is programmed to be active. The diodes cause some voltage loss when conducting, and we measure the voltage directly after the diodes (Analog pin A0 and A1) to compensate for that and get accurate measurement results.

The measurement results will appear on your PC screen, and you can copy and paste the data to make nice graphs in Excel.

In a next blog, we will describe the Vinduino software program for the Arduino board. You don't need to become a programmer, we did all the work for you. The board can be programmed by uploading it from your PC to the Arduino. The programming file will become available for download from this site.

Meanwhile, you may want to get yourself familiar with the Arduino board, and the available PC software, on the  Arduino home page.

For an overview of all Vinduino project related postings click here