i've recently build an automatic irrigation-lighting system for a small plant with an arduino micro, LED lamp, peristaltic pump, dht11, lcd display and a cheap soil moisture sensor (funduino soil moisture sensor).
Everything works fine, except the soil moisture sensor.
The code is extremely easy (just an analogRead() every 1 second).
Yesterday (hours 20:00) the sensor reads a value of 770.
At 22:00 the value was 730.
This morning, at 07:00, the value is <650 and the value still going down.
I've tried to turn off the sensor power supply.
When i turn on the power supply the value was decreased.
I've tried different sensor, different input pin and different soil, the result is the same.
If someone is interested i can post the full code and the fritzing schematic.
Please someone helps me beacuse i'm literally being crazy!!!
Please post a link to that moisture sensor. Most of the cheap moisture sensors are not made to be used continually. Most of them corrode very fast and measurements aren't stable in any way.
The longer you have these powered the smaller values you get. The only way to use these sensors for more than a few hours is to provide just power to them while you're measuring and don't measure to often (perhaps once an hour). But even then I would not expect that the sensor survives more than a few months.
Diurnal soil temp (Google it) is probably the biggest problem for soil moisture sensors.
Two galvanised nails and a (1-10k) pull up resistor works the same, and they last longer than a circuit board.
Corrosion can be reduced by driving the nails with AC.
Search for "soil sensor" in the search box on top of this page.
Leo..
If you want to install a moisture sensor that lasts for years, take a look at this sensor: Soil Moisture Sensor - VH400. It costs a few bucks more but it works reliably.
hi all!! thanks for your answers. you're right, this kind of sensors are not the best for this kind of application. So, i've bought a capacitive soil moisture sensor (corrosion free).