Lookup table for grain equilibrium moisture content

I have managed to get temperature and humidity data from a BME280 and display it on a LCD.

I want to take it one step further and use the temperature and humidity to lookup the equilibrium moisture of soybeans. Soybeans are hygroscopic and will pick up or lose moisture very quickly through the day. I get docked at the elevator for delivering anything over 13.5% moisture. Get charged for shrink and drying.

One other issue is I’m within 3 miles of Lake Michigan and the humidity of the lake especially with wind blowing off the lake affects the moisture of the soybeans.

I have an expensive moisture meter for measuring grain moisture content but I have to drive the combine to the field to take a sample.

NDSU has published lookup tables for equivalent moisture content. It’s in 5 degree or %Rh increments but that is close enough for this application.

NDSU link

I would like to be able to display the equilibrium moisture content of soybeans based on the measured temperature and humidity. This will tell me if it pays to drive the combine to the field to get a sample or need to wait for it to dry down.

It looks like a 2D array can be used but I’m confused on how to align the rows and columns to the temperature and humidity then to get the equilibrium moisture.

Any help is appreciated.

The indexes on both side of the grid are regular (5 degree and 5 percent increment) so you can just declare a 2D array of the right size, fill it up with the info from the web and it’s a simple math to get the closest row and column for a given temperature and RH

For example at 20º you need column 0 and at 100º you need column 16.
You first constrain() your temperature in between those 2 values and then use map() to find the column index

The same goes for RH

@jason_wi
In general a procedure you need is calling "2D interpolation".
But in your case values along temperature axis differ by no more than 0.1 units, respectively, along this axis, you can simply take the nearest one and limit yourself to interpolation along only one humidity axis.

1 Like

I think the usual term is bilinear interpolation but indeed here it does not feel like it's needed

1 Like

Thanks. I guess I have some reading to do.

Will the MCU have access to WiFi?

If that's the case the MCU could send the raw data to a central computer from there the data can be examined.

Since you have the temp and humidity, you can just glance at the table and pick the nearest value. Maybe the nearest higher value, to be on the safe (well, safer) side.

If the computer has to perform the "glance", try something like this:

const float soy_table[19][17] = {
{1.2, 1.2, 1.2, 1.2, 1.2, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0},
18 more rows
}

float rh, temp;

int row_index = (rh - 5.0)/5.0 + 1.; //next higher
int col_index = (temp - 20.0)/5.0 + 1.; //next higher (corrected!)

float moisture_content = soy_table[row_index][col_index];

What do you actually want to do with that number? From the post it appears that you just want to avoid conditions where the moisture content goes over about 13.5%.

Copy paste error probably

May be worth checking / constraining input variables

Thanks, should be, and corrected above
int col_index = (temp - 20.0)/5.0 + 1.; //next higher

Yes, temp and rh must be constrained to not exceed the max and min values in the table.

I got it working. However I had to eliminate the + 1 in both row and column formulas. It was off by one row/column.

Hi,
This looks like a really good outcome, have you checked your values against the values at delivery?

Can you post some images of your project so we can see your components layout and sample container?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:
PS. I used to service a similar commercial device used to check barley for a Maltster.

I’m using this to predict moisture prior to harvest. Weather conditions with high humidity affect the soybean moisture.

I have a Dickey-john MiniGAC Plus for checking the actual moisture.

Fine, I used to service the larger benchtop Dickey-John.

Tom.. :smiley: :+1: :coffee: :australia:

That was the clearly stated intention.

I suggested to take the next higher value to be on the "safe side", mainly because consumer grade humidity sensors are so unreliable.

Glad you got it working!

what do the desktop dickey-johns use to measure moisture?

what did you use for a sensor?

The Dickey-john farm grain moisture tester determines grain moisture content using the capacitance principle . It measures the dielectric constant, which changes with the moisture content of the grain. The moisture content for wheat is obtained directly from the digital readout on the meter.

9.pdf (91.6 KB)

Tom... :smiley: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.