Graphene-based devices for measuring pH