## 3 Results and Discussion  
### Composition, Morphology, and Structure Analysis  
Figure 1 presents the diffraction data for CdS/g-C\({}_{3}\)N\({}_{4}\) composites prepared at various ratios alongside those of porous g-C\({}_{3}\)N\({}_{4}\) and CdS individually. With Jade 6 software, thethree typical diffraction peaks at 20 = 13.0\({}^{\circ}\), 27.7\({}^{\circ}\)and 39.9\({}^{\circ}\) for porous g-C\({}_{3}\)N\({}_{4}\) were assigned to the (100), (110), and (101) crystal planes of g-C\({}_{3}\)N\({}_{4}\), respectively (Powder Diffraction File 50-1250). CdS exhibited three distinct peaks at diffraction angles of 20 = 26.507\({}^{\circ}\), 43.681\({}^{\circ}\), and 51.824\({}^{\circ}\), corresponding to the (002), (110), and (112) planes of the hexagonal CdS structure (Powder Diffraction File 41-1049). For the composite materials, characteristic peaks from both g-C\({}_{3}\)N\({}_{4}\) and CdS were evident, confirming the effective formation of the CdS/ g-C\({}_{3}\)N\({}_{4}\) heterostructure without impurity phases. With increasing CdS content, the intensity of the CdS peaks became more pronounced, indicating improved crystallinity in the CdS phase. Conversely, the relative intensity of the g-C\({}_{3}\)N\({}_{4}\) diffraction peaks decreased, suggesting that the g-C\({}_{3}\)N\({}_{4}\)structure became less dominant as CdS occupies a larger fraction of the composite. This could be attributed to the higher crystallinity of CdS, which masked the diffraction signals from g-C\({}_{3}\)N\({}_{4}\). Moreover, the observed shifts in peak positions or broadening at higher CdS ratios may result from lattice strain introduced by the interactions occurring between CdS and g-C\({}_{3}\)N\({}_{4}\). Such structural modifications are likely to facilitate improved charge transfer across the heterojunction, which is essential for boosting photocatalytic performance. This enhancement in charge dynamics also correlates with increased light absorption, as will be further explored in relation to the material's charge carrier behavior. The FT-IR analysis (Figure 2) of porous g-C\({}_{3}\)N\({}_{4}\) and CdS/g-C\({}_{3}\)N\({}_{4}\) revealed only slight shifts in characteristic peak positions, confirming that the core structural features of g-C\({}_{3}\)N\({}_{4}\) were preserved post-CdS incorporation. The band observed at 810 cm\({}^{-1}\) was associated with the bending vibration of the C-N heterocyclic structure, a characteristic feature of the tri-s-triazine framework [27]. Five distinct signals were identified at 1235 cm\({}^{-1}\), 1322 cm\({}^{-1}\), 1423 cm\({}^{-1}\), 1572 cm\({}^{-1}\), and 1640 cm\({}^{-1}\), which are attributed to the characteristic vibrational modes of the C-N framework [28], corresponding to C-H, C-H, C=N, C=N, and N=C-H, respectively. It has been established that porous g-C\({}_{3}\)N\({}_{4}\) has an abundance of chemical groups at 3000-3500 cm\({}^{-1}\) where amino groups can be bonded to either anions or cations to assist in anchoring the perovskite. Therefore, it is inferred that the broad band observed in the composite arises from NH\({}_{2}\) groups present at the terminal of porous g-C\({}_{3}\)N\({}_{4}\), combined with the stretching vibrational modes associated with defects in the aromatic structure. Furthermore, the composite exhibits a peak around 661 cm\({}^{-1}\), likely resulting from bonding interactions between Cd and S. The CdS/g-C\({}_{3}\)N\({}_{4}\) composite exhibited reduced absorption intensity in the 3000-3500 cm\({}^{-1}\) range. The characteristic tensile mode intensities associated with C-N and C=N bonds within the heterocycles, observed in the 1000-1750 cm\({}^{-1}\) range, showed a progressive decrease in the increased loading of CdS. This reduction can be  
Figure 1: XRD patterns of (**a**) porous g-C\({}_{3}\)N\({}_{4}\), CdS, and composites with diverse ratios and (**b**) partially enlarged. The dashed circle in (**a**) highlights the region where CdS peaks become more pronounced with increasing CdS content, indicating improved crystallinity in the CdS phase.