Hay Moisture
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Hay Moisture

by adamems on Fri Jul 26, 2019 4:02 pm


I'm wanting to build a moisture monitor for hay. For this project I need to have at least 6 sensors for measuring moisture in the windrow (loose hay on the ground that is mounded up) and one sensor that can be shoved into the middle of a large round bale of hay (around 24 inches for the probe length.) While I am familiar with components, this will be the first project built from scratch, so I am a little out of my depth.

My general plan was to use a ras pi 3B with a display of some sort and to mount them together with a battery in a hand held housing. In my research it looks like measuring hay moisture is measured in resistance, so I was going to use resistance sensors to measure the moisture level. Moreover with no plan whatsoever I wanted to use multiple resistance sensors to measure windorow moisture somehow connecting back to the raspi. It would be nice to have a sensor I can put in a 24 inch tube to probe the middle of a hay bale. While I know there are many moisture measuring projects, none of them address having multiple sensors for a reading and are generally geared at soil. Any help selecting your products for this project would be greatly appreciated.

Posts: 2
Joined: Fri Jul 26, 2019 2:51 pm

Re: Hay Moisture

by adafruit_support_mike on Sat Jul 27, 2019 3:38 am

You'll probably have better luck with a microcontroller than with a RasPi. Microcontrollers are better at talking to low-level hardware like current meters, and can still run a display.

There are two general strategies for measuring resistivity: make a voltage divider with another resistor whose value you know, or apply a known voltage and measure the current.

As a practical matter, I'd suggest using a voltage divider. Resistors are cheap, it's easy to swap resistor values until you find the one that works best, and you can read a voltage divider with a microcontroller's ADC pins.

From a quick search of commercial meters, it looks like the probe has two brass fittings at its tip, and the fittings are separated by an insulator. To use that in a voltage divider, you'd connect positive voltage to one fitting, connect one end of the resistor to the other fitting, and connect the free end of the resistor to GND. Connect the top end of the resistor to an ADC pin and you can measure the voltage across the resistor when it's inside a bale of hay.

If you know the voltage connected to the positive fitting and the voltage across the resistor, you can find the voltage between the fittings (through the hay). Then you can use the voltage divider equation to find the resistance of the hay:

Code: Select all | TOGGLE FULL SIZE
                          V.mid  =  V.total x R.known / ( R.known + R.hay )
V.mid x R.known + V.mid x R.hay  =  V.total x R.known
                  V.mid x R.hay  =  R.known( V.total - V.mid )
                          R.hay  =  R.known( V.total - V.mid ) / V.mid
And then you can convert the resistance to a moisture content.

Our Feather M0 has 12-bit resolution on its ADC pins, which comes to about 0.8mV per least significant bit:


That should be fine enough resolution to get good moisture readings. The microcontroller can also run our TFT FeatherWings:


which will give you a display for the output, plus touchscreen input if you want it.

All Feathers are designed to run on LiPo batteries, so they're good for portable applications. The Feather M0 has 6 ADC pins, so once you find the most effective resistance, you can read half a dozen probes simultaneously.

Posts: 59131
Joined: Thu Feb 11, 2010 2:51 pm

Re: Hay Moisture

by adamems on Sat Jul 27, 2019 7:50 am

Thank you! You don't know how much I appreciate the help. I'll be ordering today.

Posts: 2
Joined: Fri Jul 26, 2019 2:51 pm

Please be positive and constructive with your questions and comments.