In vivo pH sensor for precision agriculture