u/unplorable

A little bit about the accuracy of capacitive moisture sensors

Short version: They aren't as bad as people make them out to be.

Longer version:

I did a 'Gage R&R' today, using three of them.

For the un-knowing, that means I took a lot of measurements and figured out a few things.

Like this:

One important part of a GR&R is to determine how well a gage (sorry, that's the industry spelling.) (I know.)... how well a gage can measure different but similar parts. How clearly can it "see?" This is typically done in the manufacturing world by providing 10 different parts that are all in tolerance, but each one slightly different.

I just need to do that with soil.

I have a 5-gallon bucket of soil mix I use. Peat moss, a little sand, some perlite. My standard go-to. It's not completely dry-dry, but certainly as dry as I'd ever want a pot to get.

So today, I took 10 4" plastic pots, and filled each one with the same amount (70 grams) of my mix. I used my kitchen scale, it should be close enough for this. My kitchen counter was a hot mess. Pot #1 will be my "0% water" pot.

Then, I emptied one of them into a large coffee mug and added water until it was mostly full, stirred it, and let it soak for about half an hour. Stirred again, then drained off the excess water, put it back in the pot, and weighed it again. That's my "100% water" pot. 107 grams of water, in case you were wondering.

Then I added water to pot #2... 12 grams to be exact (107 / 9, I rounded up, I don't think decimal points are all that important at this stage!) Then 24 grams to pot #3, 36 grams to #4, and so on, until pot #9 had 95 grams of water. I stirred each one and then let them stand for about an hour to make certain the water was fully absorbed. That gave me my 10 sample "parts" to measure, each one with a decently-known percentage of moisture. My wife is a very understanding woman.

Then, I wired up a quick MCP3008 circuit for a raspberry pi, and took measurements... measure 10 times at 1-second intervals, discard the lowest and highest value, and return the average of the remaining values. This equals one measurement. (I use them this way in practice, as it knocks down any noise in the readings.) The returned values are just voltages, I don't need to do any conversion to percentages of moisture at this point.

I then measured each pot in turn, 1 - 10, recording each reading. After the 10th one, I re-mixed all 10 pots, and repeated the measurements.

I did this a total of 3 readings for each pot.

Then I replaced the sensor with another one, and repeated 30 more measurements.

Then I did it again with a third sensor, for a total of 90 measurements.

What I found:

For those familiar with GR&R studies, the ultimate GRR result is somewhere in the 6-16% range, and a NDC of 4.2-5.3. (I have several spreadsheets that never seem to agree.) A reason for the large delta is the 'tolerance' that I am targeting... and I really don't know what that tolerance is. I used a pot of saturated soil (standing water) as the 'absolute max' reading, and a bag of dry sweep as the 'absolute low' reading, which gave about a 2.5 volt range. I went with that.

For those unfamiliar, this means these little sensors are not that terrible.

They won't give you an exact measurement of the amount of moisture in your soil, but they're surprisingly close.

What they WILL give you is 5 pretty reliable 'levels' that you can count on. (That "NDC" value means that out of the 10 pots I had, the sensors can't tell all 10 pots apart from each other, but they can tell them apart in groups of 2. Remember, we're measuring dirt.

My biggest takeaway from this is: Rather than looking at very specific measurements from these, you can reliably count on them to tell you if your plant is at "needs water" (0-20%), "a lil dry" (20-40%), "just right" (40-60%), "damp" (60-80%), or "just got watered" (80-100%)

I was actually surprised, everything I've seen online suggests that these are wildly inaccurate. But I can certainly live with 5 distinct categories!

I cut a few corners on this test, and anyone who regularly does a GRR is probably screaming at me... but I think the numbers really do speak for themselves.

For those who don't know: This test is the same process that is used to qualify a gage before it can be used in the automotive, aerospace, medical, and defense industries to judge the reliability and repeatability of the gage before it can be used to measure the spinning parts in jet engines to decide if they're good enough to fly. It is absolutely overkill for the purpose of measuring moisture of soil... but the results are still as meaningful as on any other gage!

And for all the nerds out there, here are the values:

Sensor 1:

2.4697 2.4436 2.3171 1.9877 1.6106 1.6364 1.6652 1.4445 1.3294 1.2603

2.3452 2.3639 2.341 2.0132 1.8006 1.6177 1.9045 1.5629 1.4342 1.2519

2.4878 2.291 2.3255 1.989 1.7584 1.6468 1.8997 1.2784 1.2455 1.1465

Sensor 2:

2.4052 2.4819 2.2726 2.06 1.8416 1.6155 1.3871 1.5823 1.2929 1.2029

2.5729 2.3771 2.0355 1.9945 1.7558 1.5913 1.5345 1.2871 1.2648 1.2723

2.3542 2.3632 2.2345 2.0429 1.7739 1.7339 1.5732 1.4474 1.2793 1.1929

Sensor 3:

2.4081 2.2242 2.1781 1.8416 1.6316 1.799 1.4639 1.4132 1.3071 1.1771

2.3432 2.229 2.2932 2.0926 1.8361 1.6439 1.6513 1.5974 1.2242 1.2839

2.3694 2.3887 2.1261 1.9242 1.7774 1.8861 1.4981 1.4594 1.3303 1.2771

reddit.com
u/unplorable — 15 hours ago