A simple and low-cost humidity sensor based on self-assembled three dimensional nanohydrogel colloidal array was prepared for humidity sensing.