This research develops a low-cost water-monitoring system using nanofabricated diffraction surfaces and image analysis. As water flows over a “rainbow film,” distinct optical patterns reveal chemical or biological contaminants. The system has already detected dyes, algae, and particulates, offering a rapid, affordable tool for identifying pollution in water pipelines.