Compact analog pH sensor