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.
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.
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
@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.
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:
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%.
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.