Determining pH