pH sensor measurements unstable

This means that the reference is Vcc, with all noise on that line. Use at least one of the more stable built-in references.