Measuring pH in a food-safe environment