An inorganic-organic hybrid optical sensor for heavy metal ion detection based on immobilizing 4-(2-pyridylazo)-resorcinol on functionalized HMS.