As for the NaNs for pH: I think it is because you might have a problem writing / reading float values.
I believe in killing floating-point arithmetic whenever practical.
It is usually not difficult to find ways to avoid it.
// This is evil:
float pH = 0.0178 * sensorValue - 1.889;
// Instead, use:
int pH = (2 * sensorvalue) - ((11 * sensorValue + 9445) / 50);
// This gives you 100 times the real pH,
// so if the real pH is 5, the pH variable will be 500,
// and if the real pH is 5.25, the pH variable will be 525, etc.
// Just insert a decimal point (or decimal comma!) for display.