A real-time photonic crystal sensor is suggested for the detection of airborne heavy metal nanoparticles (HMNPs). The sensor consists of a sandwiched sampling cell between two stacks of alternating TiO2 and Si₋Ge layers, forming the core of the device. The sensor's performance is based on monitoring changes in both the intensity and phase of a probe beam as it propagates through the core. By analyzing the fluctuations in intensity, central frequency, and full width at half maximum (FWHM) of the resonant mode within the transmittance spectrum bandgap, or by monitoring the phase changes at the angle of maximum transmittance that may result in a remarkable Goos–Hänchen (GH) shift in transmittance, the sensor can identify the pollutant nanoparticles. Tuning the thicknesses of the slabs and the number of unit cells in the photonic crystal can dynamically shift the resonant mode and bandgap edges, allowing for easy adjustment of the sensor's responsivity. Furthermore, the optical response of the sensor can be tuned through external parameters such as the incident angle of the probe light or an externally applied electric field. Additionally, the sensor exhibits sensitivity not only to changes in the extent of the sample but also to the shape of the present HMNPs. These characteristics make the proposed configuration cost-effective, user-friendly, and suitable for HMNPs detection without the need for complex sample preparation, data analyses or additional tools/accessories.