Moisture sensor for an irrigation system? - Page 1
Forum section: electronics / projects

author: lesaid
author_rank: Contributor
timestamp: September 12, 2015, 03:22:52 pm
content: My wife has a large tub (half barrel) on a patio in which she has tried in vain over several years to grow something interesting. Nothing thrives - we both believe, because of our inability to keep the tub appropriately watered! So she has set me a challenge over the winter to devise a watering system that will keep her plants alive in spite of our manual irrigation technique!Several years ago, when a thirsty grape vine was being attempted, I had a go at this - and failed. Any suggestions as to a technique that is straightforward and likely to be reliable would be welcome.It is not possible to have a source of water above the tub - so the solution has to involve a small pump from a lower reservoir. There is no mains power easily available, so we are talking rechargeable battery, small solar panel and an electrically frugal design. (probably a very small panel float-charging a small lead-acid battery with a shunt regulator - that is what I had last time). Pump was a little fuel pump intended for a car. Temperature compensation was necessary also, as the hot summer sun was a vast contrast with a cool spring or autumn night, even though the sensor assembly was buried in the soil. But that wasn't the issue.The problem is the moisture sensor. Here is what I tried and failed with ....Resistive measuring between two carbon electrodes - using either very low voltages (under 100 mV) or AC to avoid electrolysis. The problem was that the ion content of the water changed too much - particularly as the plant absorbed nutrients (after which it would be flooded with water) or was fed (after which it was allowed to dry out).Capacitance monitoring, relying on the changing dielectric constant of the damp soil between two insulating electrodes close to each other. I couldn't make this work reliably - mostly because I think the soil didn't act as a dielectric, but as a resistor in series with two capacitors - and the effective dialectric was the insulation between each electrode and the conductive soil. It changed with moisture level, but was still very sensitive to the ion content of the water. There were also a lot of problems keeping noise from screwing up the measurements. (best results used an oscillator buried with and attached directly to the electrodes as the supposedly capacitive timing element and dumped the output into a capacitor. The current drawn was remotely monitored to control the pump).I had a try at creating an LC oscillator, which I hoped would respond only to the capacitance. However, I wasn't able to get a circuit to oscillate reliably - I'm guessing because I had at most, a few tens of pF effectively in parallel with a few hundred to a few thousand ohms of resistance. Perhaps this approach is possible but it doesn't seem easy, at least, for me.I toyed with the idea of looking at the soil dielectric constant by timing a signal bouncing down a buried transmission line with a short circuit at the end. But this was getting too esoteric, and I don't have the knowledge or skills to be attempting this at the short wavelengths that I'd need for a garden tub.I have read of methods solving this problem by burying a neutron source and monitoring the absorption between the source and a buried detector. But that is a bit out of my reach (and comfort zone!).I have also seen a DIY design in an electronics magazine for an NMR device that could possibly be made to work - but that feels rather ambitious, and far too power-hungry for a tiny solar panel!In a nutshell - any method influenced by the resistance of the soil is going to fail because of ion content variability. And I don't know a practical method of detecting dielectric changes in the damp soil that won't be polluted by changes in soil conductivity. I did wonder about sensing both resistance and capacitance, and combining the results to isolate the capacitance change, but this is getting much more finnicky and complex, and this is supposed to be a simple, easy and cheap solution!Apart from employing a gardener to keep the tub watered, anyone have any ideas? Or is a simple, reliable, DIY soil moisture sensor in ivory-tower land for an electronics hobbyist?

author: Seekonk
author_rank: Super Contributor
timestamp: September 12, 2015, 03:43:41 pm
content: Thinking about doing the same thing, lat time I took a trip the tomatoes about died. I would say skip trying to measure soil moisture. Just use a simple timer and adjust that with a rain gauge. Farmers have been using pan evaporation for more than a 100 years. A pan with a point contact and wave rejection could work. Anyway, this pan evaporation data of more than 100 years has indicated that we are into solar dimming from man made particles in the atmosphere and vapor trails. Turns out solar intensity controls evaporation more than temperature. So a small PV panel into a very low resistance to measure power would give you enough data to adjust your timer interval.

author: lesaid
author_rank: Contributor
timestamp: September 12, 2015, 07:17:50 pm
content: trouble is, there's a big difference in how much water the plants need from week to week - especially if we try another grape vine, or something else that fruits. If the solution requires regular checking and re-calibrating, it won't be much better than simply watering it by hand, and the thing will probably end up either parched or flooded! It isn't simply the rate of evaporation.We really need a 'set-up-and-forget' system that just works for the whole season, keeps just the right amount of moisture in the soil, is immune to temperature, plant feeding, thirsty plants fruiting and so on, and proximity of passers by. And if a badger comes by and starts digging up the tub, even better if it could spray some cold water at it! But perhaps that's asking a bit much!Oh - and it also needs to look discrete and not look like a whole lot of nerdy technology cluttering up a nice 'tidy' patio !!Tall order? But interesting electronics project perhaps!

author: nfmax
author_rank: Super Contributor
timestamp: September 12, 2015, 07:40:08 pm
content: QuoteVegetronix make soil moisture sensors that I believe use this TDR technique, which has a published track record, and is much simpler than measuring slow neutron flux! However, in your situation you might be able to measure the weight of the tub. Obviously an increase in weight could come from an addition of water or from plant growth, but a drop in weight probably indicates drying out of the soil (or something eating your tomatoes)

author: lesaid
author_rank: Contributor
timestamp: September 12, 2015, 08:25:29 pm
content: Thing is, can you imagine my wife's reaction if I were to balance a heavy half-barrel, possibly next year containing a plum tree, on top of a weighing machine on our patio? It's almost as bad as a friend's suggestion - to put a sensor on a leaf to detect when it starts to go limp!I thought about the transmission line approach but think I'd need to be up in the GHz range to get the wavelength shorter than the transmission line! And that is miles above my skills and experience.I did wonder about a transducer sending an ultrasonic chirp though the tub to a receiver on the other side. I feel sure than the moisture would influence the texture of the soil and the ultrasonic transmission characteristics, but I've seen nothing published about that and not had time to try it to see.I also read the other day about a sensor that apparently uses something like 100 MHz on an insulated electrode, inducing a signal in a second electrode via the electromagnetic field. This should be affected by the permittivity of the soil which should be highly dependent on the moisture content. I fear that the conductivity of the soil would also have an effect, but this also is something I haven't had a chance to try yet.

author: lesaid
author_rank: Contributor
timestamp: September 12, 2015, 11:10:27 pm
content: Quote from: evb149 on September 12, 2015, 08:47:59 pmThanks for the swift and comprehensive reply!I was attracted by the TDR idea, and perhaps I'm simply lacking confidence. But I have never designed or built anything to operate above a few tens of MHz, and for TDR (thanks to necessarily quite short transmission lines), I think we're talking GHz. I don't think I'd know where to start! Back when I first learned about electronics, VHF was pretty esoteric and UHF about the limit (for a hobbyist at any rate). For GHz work one was looking at waveguide rather than wire.Quote from: evb149 on September 12, 2015, 08:47:59 pmI can imagine that it would work. I just can't quite imagine how I'd implement it, nor operate it without constant recalibration as the plants grow.Quote from: evb149 on September 12, 2015, 08:47:59 pmYes indeed - for my first resistive experiments, my carbon electrodes were at opposite sides of the tub for that reason. My capacitive sensor was a length of bell wire - twin cable where the two conductors were linked with a very thin sliver of material, so most of the gap between the cables would have been soil rather than PVC or whatever. And that length of wire had to be quite long to get a reasonable capacitance to monitor. But I found large spacings meant more difficulty tracking changes against noise due to the lower capacitance.Quote from: evb149 on September 12, 2015, 08:47:59 pmThat was what I tried first - and it did work - but I found it easier to avoid noise and drift if all the sensitive electronics was shielded and buried under the soil (limiting temperature fluctuations as well), with only a DC measurement (current draw) being presented to the remote 'control unit' and pump switch. The variable oscillator approach turned out much simpler in the end.Quote from: evb149 on September 12, 2015, 08:47:59 pmYes - that is the big problem - all the others I can overcome. The variability turns out to be quite high. And I really want to avoid the need for frequent recalibration.Quote from: evb149 on September 12, 2015, 08:47:59 pmyes - that is something I think I'll need to implement with any of the ideas currently on the table - all will use too much power for 24x7 monitoring. I'd like to solve the other problems first though! Looking at the weather here, I worked out that the device should be designed to survive over two weeks of heavy cloud with minimal solar power, on battery only, without discharging a small (1-2 AH) lead acid battery more than (say) 50%, and be able to recharge fully in maybe a week of decent weather. That should give a manageable energy budget with a timer and a small panel.Quote from: evb149 on September 12, 2015, 08:47:59 pmI planned on doing something like that at first (using a Wi-Fi module), but changed my mind when I realised that I didn't want the system dependent on a computer running in the house. The only other reason for linking up would be instrumentation, and I can go out with a multimeter for that, given exposed test points.Quote from: evb149 on September 12, 2015, 08:47:59 pmI need to think about separating C from R by looking at phase - something I hadn't thought of before - perhaps it offers a relatively simple solution (thank you)I did think about taking measurements at two widely separated frequencies, and worked out the calculations involved. However, I have been trying to do this 'old school' with analog electronics (and through-hole construction), and to set up the calculations that way, while possible, starts to get complicated and finicky to get right. Although I've had a career in IT and am a fluent programmer, I've never attempted using any kind of processor in my electronics. I'm sure the programming would be no problem, but I'm equally sure there'd be quite a learning curve in actually setting everything up for the first time, and I was hoping to design and build this thing in a reasonable time!I need to stay 'real' - if this gets too involved and expensive, it gets hard to justify doing it instead of just remembering to go outside with a watering can!! This is interesting, but it can't take over my life!!

author: dom0
author_rank: Super Contributor
timestamp: September 13, 2015, 08:47:57 am
content: There are watering sensor boards available here:https://www.mikrocontroller.net/topic/335407There are schematics linked in there somewhere. It's basically an oscillator with a board capacitor determining it's frequency. As the dirts moisture changes, the frequency changes.