jwalthour / GreenThumb

A system to automatically tend plants
MIT License
0 stars 0 forks source link

Need to use an average of many sensor readings, not merely one single reading #1

Closed jwalthour closed 6 years ago

jwalthour commented 6 years ago

Notice how poor the SNR is over the past 2 days (sensors are in different plants). We cannot apply a simple thresholding algorithm on this. Also, I'm fairly positive that a) the temperature is a factor not accouted for here, and b) something about this configuration doesn't provide a great dynamic range. Plant 0 is just about ready for watering.

image

jwalthour commented 6 years ago

It looks like there's a significant capacitive effect here. This is the output of taking 5k readings as fast as possible, with the sensor and ADC powered on at the start of the script: (X axis shows fractional seconds):

image

jwalthour commented 6 years ago

I've finally properly added an averaging function (d9e035cbe8b8ca6ec6b7f2e09fea5b8dd24b2f2f).

These sensors are totally bonkers. I left them running for 4 days, untouched and unwatered. I'm not sure what variables are driving these up-and-down movements, but it is almost certainly not soil moisture.

If I had to guess, this is due to a combination of:

About half of each sensor is above the soil, and is in the air. Also, since the sensors are directly measuring resistance, it doesn't surprise me that it's bringing in a few other variables at the same time.

I suspect these sensors are useful for extremely coarse measurements. That is, they will answer the question "Is this soil dry?". However, they don't seem appropriate for answering the question "how damp is this soil right now?". Most of my plants like to have their root zones not dry most of the time - that is, the soil should have some water content, but also be permitted to be mostly air. This is not effectively measured by these sensors.

image