This research exhibits a new configuration of photonic crystals known as annular photonic crystals (APCs) for real-time detection of calcium carbonate (CaCO3) scale in the water pipeline. The proposed sensor features a circular arrangement of porous silicon materials with varying levels of porosity. A central defect layer is incorporated into the design to capture the target analyte, allowing it to detect changes in the refractive index caused by scale formation. To analyze the reflectance spectrum of this structure, a modified transfer matrix method is utilized. An extensive optimization process is conducted based on the characteristics of the defect mode, focusing on various geometric parameters, including layer thickness, porosity levels, core circle radius, and structural periodicity, to achieve optimal sensor performance. The simulation outcomes revealed that at the optimized structure parameters, the sensor offers a remarkable QF, sensitivity, and FoM of 1215, 176.85 nm/RIU, and 350.5 1/RIU, respectively. Moreover, the proposed structure is simple, cost-effective, and compact, which makes it an ideal candidate for the detection of calcium carbonate scales formed in pipes and devices in water supply networks.