I don’t yet have my Matrix units, but here are some things to consider:
-
What are the units of the values being reported? Pascals, cm and degrees C? Some unit conversion may be needed.
-
To reduce the effect of nearby components, use a fan to blow air over the sensors for a few minutes before taking readings, then see if the values look better. If they do, then consider adding a small fan to your Matrix. Of course, this assumes you actually want to measure the ambient environment, and not the Matrix itself.
-
Many sensors need some form of correction/calibration, both a generic static corrections and one that adapts with time. Most modern sensors have these built-in, but they may need to be enabled and/or configured. Such features will typically be accessed via a lower-level API.
However, it may be best to look at this as an opportunity for you to do some Real Science ™, to perform experiments to “characterize” your sensors. Characterization involves getting answers to questions like:
-
Are your sensors always off by a fixed amount? This is what’s called a “systematic error”, and can be fixed by adding or subtracting that fixed value from each reading. This ensures your sensor will be accurate at at least one value.
-
After removing any systematic error, and assuming the reading still isn’t right across the entire measurement range, is the sensor value at least proportional to the correct value? This is what’s called “proportional” or “geometric” or “multiplicative” error, and can be fixed by multiplying or dividing the reading by a fixed value.
For the math nerds: The above two steps combined will obtain a “Linear Fit”, which can be directly calculated in several ways, including LSBF (Least-Squares Best-Fit).
- If the reading still doesn’t closely match the correct value after correcting for systematic and proportional errors, then the remaining error, no matter the cause or kind of correction needed, is called “non-linear” error.
Most often, the remedy is to throw our hands in the air and use a simple lookup table with linear interpolation. This can work extremely well, and I’ve often used it in scientific-grade sensors and aircraft instruments.
If you are ambitious, the non-linear errors can be decomposed by two main approaches within the general category of “curve-fitting methods”: Polynomial best-fit and Fourier Analysis.
All calibration/correction methods require the sensor to have one vital feature: Repeatability. We tend to take this for granted, but it is important to measure the amount of randomness or chaos in the readings, and (if possible) identify their sources. The presence of randomness in sensor readings is often due to issues in the circuit board, such as not enough power supply filtering or device decoupling. No matter the source, some randomness can be removed by averaging, but in the end there may always be some left in the processed reading. It is simply not possible for any calibration to do better than the residual randomness in the readings.
But what steps are needed to figure all this out? The first thing is to take as much data as you can easily get, many readings taken under many conditions, over the full useful range.
Ideally, you want to include reference values, readings that reflect fundamental physical constants in nature. For temperature, two convenient values are the melting and boiling point of water (or other fluids in the home, such as alcohol) at standard atmospheric pressure. For humidity, near 0% may be obtained by blowing air over silica gel, and 100% should exist near a pot of boiling water.
Unfortunately, electronics often don’t like getting wet, so we can use another approach: Comparison to a known-accurate (“reference”) instrument. Even cheap home weather stations have remarkably good calibration, so putting your Matrix next to a weather station and recording the data from both may give you all the data needed to calibrate your Matrix.
Finally (or first, if you’ve read this far), it should be very informative to download the datasheets for the Matrix sensor chips, and learn how they are supposed to work. Then read the source code that accesses the sensor, and ensure it is behaving per the datasheet.
More than once I’ve had to take tons of data, read a bunch of data sheets, examine a pile of code, verify the schematics and probe the circuit itself before finding what was making sensor readings misbehave.
But my bet is a fan, with some unit conversion, will do the trick.