Vegie Garden Moisture Monitor


Active Member
Hi Guys

After installing Gerry Dupreys jSprinkler system in my small vegie patch and which has been running fine for quite a while now i decided to have a go at monitoring each vegie zones soil moisture. I initially had a play with using a sensor circuit connected to a DS10 device but thought that since my vegie patch is quite small a dedicated controller might be the best option....I scoured the net for a suitable solution without any luck..I did come across a project which i used the same method of sensing the soil moisture...

For the controller i decided to use the same hardware that i use for my vegie sprinkler system which uses a pic16F877as the brains...This board sells for around $25 U.S. from futurelec...This device has lots of i/o and i was specially interested in the 8 analog inputs which im using as moisture inputs..

For the sensing probes i use some clipsal plastic conduit fittings , a 25mm coupling ,2 25mm end caps, 2 160mm long stainless steel 3mm threaded rod and a 3mm Bicoloured led and some 4 core security cable....The threaded rod is covered in clear heatshrink exposing the last 10 mm so that hopefully will give truer reading at root level...

I was looking around the net for some sample pic code asm or picbasic to get me started when i came across a link to an app which allows you to program pics or avr,s in PLC Ladder logic.. Afer some help from the author (jonathon) i got the board working reading a couple of probes that i had setup in pots for testing. The only issue i had was that i had to drop the baudrate on the serial connection as in recieve mode the board couldnt keep up when running at 9600/4800 baud so for reliable operation the baud was set at 2400....

The board responds to queries from a host controller using a simple ascii protocol...To query zone 1 the host sends the following QAx.......which means it would like to Query Analog x ( 1 to 8) ...The Controller then replys val=xxxx were xxxx can be 0000 to 1023....

Since i use xPL and my Sprinkler system is controlled by xPL i thought it would be nice if i coulkd use xPL to control it...Not being a software programmer i made a request on the xPL Forum and luckily Mal Lansell ( xpl-rfxcom Guru) came to my rescue..So now using Mals app along with another xPL app xPL-Timer i am polling the probes once an hour
with 3 minutes intervals between each probe reading....I have a recurring event which trigger once every hour requesting zone 1 data..the controller reply triggers a 3 minute timer which will time out and request zone 2 data and this triggers zone 3 timer etc....

Im not sure how successful this project is going to be , its early days..i,ll record the probes reading over the next few weeks and see if i can make sense of it ...If it does work out reasonably well i think i might have a go at making a pic interface to a DS10 device so i can use rf versions on my garden beds....
Some pics of my Moisture kit

Nice Frank.

Where did you get the moisture detector? I quickly looked through your links and couldn't find where you purchased it. Does it have a known curve for moisture vs voltage output?
It looks to me as if this is a conductivity measure between two electrodes. I believe the stainless is to reduce corrosion but not certain about the electroplating due to DC stimuli. Any type of moisture level vs current relationship will depend upon what electrolytes are being fed to the plant. I can see were the mosfets can be turned on based upon a lack of conductivity, but knowing when to turn them off is a little trickier.
Hi Guys

Please excuse my lack of knowledge electrolysis .....But from what i have read i believe that if you
pulse the d.c. to the probes it helps prevent corrosion...Im using an output on the pic controller to pulse on/off 20ms ...This output feeds all analog inputs via a 10k resistor and when a probe is required to be read i read it when the pulse is high...Im hoping this is the correct approach...??
Michael whats the ref to the mosfets ??

Michael whats the ref to the mosfets

As I understand your design, the decision to irrigate is based upon the measured moisture and the irrigation action is activate a mosfet transistor which I suspect will drive some form of valve to allow water to flow or trickle. I was trying to indicate that it is not very hard to develop logic to know when to turn the water ON, but once ON knowing when to turn it off is more difficult. In my control logic I use a fixed duration ON time and have delay to enable the next potential ON time. This will allow the water time to distribute and the moisture sensor to stabilize. If you base the logic only on moisture levels then it can be tricky. An analogy is like trying to fill a jug with liquid to a certain level. You will pour a large volume of liquid into the jug, take a measurement and then pour a lesser amount and continue this guess/measure cycle until the jug is filled to the desired level.
Hi Michael

I currently just water each zone for a fixed time once a day...What i was hoping to do was to measure each zone moisture and then the water time for each zone would vary depending how dry each zone was.....Need to revisit my hardware design and get that correct...
Will do

Have ordered 8 of the vg400 sensors 6 for my vegie patch and a couple to play with and try and make a wireless probe for my garden beds....

Hi Guys

My VG400 sensors arrived today so i did some quick bench testing to see how they perform...

I tested 2 sensors and here are the results.....using a 5v regulated supply...........

Sensor 1 output Sensor 2 output
Installed in free air........ 50mv 30mv

Installed in Glass of Water.. 2.100v 2.100v

Installed in Pot with dry soil 700mV 678MV

Installed in Very Moist Pot 2.150v 2.090v

I expected the probes to output 3v when submerged in the glass of water...Other than that results were very close ,comparing the two probes...Im reasonably confident they will operate better than my Homebrew ones...I also noticed while testing (which is mentioned on the Vegetronix site) that the outputs varies depending on how much of the probe is submerged in water so can be used for water level sensing...Would be great to have another version of this probe to monitor water levels in water tanks ? ;-)...Anyway i,ll hopefully be retrofitting the sensors this weekend....
More Soon
Those probes do look very interesting, and am interested in these myself. Are you still going with the wireless setup? Definitely keep us posted!