JaiaBot  1.20.0
JaiaBot micro-AUV software
ph_temperature_compensation.h File Reference

Go to the source code of this file.

Functions

double temperature_compensated_ph (double measured_ph, double temperature_celsius)
 This function applies Nernst-based automatic temperature compensation to adjust a pH reading measured at temperature T, translating it to the equivalent value at 25 °C. More...
 

Function Documentation

◆ temperature_compensated_ph()

double temperature_compensated_ph ( double  measured_ph,
double  temperature_celsius 
)

This function applies Nernst-based automatic temperature compensation to adjust a pH reading measured at temperature T, translating it to the equivalent value at 25 °C.

pH electrodes become more sensitive as temperature increases due to the Nernst equation: slope = (2.303 * R * T) / (n * F) ≈ 0.1984 × T (in Kelvin)

This slope determines how much the electrode voltage changes per pH unit. At 25°C (298.15 K), the slope is ~59.16 mV/pH — the standard used during calibration.

If a pH value is measured at a different temperature, its deviation from pH 7.0 must be scaled back to match what the reading would have been at 25°C.

This function assumes the input pH was measured using the slope corresponding to the actual in-situ temperature, and adjusts it to match the reference slope at 25°C.

Parameters
measured_phpH value measured at in-situ temperature (not yet compensated)
temperature_celsiusin-situ temperature at time of measurement
Returns
double pH value compensated to 25°C conditions
Note
This does not convert voltage to pH, but adjusts an already computed pH value.

References:

Definition at line 28 of file ph_temperature_compensation.h.