Strange Oscillations

Tuesday, July 5, 2011 by darco
Posted in ,

I stuck one of my soil moisture sensors in a potted plant last Friday before I left for a weekend trip. It was working fantastically. I watched as the soil moisture reading increased as I added water to the plant—working exactly as expected. However, when I returned Monday evening, I noticed that the values were all over the place. I took some samples on 100ms intervals and plotted the results:

soil-moisture-osc

Oh my. It's oscillating with an amplitude of around 10% of the capacitance reading. Not only that, my readings are an order of magnitude larger than what I was getting on Friday—when if anything they should be smaller.

I'm wondering if the 60Hz mains frequency is somehow affecting my readings, which would imply that what I'm looking at is the alias of 60Hz sampled at whatever interval I'm polling sensor. The power company regularly adjusts the frequency by ±1Hz or so, which could explain why I didn't notice the ripple earlier (Slight changes in the mains frequency would yield large changes in the alias frequency). This doesn't explain the large increase in the reading, however.

I also noticed some interesting behavior back on Friday. Whenever I grasped the stem of the plant, it caused the moisture level to increase. This makes sense, now that I think about it, but the implications are that each soil moisture sensor may have to be individually calibrated for differences in soil type, amount of soil in potted plants, etc. Not ideal, but not a show-stopper either.

Obviously, still some kinks to work out.

I hope to have the wire protocol solidified this week, at which point I'll actually deploy a few of these things in the yard to see what kind of readings I get. Should be interesting.