So the reason your moisture sensor project failed is because those types of moisture sensors are really designed for "stick it in, test it, and pull it out" testing. If left powered on in a moist environment, the conductive material on the sensor will quickly corrode (quickly as in the span of a few hours, as is seen on the graph).
However, Vegetronix makes an ultrasonic soil moisture sensor that does not have electrodes, and thus does not corrode. It is far more complex and expensive ($40) but it's designed as a moisture sensor for sprinkler systems and as such is engineered to be left in the ground.
Edit: Link to Vegetronix sensor: http://www.vegetronix.com/Products/VH400/ . I have used it and it works well, but as it turns out, even this is not sufficient to really automate a garden. You need fertilizer. Hydroponics make dealing with that complication much easier -- until you realize that the fertilizers are caustic / acidic enough that you have to flush the lines with water as well...
In other words, there's a pretty good reason you can't buy a kit off the shelf that will grow plants :)
The sensors corrode due to oxidation caused by the DC current. It's a pretty simple design change to alternate the current flow through the sensor and prevent that oxidation by toggling the pins.
Exactly this. I created a soil moisture setup with cheap sensors that worked consistently for several months. The key was to send the current flow one direction for a few seconds, then reverse high/low on the pins for the exact same time. This prevented excessive oxidation.
Maybe you're oxidizing the soil around the sensor? In any case, oxidization (especially with gold-plated sensors) is a concern. I was unable to get these simple resistive sensors to work consistently long-term.
However, Vegetronix makes an ultrasonic soil moisture sensor that does not have electrodes, and thus does not corrode. It is far more complex and expensive ($40) but it's designed as a moisture sensor for sprinkler systems and as such is engineered to be left in the ground.
Edit: Link to Vegetronix sensor: http://www.vegetronix.com/Products/VH400/ . I have used it and it works well, but as it turns out, even this is not sufficient to really automate a garden. You need fertilizer. Hydroponics make dealing with that complication much easier -- until you realize that the fertilizers are caustic / acidic enough that you have to flush the lines with water as well...
In other words, there's a pretty good reason you can't buy a kit off the shelf that will grow plants :)