The behaviour you are seeing is what happens when you have high-impedance inputs. Basically, if you don't drive them, you get random values.
You can solve the problem by making sure the value is always drivenUnfortunately in your case, even when the sensor is disconnected. Add a resistor between the op-amp's +
input and ground.
The value of the resistor should be large enough that it doesn't affect the output fromwhere the pH sensor much when it is connected, so find theyou are using has no output impedancecurrent to speak of the pH sensor and pick a resistor, say, 100 times largerI don't think there's anything you can do about this electronically.
The resistor should also be much smaller thanYou'll have to solve the input impedance ofproblem in some other way if you really need to be able to disconnect the op-amp; they have very high input impedance (mega-ohms)sensor. Let's hope there exists A mechanical solution would be a suitable value to meet both criteriaconnector which shorts when disconnected.
You might not reliably get down to 0 Switched headphone connectors do this, butfor example - when you should get pretty lowpull out the jack, they make a connection so that the speakers can be switched on.