Home  |  Subscribe  |  Computerized Grow Box  |  LED Grow Box  |  PC Grow Box  |  

Sunday, November 8, 2009

How to make a cheap soil moisture sensor – Heavy Duty Version

IMG_4590

My original version of my moisture sensor has worked great for me but it did have a couple flaws.  The first issue was construction, though I had great luck on my first attempt though after trying to recreate additional sensors given the small amount of gypsum between the sensor and the probes were so thin it was extremely easy to crack the sensor and I normally have about a 25% success rate on later creations (must have had beginners luck on the first one.

The second issue was durability.  Given we are playing with gypsum and as it is suspended in water it will eventually breakdown and there is very little we can do about it.  Though with my latest changes to my automated grow box which includes automated watering based on moisture content I want to ensure my measurements stay accurate throughout the season.  To help with this I have decided to increase the sensors size and also am using galvanized nails to prevent rusting.  After a few attempts I have come up what I feel is a pretty foolproof method of creating a moisture sensor.

How it works:

There were many questions in the comments in the previous post so hopefully I can clear this up a little here.

imageTechnically a gypsum block measures soil water tension.  When the gypsum block is dry it is not possible for electricity to pass between the probes, essentially making the probe an insulator with infinite resistance. 

As water is added to the problem more electrons can pass between the probes effectively reducing the amount of resistance between the problem to the point when it is fully saturated where the probe has virtually zero resistance.  By using this range of values you can determine the amount of water than exists in your soil.

 

Parts:

IMG_4578 

Construction:

Take your utility knife and cut the tubing slightly longer than your galvanized finishing nails.  Try to make the cut as straight as possible though it doesn’t have to be completely perfect.

IMG_4579

Use your utility knife to cut the smaller plastic tube lengthwise, this will allow easier removal of your soil sensor after the mold cures.

IMG_4580

Optional: Make the cut diagonally to prevent a potential vertical fracture line.

IMG_4581 

If you were very careful on you vertical cuts you can avoid this step, but to completely avoid spilling plaster onto my workbench I drilled four holes slightly larger than your tubing.  I used these holes for support but also to catch any of the plaster in the gaps from you less than accurate vertical cuts.

IMG_4582

Being careful that the tubing fits together where you split the tubing vertically, insert the tubes into the holes (or carefully on a flat surface)  Mix Plaster of Paris and carefully fill with to the top.  The friction between the tubing should keep a water tight seal where you made the cut, though if the plaster is a little thin and it appears to be leaking through wait a couple minute for the plaster to setup some and try again, at that time it should not have the viscosity to seep through the very small gap that may be causing the leak.

IMG_4584

Take your two galvanized nails and push them through a small piece of wax paper.  You may also allow the plaster to setup for a few minutes and then float the nails in the the plaster.  I like the first method since gravity will help ensure they fall straight down and parallel to each other.  As for spacing, I have done some experimentation with the gaps between the probes and my conclusion was, it doesn’t make much difference.  As long as there is a gap (they are not touching) you should get reliable results.

IMG_4586 

After allowing the sensor to cure for about and hour remove it from the holes you drilled in the wood.

IMG_4587 

Gently pull back the plastic tubing and you have a nice clean soil sensor.

IMG_4588 

Lay them out to dry for 24 hours to cure completely and their construction is complete.

IMG_4590

For attaching the wires there are a couple options.  The best would be to solder them to the probes though to do this you need to heat up the nail hot enough to enable a strong solder connection.  My little 15W soldering iron just can’t produce the heat for this so I am option for the wire wrap method.  I take about an inch of wire and strip off about an inch of insulation and tightly wrap around the probe.  Given copper will rust and could be a point of failure you will want to insulate this connection and the probes from the moisture.  A few dabs of hot glue works pretty well.  I am planning on trying liquid plastic, though I am currently out and when I have some on hand I will update with how it went.

How to use it

You can simply hook up a multi-meter and check the resistance though if you want to create anything automated you would need to use an integrated circuit (IC) or a electronics prototyping platform such as Arduino.  By applying voltage to one side of the sensor and using a voltage splitting circuit connected to ground and an analog input you can then measure the voltage making it through the probe.  The higher the voltage, the higher the moisture content of the soil.

[SoilSensorDiagram[3].png]

Conclusion

The above should give you everything you need to know to create your own soil sensor and how to use it.  This can be used as a soil sensor for watering your indoor plants like I am using it.  This same sensor could be for monitoring your outside soil moisture content to trigger (or preempt your irrigation system) to save some money on your water bill and/or maintain consistent moisture levels in your plants which could drastically improve water sensitive crops such as tomatoes.

9 comments:

SP8 said...

Very very impressive!

Lin Georgina Green said...

Wow, thank you for all these amazing amazing tips and tricks! What very useful info indeed!

I will have to stop by frequently and learn a thing or two I am sure of it.

Thanks again!

The Cheap Vegetable Gardener said...

Glad you enjoyed the write up. These are really easy to make and very reliable.

Ragnar said...

I wonder (actually that much, I'm going to try myself) if you could make capacitive sensors with two wires inside a tube and use the clock of the µC as a source (amplify it with a transistor) and measure the change in capacitance. It is usually quite a high frequency in the MHz-range, so even a small capacitor should show a change.

The Cheap Vegetable Gardener said...

Ragnar, sounds like a great idea, be sure to let us know how it works out.

One other thought I have for these is not to continuously add current to the sensor but instead apply current for a shorter period of time using a transistor and a digital output to break/complete the circuit. This should definitely increase the life of the sensor. Could also use the digital output directly though not sure if it would have enough wattage.

Ken said...

Thank you for this writeup on the improved moisture sensors. It comes at an opportune time, as I have purchased some Plaster of Paris and an Arduino, but haven't made any sensors yet.

I was wondering if you used any sort of release agent at the bottom of the hole in the wood. Does the plaster adhere to the wood?

Also, I was wondering if different distances between the nails would cause the calibration to be different. Is it important to get the distance the same in each sensor to avoid having to calibrate each one?

For turning the power to the sensor on and off, I saw one web site that suggested using a digital pin from the Arduino to provide +5v (sorry, I can't find the link at the moment). With the 10k resistor in series, the current should be well within the 40ma limit for the digital out.

The Cheap Vegetable Gardener said...

Ken, I haven't had any issues with sticking though adding a little dry gypsum to the bottom could help or a release agent as you mentioned. As for calibration, I had that same concern and did a little experimentation and my findings were it didn't make much difference in the spacing between the probes, assuming they don't touch of course.

fred070 said...

Good day, why use gypsum block if we can directly use the two galvanize nails to measure the soil moisture..

The Cheap Vegetable Gardener said...

fred, the reason you want to use gypsum is one to keep your probes from touching, don't want a false positive that your moisture is just fine because the probes are touching.

The specific reason for choosing gypsum is because of soil water salinity. As the block is saturated with water is dissolves some of the gypsum and fill the pore to create calcium sulphate which will provide the same measurement regardless of the salinity of the water. I assuming all inputs are consistent (water, fertilizer, salt content) then you could get away with a couple of galvanized nails in the soil though gypsum will provide better accuracy with these varied conditions.