JaiaBot  1.20.0
JaiaBot micro-AUV software
ph_temperature_compensation.h
Go to the documentation of this file.
1 
28 double temperature_compensated_ph(double measured_ph, double temperature_celsius)
29 {
30  const double slope_at_25C = 59.16; // mV/pH at 25°C
31  double temp_kelvin = temperature_celsius + 273.15;
32  double slope = 0.1984 * temp_kelvin;
33 
34  return 7.0 + (measured_ph - 7.0) * (slope_at_25C / slope);
35 }
double temperature_compensated_ph(double measured_ph, double temperature_celsius)
This function applies Nernst-based automatic temperature compensation to adjust a pH reading measured...