Microscopic model for pH sensing mechanism in zinc-based nanowalls