 The present study investigated the use of a photonic crystal, PC, sensor for the detection of polio virus in water samples. A PC sensor was designed using a one-dimensional, 1D, PC composed of alternating layers of ALN and GAN. The structure was optimized to maximize its performance by varying the thickness of the defect layer, period number, and incident angle. The results showed that the maximum sensitivity of the sensor was achieved when it was loaded with a water sample containing polio virus at a concentration of 0.005 GML. The figure of merit, quality factor, signal-to-noise ratio, dynamic range, limit of detection, and resolution were found to be 2618.28446 nanometers per IU, 3102.06475, 2.27791, 2090.99500, 1.91805, and 0.24656, respectively.