Converting pH into proton concentration