Understanding How pH Sensors Work