13
\$\begingroup\$

Background

To kick-start my longstanding ambition of getting back into electronics, I decided to try and make a device that measures the soil moisture of potted plants to determine whether they need to be watered. The aim for the first incarnation is to have a led that shows the plant's current water level (add water is red!), but of course I have wild plans for self-watering plants down the road.

My first stab was based on the Garduino instructable, specifically this circuit here:

enter image description here

It is a simple voltage divider using a known resistor and two copper wire electrodes stuck in the soil as measuring device. The voltage measured at A0 using the ADC on my Teensy++ is proportional to the ratio of the resistances, and I can work back to the actual soil resistance.

However, in practice the soil resistance turned out to be subject to a very large drift. Almost immediately after turning on the device, the measured soil resistance started dropping. (This also happens if you stick a multimeter in the plant.) After a few days of measurement, I could find no usable connection between the measurements and the moisture level. Removing the probe and inspecting it revealed considerable tarnish on the anode. To me, this indicates that some sort of chemical reaction is taking place (electrolysis?). A multimeter measures a voltage differential of a few tens of millivolts: I have turned my plant into a battery!

Oxidized anode

To avoid this problem I moved to a probe constructed out of stainless steel screws. As they are considerably less reactive than copper, the oxidation should be less of a problem. Also, to avoid "charging" the soil, i have put the voltage divider between two digital output pins of the Teensy. The measurement happens as follows:

  • Both pins are kept low when no measurement is taking place.
  • I drive one pin high. I wait one millisecond and I measure the voltage at the center of the divider.
  • I invert the pin voltages (high<->low), wait one millisecond and measure again. I should now measure the complement of the first measurement.
  • Both pins are brought low again and the device sleeps until the next measurement.

This does reduce the oxidation problem, but the measured soil resistance still seems to start dropping as soon as I start measuring.

Question

  1. Can anyone recommend a robust method to measure soil moisture?
  2. Can anyone explain what is really going on here?
\$\endgroup\$
0

7 Answers 7

1
\$\begingroup\$

Brainstorming:

I've been reading about capacitive sensing recently. Capacitive-touch sensors have the great advantage that they can be completely hermetically sealed behind a thin layer of plastic, so there is no exposed metal to corrode. ("Electronics and Robotics: Sensing touch through a thick surface?")

Because you can't get DC current to flow through the plastic, such sensors must use AC, as Leon Heller suggested.

Alas, most of the discussion I've seen has been about how to respond only to intelligent finger-presses; what little discussion there is about water an moisture is about how to reduce the sensitivity of capacitive sensors to water splashes. ("Sparkfun forums: Capacitive sensors and waterproofing"). So clearly they are sensitive to water, so perhaps you could use this "flaw" and turn it into a feature.

\$\endgroup\$
2
  • \$\begingroup\$ Yes, this would certainly work and it is my current line of inquiry. The main trouble I'm having is designing the probe such that is has a capacitance swing that is large enough to measure. This is my main source of inspiration: mechanical.poly.edu/faculty/vkapila/ME3484/Readings/… \$\endgroup\$
    – drxzcl
    Feb 7, 2011 at 20:06
  • \$\begingroup\$ I'm making good progress with a capacitive sensor. The main challenge is making sure the moisture does not come into direct contact with the electrodes, as that turns it into a resistive load. But I think i have the electronics part of it worked out. \$\endgroup\$
    – drxzcl
    Feb 28, 2011 at 9:26
6
\$\begingroup\$

You should be using AC, to avoid polarisation of the electrodes, with a Wenner bridge arrangement.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Could you please elaborate a bit more on the concept of a Wenner bridge? A search yields mostly journal papers, and I do not have access to those without physically going to the university library. The titles (salinity measurements etc) seem promising! \$\endgroup\$
    – drxzcl
    Jan 27, 2011 at 8:25
  • \$\begingroup\$ corrosion-doctors.org/Corrosion-Kinetics/Ohmic-drop-soil.htm \$\endgroup\$
    – Mark
    Jan 28, 2011 at 16:20
3
\$\begingroup\$

The only robust method for measuring soil moisture that I am aware of is using these probes.

\$\endgroup\$
3
  • \$\begingroup\$ Very interesting! I had heard of probes measuring the dielectric constant by basically building a capacitor, but I had seen any for sale. Since it's a hobby project I prefer "build" to "buy", but i do prefer "buy" to "nothing" ;) \$\endgroup\$
    – drxzcl
    Jan 28, 2011 at 13:40
  • \$\begingroup\$ On that note, "Because our probe measures the dielectric constant of the soil using transmission line techniques, it is insensitive to water salinity, and will not corrode over time as does conductivity based probes." - it sounds like exactly the technology i need. \$\endgroup\$
    – drxzcl
    Jan 28, 2011 at 13:41
  • \$\begingroup\$ I'm trying to figure out exactly how the probes in the shared link work. Are they using TDR or TDT? Or is it just capacitance? What would a basic setup include to replicate their functionality? \$\endgroup\$
    – Davido
    Sep 25, 2014 at 3:39
2
\$\begingroup\$

Here's how botanicalls does it.

\$\endgroup\$
4
  • \$\begingroup\$ Am I correct in assuming the 9, 10 and 12 pins are used for other things? They don't seem to affect the sensor circuit. \$\endgroup\$
    – drxzcl
    Jan 26, 2011 at 21:24
  • \$\begingroup\$ Yes, it looks like 9 & 10 are just controlling LEDs and 12 is a switch \$\endgroup\$ Jan 26, 2011 at 21:38
  • 1
    \$\begingroup\$ Let's see if i get this. I would drive 8 high, establishing a (small) current through the probe. This current is amplified by the BJT and I would measure the voltage drop of this current over a known resistor of 100 Ohm. What would this buy me over the voltage divider design? \$\endgroup\$
    – drxzcl
    Jan 27, 2011 at 1:05
  • \$\begingroup\$ Thanks for pointing me to Botanicalls! I have examined their schematics and code and I have made some interesting discoveries, aside the difference in measuring circuits above. They use galvanized steel electrodes that are only energized during measurement (no delay at all, not even a ms) and they still have problems with degradation due to electrolysis. They also keep a moving average of the moisture sensor readings, by default 10 samples over 2 minutes. I'll experiment a bit and report back. \$\endgroup\$
    – drxzcl
    Jan 28, 2011 at 9:22
2
\$\begingroup\$

I've constructed a soil humidity sensor using two galvanized nails set in a cylinder of Plaster of Paris. I didn't test it over a long enough period of time to draw any conclusions as you have, but you might experiment with that design.

The plaster neutralizes any acid in the moisture, thus isolating humidity content as a variable (but also works as a kind of low-pass filter!) + the galvanization on the nails helps to prevent them from oxidizing.

Please post if you find a good solution.

\$\endgroup\$
1
  • \$\begingroup\$ Now that you have had some time with these sensors do you know any more about their durability? I am particularly concerned about galvanic corrosion.... \$\endgroup\$ Dec 24, 2015 at 16:11
1
\$\begingroup\$

You might try using the Irrometer Watermark sensors. I'm using them now to measure soil moisture. If you're interested, I can try and dig up the schematic.

\$\endgroup\$
1
  • \$\begingroup\$ I've looked at the website and I've noticed they have both capacitative sensors and resistive sensors embedded in gypsum. Which are you using? Are they any good? \$\endgroup\$
    – drxzcl
    Feb 1, 2011 at 13:45
0
\$\begingroup\$

I'd recommend the Watermark sensors. They're durable and quite easy to read. You need two digital outputs plus one input per sensor.

Connect each meter to your outputs, in series with a 10k resistor. When you want to measure, set one output High and the other Low. Measure the voltage across the sensor. http://www.irrometer.com/pdf/supportmaterial/sensors/voltage-WM-chart.pdf has a chart for rough calibration; you'll need to establish a "completely wet" baseline. Because you're supposed to thoroughly wet the soil when you bury the sensor, you'd do this anyway in order to make sure the thing is working correctly.

You use two outputs because you should switch polarity in order to avoid corrosion.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.