Hydrogel polymer sensor