This discussion will be focused on the effects of temperature as it relates to electrical conductivity primarily in hydroponics. Clearly temperature is important or there'd be no reason to be reading this. If you don't correct for temperature, your measurements will be inaccurate. Maybe very inaccurate, as temperature can change your EC readings by as much as 2% per degree. A temperature compensated EC reading is called specific conductivity and it is normally notated somewhere what reading it is specifically talking about.
But Why?That's out of the scope of this because it gets fairly complicated quickly. Just know that for normal hydroponic purposes, conductivity goes up as temperature goes up.
CompensationThe fix for this is to apply a formula that takes into account the temperature and gives you an adjusted value. There are linear and non-linear formulas that can be applied. uFire devices use a linear formula with an adjustable coefficient and a temperature constant.
The coefficient for hydroponics is generally agreed to be about 0.02, it can be slightly more or less depending on the specific ions in the water. uFire devices use a coefficient of 0.019.
The temperature constant is the temperature you want your measurement adjusted to. Hydroponics typically use 25 C which is the default for uFire devices.
For discussion, the formula used is below:
temp. compensated measurement = uncompensated measurement / (1.0 + (coefficient * (measured temperature - constant)));
But you won't need to use it, since it's taken care of automatically in the firmware and library.
The APIl using a uFire device with the temperature sensor would look like:
uFire_EC::measureEC(uFire_EC::measureTemp());
But that leads to one more problem. How do we calibrate the sensor with temperature compensation in mind? Using a 1.413 mS/cm calibration solution as an example, remember that it will only measure 1.413 mS at 25 C. If you calibrate at a different temperature, it will introduce some inaccuracy in the reading.
CalibrationUsually, your calibration solution will come with a chart of readings vs. temperature. You will need to match that mS reading to the closest temperature reading.
As a practical example, let's assume we are calibrating with one point, using a 1.413 mS/cm solution, and it is 20 C. From the a lookup table on the solution (which is hopefully there), it tells me that at 20 C, it should measure 1.278 mS/cm.
The code for that will be:
uFire_EC::calibrateProbe(1.278);
What if your solution doesn't have a chart or you want a more accurate measurement?
You just need to rearrange the formula from above to this:
<solution at 25 C in mS/cm> / (1 - (0.019 * (<actual temperature> - <temperature constant>)))
To put the values from above in:
1.413 / (1 - (0.019 * (20 − 25))) = 1.2904
So 1.2904 is what we get. Why doesn't it match to what we know the label says? First, once you start running numbers through equations like this, you just get an approximation. The temperature coefficient is the primary source of inaccuracy. If you play around enough, you could find a coefficient that gives you an exact matching value, and that might be very accurate to measure your calibration solution at any given temperature, but if you measure anything else, it will revert to being an approximation.
ConclusionHopefully that covered the basics of how and why to use temperature compensation. As you can see, it can get a little involved. If you explore the topic deeper, you'll see this article just touched the surface.
Comments
Please log in or sign up to comment.