About magic numbers in the DFRobot pH library
I measure pH value using SEN0169-V2 and the library provided by DFRobot (https://github.com/DFRobot/DFRobot_PH).
The measurement itself is working fine, but I cannot understand the calibration code in the library.
I think the code derives the equation of a line through two points (y=ax+b), but what do the two magic numbers used here (1500 and 3.0) mean?
float slope = (7.0-4.0)/((this->_neutralVoltage-1500.0)/3.0 - (this->_acidVoltage-1500.0)/3.0);
float intercept = 7.0 - slope*(this->_neutralVoltage-1500.0)/3.0;
Is 1500 an offset? Why is it divided by 3.0?
If anyone knows, please teach me.
Thank you.
Hi, The data were obtained through software fitting of a large number of samples.
WinsterThanks for the reply.
I am sorry, but I am not understanding.Are you saying that the equation in the Arduino library is different from the equation for the coefficients of a linear equation (in the attached image)?Do these magic numbers have no meaning, just convenient numbers?