1 Introduction

Diabetes is an illness that can be fatal. Over 415 million individuals are impacted globally. It is anticipated that by 2040, this number would reach 642 million (Bommer et al. 2017). Diabetes is the primary killer of people between the ages of 20 and 59. When the body's blood sugar levels cannot be managed, diabetes develops. There are two types of diabetes: type 1 and type 2. When a person has type 1 diabetes, their body is unable to generate the hormone insulin, which is necessary to control blood sugar levels. For the body to convert glucose molecules into energy, insulin is necessary (Haxha and Jhoja 2016). Type 2 diabetes develops when the body either generates insufficient insulin or insulin that the body rejects (Almawgani et al. 2022a). Adults over the age of 40 are the most affected. Globally, class-2 diabetes is growing at a higher rate than class-1 diabetes (Bommer et al. 2017; Haxha and Jhoja 2016; Almawgani et al. 2022a). The body is affected by diabetes in many different ways. It contributes to a number of major issues, such as heart disease and visual issues, renal troubles, brain malfunctions, and early death. It's also become one of the most prevalent causes of injury-related limb amputations. Diabetes-related kidney and heart disease are on the rise, killing thousands of people each year (Almawgani et al. 2022a). It is critical to create a sensitive and real-time diabetes detector based on the aforementioned details.

Due to their unique properties, photonic crystals (PCs) have recently shown an intriguing response to the regulation of electromagnetic wave propagation. PCs can constrain or permit the transmission of incident light by providing pass or stop bands of frequencies (Taya et al. 2022; Elsayed et al. 2021; Zhang and Li-Ping 2014; Threm et al. 2012). Photonic band gaps (PBGs) are the names for these bands. As a consequence of the PBG (Xie et al. 2017; Fu et al. 2019; Sánchez and Orozco 2016; Qin et al. 2012; Harding et al. 2009), A variety of optical devices, including reflectors, detectors, and switches, have been made using PCs. Thus, PCs may have a considerable influence on the development of biosensor performance. In a recent study (Zyoud and Ahmed 2022; Panda et al. 2018), the authors constructed a 1D photonic structure and thoroughly investigated the impact of different types of losses that happen during light signal transmission through the apparatus. Photonic structures have been used to detect protein, DNA, sodium chloride, and urea. Amiri et al. (2019), Tang and Wang (2008), notably as glucose sensors (Frischeisen et al. 2008), urea level sensors (Chow et al. 2004), and blood biosensors (Almawgani et al. 2022b; Ramanujam et al. 2019). These optical biosensors are very good at what they do and respond quickly to even small changes in what they are looking for Aly et al. (2018), Avsar (2015).

A binary photonic crystal (BPhC) made up of two periodic layers of Ge and TiN is presented in this work as a real-time biosensor for detecting diabetes-affected cells. The suggested structure's transmittance qualities are examined using the transfer matrix approach. The effects of incidence angle (TE and TM polarizations) and defect cavity thickness on the suggested biosensor's performance have been investigated. The best possible scenario for the BPhC sensor is calculated and compared to the most up-to-date biosensor-related detectors.

2 Design and Theoretical Simulation

A binary photonic crystal (BPhC) is made up of the structures (Ge/TiN)N (sensing layer) and (Ge/TiN)N as shown in Fig. 1. This structure is recommended for detecting diabetes-affected cells. The BPhC is surrounded on all sides by air. The thicknesses of the Ge and TiN layers are measured using Bragg's quarter wavelength, and N = 4 is chosen as the number of cells (periods).

Fig. 1
figure 1

A schematic representation of a faulty binary photonic crystal with a defect cavity made up of a sensing layer

Here, the transmittance spectrum was investigated using the transfer matrix technique. The typical transfer matrices are described in the following way:

$$Q_{j} = \left[ {\begin{array}{*{20}c} {\cos \left( {\aleph_{j} } \right)} & { - \frac{{i \sin \left( {\aleph_{j} } \right)}}{{G_{j} }}} \\ { - iG_{j} \sin \left( {\aleph_{j} } \right)} & {\cos \left( {\aleph_{j} } \right)} \\ \end{array} } \right]$$
(1)

\(\aleph_{j}\) is defined as the propagating light wave phase variation through the jth layer.

$$\aleph_{j} = \frac{2\pi }{\lambda }n_{j} h_{j} \cos \theta_{j}$$
(2)

where \(n_{j}\) is the layer's index of refraction and hj is its thickness, \(\theta_{j}\) is the layer's incidence angle, which is represented as:

$$\cos \theta_{j} = \sqrt {1 - \left( {\frac{{n_{0} \sin \left( {\theta_{0} } \right)}}{{n_{j} }}} \right)^{2} }$$
(3)

For transverse electrical (TE) waves, \(G_{j} = n_{j} \cos \left( {\theta_{j} } \right)\), but for alternating magnetic (TM) waves,\({G}_{j}=\mathrm{cos}({\theta }_{j})/{n}_{j}\), where \({n}_{0}\) is the refractive index of the surrounding medium. For one cell with A and B layers, the transfer matrix Q0 may be written as Q0 = QA QB. A defective binary photonic crystal's entire transfer matrix \(Z\) may be written as:

$$Z = \left( {Q_{0} } \right)^{N} Q_{D} \left( Q \right)^{N} = \left[ {\begin{array}{*{20}c} {Z_{11} } & {Z_{12} } \\ {Z_{21} } & {Z_{22} } \\ \end{array} } \right]$$
(4)

where QD is the defect cavity's transfer matrix and Zij is the entire transfer matrix Z's elements. The coefficient of transmission (\(t\)) and the transmittance (\(T\)) are calculated as follows:

$$t = \frac{{2G_{in} }}{{\left( {Z_{11} + Z_{12} G_{s} } \right)G_{in} + \left( {Z_{21} + Z_{22 } G_{s} } \right)}}$$
(5)
$$T = \frac{{G_{s} }}{{G_{in} }}\left| t \right|^{2}$$
(6)

The reflection coefficient (\(r\)) and the reflectance (\(R\))can be expressed as:

$$r = \frac{{\left( {Z_{11} + Z_{12} G_{s} } \right)G_{in} - \left( {Z_{21} + Z_{22} G_{s} } \right)}}{{\left( {Z_{11} + Z_{12} G_{s} } \right)G_{in} + \left( {Z_{21} + Z_{22} G_{s} } \right)}}$$
(7)
$$R = \left| r \right|^{2}$$
(8)

\(G_{s} = n_{s} \cos \left( {\theta_{s} } \right)\) and \(G_{in} = \cos \left( {\theta_{0} } \right)\) for transverse electrical (TE) wave.

3 Numerical analyses and discussion

The transmittance properties of a 1D-binary photonic crystal (BPhC) are explored utilizing the transfer matrix method (TMA) and mathematica simulation. The recommended BPhC configuration is air/(Ge/TiN)4 (sensing layer) (Ge/TiN)4/air. Several dielectrics and semiconducting materials are employed to structure photonic crystals. Here we choose the germanium and titanium nitride because of the large difference in refractive indices between the Ge and TiN layers. As a result, a photonic band gap with a large width will be created. Also, it is expected the efficiency of those crystals will improve as optical sensors. The sensing layer is either a normal cell or a diabetic cell infected with 1.350 and 1.410 refractive indices, respectively (Sani et al. 2021). It is worth mentioning that the substrate will take part in the optical path and contribute to the overall transmittance. However, the substrate material does not have an appreciable effect on the resulting spectrum. Thus, it will almost no effect on the achievement of the photo-detector. So the crystal is surrounded on all sides by air. In order to develop an efficient sensor with excellent efficiency, the influence of incidence angle (TE and TM modes) and sensing layer thickness are investigated. In numerical calculations, the indices of refraction for Ge and TiN layers are n1 = 4.23 and n2 = 1.2887, respectively. These layers' thicknesses (h1 = 106.38 nm, h2 = 349.18 nm) are chosen as quarter wavelengths, with λ0 = 1800 nm as the center wavelength. Photonic crystals can operate in both the visible light and infrared region of incident electromagnetic waves. Here the infrared source (IR- source) is suitable for acquisition of the used wavelengths. For example, As an infrared source, a tuneable carbon dioxide laser is empolyed to detect specific air pollutants and identify absorbing kinds in aqueous solutions. On other hand, an infrared spectrophotometer is a device that emits infrared light into a substance. It then generates a spectrum with a graph that contrasts the amount of light transmitted (on the vertical axis) with the wavelength (on the horizontal axis). Figure 2 shows the transmittance spectrum through the proposed BPhC without any sensing layer. There is a photonic band gap created. The right and left borders of the photonic band gap are at wavelengths of 2542.57 nm and 1176.24 nm, respectively, while the breadth of the photonic band gap can reach 1366.33 nm. When a normal cell and a diabetes-affected cell are regarded as defect layers with a thickness of \({h}_{d}\) = 500 nm, the transmittance spectra through the suggested structure are shown in Fig. 3. The left and right borders of the photonic band gap have been discovered to be at wavelengths of 1202.64 nm and 2727.39 nm, respectively. As a result, the breadth of the photonic band gap widens to 1524.57 nm. Multiple Bragg scattering occurs between incident, reflected, and scattered electromagnetic waves, resulting in these photonic band gaps. When the normal cells of diabetes (NCD) are treated as a defect cavity, a resonant peak may be noticed at a wavelength of 1976.62 nm. When the affected cells of diabetes (ECD) are chosen as a defect layer, the resonant peak shifts to a greater wavelength, as illustrated in Fig. 3. The resonant peak has moved to a wavelength of 2019.22 nm. The situation of a standing wave (Taya et al. 2021) can explain this red shift.

$${\text{OPD}} = n_{eff} Q = b \lambda$$
(9)
Fig. 2
figure 2

The transmission spectrum of a suggested BPhC with no defect cavity at (h1 = 106.38 nm, h2 = 349.18 nm, n1 = 4.23, n2 = 1.2887, θ0 = 0.0°, and N = 4)

Fig. 3
figure 3

The Transmittance spectra of a suggested BPhC with defect layer (NCD and ECD) at (h1 = 106.38 nm, h2 = 349.18 nm, hd = 500 nm, n1 = 4.23, n2 = 1.2887, θ0 = 0°, and N = 4)

The difference of optical path, effective index, difference of geometric path, and an integer number are represented by \(OPD\), \({n}_{eff}\), \(Q\), and \(b\), respectively. At normal incidence, the suggested detector is found to have a sensitivity of roughly 710 nm/RIU. The impact of incidence angle and defect cavity thickness will be explored and optimized in the following phases.

3.1 Influence of the incident angle

The transmittance spectra for both (TE and TM modes) have been investigated at hd = 500 nm at various incidence angles. In the first, it is evident that when the angle of incidence increases, the location of the resonant peak for both TE and TM modes has been shifted to the left. According to the Bragg-Snell law (Daher et al. 2022a), this blue shift can be explained.

$$a\lambda = 2 G(n_{eff}^{2} - \sin^{2} \theta_{0} )^{0.5}$$
(10)

where a, \(\lambda\), G, \(n_{eff}\),\(\theta_{0}\) are the order of diffraction (a = 1, 2, 3, …), the wavelength, the interplanar spacing, the effective refractive index and the incident angle, respectively. As a result, the angle of incident light has a significant influence on the efficicency parameters of bio-photonic detector. Now, the various parameters have been examined, including sensitivity (S), figure of merit (FOM), quality factor (QF) and detection limit (DL), to see how well the suggested structure performed as a biosensor. The sensitivity (S) can be evaluated by Eq. (11) (Daher et al. 2022b). It says that the fraction of the shift in position of resonant wavelength \((\Delta \lambda\)) and the refractive index changes (\(\Delta n\)) can be used to figure this out.

$$S = \frac{\Delta \lambda }{{\Delta n}}$$
(11)

In our calculations, \(\Delta \lambda = \lambda_{ECD} - \lambda_{NCD}\) and \(\Delta n = n_{ECD} - n_{NCD}\). When the incidence angle varies from 0.0° to 80° for TE polarization, the sensitivity rises from 710 nm/RIU to 1376 nm/RIU, as shown in Table 1. The defect peak is not visible when the angle of incidence exceeds θ0 = 80°. As a result, θ0 = 80° was chosen as the best incidence angle. When the incidence angle ranges from 0.0° to 60°, the sensitivity of TM polarization rises from 710 nm/RIU to 750.33 nm/RIU before dropping as indicated in Table 2. Figure 4 depicts the evolution of sensitivity for TE polarization, which is higher than TM polarization, as the incidence angle increases, which is an important goal in the design of optical sensing systems. The ratio between the location of the defect peak (\({\lambda }_{peak}\)) and the full width half maximum (FWHM) for this crest can be used to calculate the quality factor (QF) by using Eq. (12) (Daher et al. 2022b):

$$QF = \frac{{\lambda_{peak} }}{FWHM}$$
(12)
Table 1 The incidence angle affects the position of the resonant peak and the sensitivity of the proposed structure (TE mode)
Table 2 Variation of resonant peak position and sensitivity of the proposed structure with the incidence angle (TM mode)
Fig. 4
figure 4

The Sensitivity (S) vs the incidence angle of a suggested BPhC for both TE and TM modes at (h1 = 106.38 nm, h2 = 349.18 nm, hd = 500 nm, n1 = 4.23, n2 = 1.2887, and N = 4)

The potential to sense any alteration in index is represented by (FOM), which is determined as a ratio between the sensitivity (S) and (FWHM) of the defect peak using the following expression (Daher et al. 2022b):

$$FOM = S/\user2{ }FWHM$$
(13)

Table 3 (TE polarization) and Table 4 (TM polarization) show the numerical findings of quality factor and figure of merit at various angles ranging from 0.0° to 80° in 10° steps. As demonstrated in Figs. 5 and 6, when the angle of incidence varies from 0.0° to 80° for TE polarization, both \(QF\) and \(FOM\) increase, whereas they decrease for TM polarization. This indicates that TE polarization's defect peaks are sharper than TM polarization's, which is one of the key requirements for any successful optical detector. The fourth parameter is the DL, which is described as the smallest refractive index change that can be properly detected. Equation (14) was used to determine this factor (\(DL\)) (Daher et al. 2022b).

$$DL = \left( {\frac{2 \Delta n}{3}} \right)\left( {\frac{FWHM}{{\Delta \lambda }}} \right) ^{\frac{5}{4}}$$
(14)
Table 3 Variation of \(FWHM\), \(QF\), \(FOM\) and \(DL\) of the proposed structure with the incidence angle (TE mode)
Table 4 Variation of \(FWHM\), \(QF\), \(FOM\) and \(DL\) of the proposed structure with the incidence angle (TM mode)
Fig. 5
figure 5

The Quality Factor (QF) vs the incidence angle of a suggested BPhC for both TE and TM modes at (h1 = 106.38 nm, h2 = 349.18 nm, hd = 500 nm, n1 = 4.23, n2 = 1.2887, and N = 4)

Fig. 6
figure 6

Figure of merit (FOM) vs the incidence angle of a proposed binary photonic crystal for both TE and TM modes at (h1 = 106.38 nm, h2 = 349.18 nm, hd = 500 nm, n1 = 4.23, n2 = 1.2887, and N = 4)

When the angle of incidence changes from 0.0° to 80°, the \(DL\) for TE polarization declines while it climbs for TM polarization, as illustrated in Fig. 7. The value of \(DL\) is extremely low, implying that the suggested biosensor can detect even small changes in the refractive index of the sensing layer. From the above data, we can conclude that performance of the suggested biosensor depending upon the incident angle. The detector performance is equal for both TE and TM polarizations at the normal incidence. Utilizing higher incidence angles leads to a significant improvement in the performance of the optical detector in the case of TE polarization, while the performance is reduced in the case of TM polarization. As a result, it is clear that TE polarization is preferable to TM polarization for the suggested bio-photonic detector design. Thus, the next investigation will use TE polarization.

Fig. 7
figure 7

Detection Limit (DL) versus the incidence angle of a proposed BPhC for both TE and TM modes at (h1 = 106.38 nm, h2 = 349.18 nm, hd = 500 nm, n1 = 4.23, n2 = 1.2887, and N = 4)

3.2 Influence of the defect cavity thickness

The transmittance spectra of the defect cavity at various thicknesses are also examined. From Eq. (9), any variation in the refractive index of defect cavity leads to a variation in the defect mode location. On other hand, as the thickness of defect cavity rises, the wave will have a longer geometric path through the cavity and a greater interaction occurs between the incident wave and the analyte. Therefore, the thickness of the defect cavity into a photonic crystal has a meaningful effect on the performance of bio-photonic detector (Aly and Zaky 2019). The sensitivity improved from 1376 to 2688.33 nm/RIU when the angle of incidence was set at θ0 = 80° (the optimal value) and the thickness of the defect cavity was adjusted from 500 to 7000 nm, as shown in Table 5. These findings are in line with a number of recently published articles. Figure 8 displays the sensitivity versus defect cavity thickness. As shown in Table 6, the QF and FOM fluctuate with increasing the thickness of the fault cavity. As demonstrated in Figs. 9 and 10, the greatest QF of 104,337.5 and FOM of 133,833.3 RIU−1 are found at defect cavity thicknesses of 5000 nm, respectively. Furthermore, it is obvious that the value of the detection limit fluctuates as the thickness of the defect cavity increases. The suggested detector has a DL of 5.2610–7 RIU at a defect cavity thickness of 5000 nm, as shown in Fig. 11.

Table 5 Variation of the suggested structure's resonant peak position and sensitivity with defect cavity thickness
Fig. 8
figure 8

Sensitivity (S) vs the defect cavity thickness (hd) of a proposed BPhC for TE mode at (h1 = 106.38 nm, h2 = 349.18 nm, n1 = 4.23, n2 = 1.2887, θ0 = 80°, nm and N = 4)

Table 6 Variation of \(FWHM\), \(QF\), \(FOM\) and \(DL\) of the proposed structure with the defect layer cavity thickness
Fig. 9
figure 9

Quality Factor (QF) vs the defect cavity thickness (hd) of a proposed BPhC for TE mode at (h1 = 106.38 nm, h2 = 349.18 nm, n1 = 4.23, n2 = 1.2887, θ0 = 80°, nm and N = 4)

Fig. 10
figure 10

Figure of merit (FOM) vs the defect cavity thickness (hd) of a proposed binary photonic crystal for TE mode at (h1 = 106.38 nm, h2 = 349.18 nm, n1 = 4.23, n2 = 1.2887, θ0 = 80°, nm and N = 4)

Fig. 11
figure 11

Detection Limit (DL) vs the defect cavity thickness (hd) of a proposed binary photonic crystal for TE mode at (h1 = 106.38 nm, h2 = 349.18 nm, n1 = 4.23, n2 = 1.2887, θ0 = 80°, nm and N = 4)

The low value of DL indicates that the suggested biosensor is capable of detecting even minor changes in the sensing layer's refractive index. It's worth noting that raising the defect cavity thickness above hd = 5000 nm results in a small increase in sensitivity. According to all of the parameters of S, QF, FOM, and DL, the best defect cavity thickness is hd = 5000 nm. This thickness is equal 5 m\(\mu\). By the way, the thickness of biological examination samples is often in micrometers. Therefore, it is preferable that the thickness of the sensing layer be in micro, and this is in agreement with many recently published researches (Daher et al. 2022b; Aly and Zaky 2019).

From the above analysis, we can conclude that performance of the suggested biosensor depending upon the thickness of defect cavity. The increase in the thickness of defect cavity leads to a significant improvement in performance parameters of the optical detector but that is not at all. The best efficiency of the detector is obtained at a certain thickness (optimal thickness), and then the performance declines with the increase in the thickness of cavity. In our proposed detector, the optimal thickness is found at 5000 nm.

When the normal cells of diabetes (NCD) and affected cells of diabetes (ECD) are treated as defect cavities in the suggested structure under the optimal circumstances, the expanded view of the transmittance spectra of the proposed BPhC is shown in Fig. 12. The defect peak is located at 1926.23 nm when the NCD is used as a defect cavity. When affected cells of diabetes (ECD) are used as a defect cavity, the defect peak shifts towards a higher wavelength of 2086.69 nm. The optimum sensitivity is calculated and then found as 2676.66 nm/RIU. Here, a high incident angle was employed as well as a high thickness of the defect cavity was considered. Also, the proposed photonic structure contained two periodic layers, the difference between their refractive indices being slightly large. As a result, the suggested detector achieves an ultra-high performance which is not achieved by many existing structures and approaches in this sector. Overall, Table 7 shows that the performance of our suggested biosensor is superior to that of these recently reported publications. Other advantages, the described detector features a simple structure, quick real-time detection, and a customizable design, making it an appropriate tool for diabetes diagnosis. Using the nanoimprint lithography technology, the suggested photonic structure can be produced with easily. The photonic crystal can be incorporated into a waveguide to describe the built system. A micro-gap is introduced between two equivalent numbers of cells can be treated as a defect cacity. The gap is filled with the analyte, and the structure is illuminated by a light source. To exhibit and examine the transmitted beam, an optical detector is necessary on the other side of the structure.

Fig. 12
figure 12

Transmittance spectra of a BPhC for TE wave at (h1 = 106.38 nm, h2 = 349.18 nm, hd = 5000 nm, n1 = 4.23, n2 = 1.2887, θ0 = 80°, nm and N = 4)

Table 7 Comparison performance of our detector with performance of the most recent biosensors

4 Conclusion

A biosensor based on a binary photonic crystal (BPhC) has been created for the detection of diabetes. The transmittance domains of the suggested structure are inspected using the transfer matrix approach. The developed biosensor is made of two layers of Ge and TiN that alternate, with the defect cavity acting as the sensing sample. The effect of changing the incidence angle and the cavity thickness on the performance of the suggested structure was examined. By moving the sensing sample from normal to sick cells, the defect peak is transferred to a higher wavelength. TE polarization outperforms TM polarization as the angle of incidence grows. In addition, increasing the defect cavity thickness improved the sensitivity of the suggested biosensor significantly. Our suggested biosensor has a high sensitivity of 2676.66 nm/RIU when the parameters are tuned. Furthermore, the suggested structure had a very high QF (104,337.5), a very high FOM (133,833.3 RIU−1), and a very low DL (5.26 \(\times {10}^{-7}\)) RIU. Finally, the described detector features a simple structure, quick real-time detection, and a customizable design, making it an appropriate tool for diabetes diagnosis.