We present a low-cost and versatile high Q colorimetric refractive index sensor based on anodic aluminum oxide (AAO) graded-lattice photonic crystal heterostructure (PCH) template controlled by voltage pulse and electrolyte temperature.