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.

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

The Arduino Power function was not usable for moisture levels between 100% and 50% with above formula.
The solution is a workaround using below program line, which has the same result as above equation, but with much better output granularity:
moisture_pct = pow(float(Rsense2/31.65),float (1/-1.695))*400;

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

 
 
This series of postings describes how to make sensors and a sensor reader to measure soil moisture and help manage irrigation of a vineyard. Here is the second posting of the Vinduino project, describing how to make and Install gypsum soil moisture sensors.

A gypsum block sensor is a very simple and low cost device. Basically it consists of two electrically separated electrodes cast in a block of gypsum (Plaster of Paris). You can buy them on-line or make them yourself using the guidelines below. Because of their low cost, you can install many as you like in the vineyard.

The electrical resistance between the electrodes is a measure of soil moisture level, or better: the soil water potential. The gypsum acts as a buffer for saline solutions making the measured electrical resistance of the sensor less responsive to salt in the soil.
Picture
Our home made gypsum sensor shows a resistance (blue line, the vertical axis is resistance in Ohms) from a few hundred Ω for saturated soils, to up to 80 kΩ for bone dry soil. Horizontal axis shows 15 minute measurement increments, when the sensor is drying in air.

Gypsum sensor have some less ideal properties, listed here for completeness:

- Limited life, the gypsum decomposes and the sensor last only a few seasons
- Hysteresis, the sensor quickly responds to a moisture increase, but is slow to reach equilibrium with the surrounding soil under drying conditions
- Temperature dependency. The resistance varies over temperature, however this effect is not as strong as resistance variation over soil moisture.
- Resistance can only be measured using AC voltage. There have been efforts to measure DC resistance with multi-meters, but this fails because DC current causes electrochemical effects in the sensor. The description of a simple to build sensor reader will follow in a later posting.


The pictures below show the simple setup: use stainless steel machine screws (use #6-32 x 2") to prevent iron oxide penetrating the gypsum. Adding a piece of plastic window screen mesh helps improve the structural integrity of the sensor, extending its useful life. The electrodes are fixed before pouring the Plaster of Paris by plastic spreaders. The dimensions of the sensor are not critical, 1” diameter cylindrical by 2” length, but using our example dimensions will help get comparable resistance results. Isolate the terminals with liquid tape of something alike to avoid an electical path outside the sensor after connection of wires to the sensor terminals.
Picture







Quick coarse calibration can  be done by soaking the sensor in distilled water, and let it air dry while measuring the sensor weight with an accurate scale and noting the resistance values over time.
In practice, soil moisture is good when measuring below 1 kΩ. Values well above 1 kΩ tell you it’s time to open the drip irrigation valves.

Picture
Installation of the sensors is straightforward. Watermark - a brand of professional sensors- recommends measurements at different depths, depending of the type of crop and their typical root depths. Because of the auger length we had available, we only installed our sensors in pairs at 30” depth. The sensors need to be soaked in water before installation. To ensure good ground contact, have some “mud” tightly surround the sensor. Measurements can start 2 weeks after installation.


The deeper the sensors are installed, the longer the response time after irrigation start. At 30" depth, there is no measurable response after one full night of irrigation. Therefore we now measure once a week.

Wildlife destroyed our electric sensor cables within one week (!!) after installation. We now have PVC tubes to protect the wires. So far that seems effective.

For an overview of all Vinduino project related postings click here

 
 
Picture
In Southern California we need irrigation to get good yield from our grape vines, or even to protect them from withering away. In some parts of our vineyard the vines thrive, and grow vigorously. In some other spots, mainly the back side of the hill, the vines stay behind and sometimes even struggle.

Last year we used a calculation method, based on evapotranspiration data from our local weather station, to estimate the weekly water requirement per vine. However, that method did not address the differences we observed in vine development per location. 

We came up with a new approach to keeping track of our irrigation this vintage. We installed gypsum soil moisture sensors at the trouble spots, and also installed sensors at a "good" spot, sensor location 1, as a reference.
We started weekly measurements in May, and now in July, see clear indications that the soil moisture is decreasing, so we need to step up the irrigation. Meanwhile, having better visibility on irrigation water quantity needed, the vineyard looks much better than same time last year.

Picture
To measure the electrical resistance - an indication of soil moisture level- of a gypsum sensor reliably, you need a special device that measures the resistance of the sensor with an AC voltage. Using a standard multi-meter does not work, as this device uses a DC voltage and electrochemical effects in the sensor will interfere with the moisture related resistance.  Having a background in electronics engineering, the idea came up to build a sensor reader ourselves. This how the Vinduino project got started. In next blog posts there will be a more detailed descriptions of how to make gypsum sensors and the gypsum sensor reader

For an overview of all Vinduino project related postings click here