Soil Moisture Sensor

Update 2011-09-05: I have created a new blog about electronics only – check it out here: Electronic measurements, NSLU2 and soil moisture sensor

Soil Moisture Meter

In the middle of the picture you can see the moisture meter board from hobby-boards.com and on the right the Watermark soil moisture sensor. When the moisture sensor gets wet its electrical resistance goes down, and when it dries up the resistance goes up. The sensor is connected as a part of the moisture meter circuit, which has a 1-wire interface to the rest of the system.

The board needs a separate 9 to 24 volt DC power supply. I have placed the power supply indoors and the power supply current is running in the Ethernet cable as well as the 1-wire data signal, but only to the moisture meter board and not further into the 1-wire network.

As the other sensors in my 1-wire network this board is also accessed through owfs software (one wire file system) and I’m using the Current Register of the onboard DS2760 1-wire monitor IC to read out data. The moisture sensor is connected to an onboard timer IC and when the resistance changes so does the oscillating frequency of the IC and its power consumption. This is measured by the DS2760 and the value is stored in the Current Register.

When the moisture sensor is completely wet the value in the Current Register is -1.400 and when completely dry the value is -0.2386. This goes for this particular system.

I’ve dug a hole about 30 cm (12 inch) deep and put the sensor at the bottom. The soil that I dug up has been mixed with water and poured into the hole to fill it up again. It’s important with a close fit between sensor and soil.

As usual I have a Linux script running on the NSLU2 that takes care of reading the sensor along with temperature sensors in the 1-wire network, and making historical graphs of the readings:
update.sh

It assumes that you’ve made a valid database for the readings, for example with this script:
make_database.sh

The schedule is handled by Linux crontab with these entries:
# m h  dom mon dow   command
*/5 * * * * /home/thomas/happyfarming/update.sh &> /dev/null
*/5 * * * * /home/thomas/happyfarming/upload.sh

Graphs are uploaded to happyfarming.com using this updated script:
upload.sh

This is an example of one of the graphs:

Soil Moisture Log 2008-12-23

My About page will be updated with the newest graphs.

If you have any questions or comments please leave a comment or use the contact form.

2 comments on “Soil Moisture Sensor

  1. -

    Hello, I want to implement ur basic idea to invent a magic vase with the same function. Could u kindly be my mentor and teach me how to operate the system?

  2. -

    @Alin: Could you please explain what you want your vase to do? And maybe draw a block diagram of the system?

Leave a Reply

Your email address will not be published. Required fields are marked *