Figure 5b illustrates the relationship between the photocurrent and the concentration of glucose injected into the electrolyte. Glucose was continuously injected into the electrolyte while the solution was stirred, resulting in an enhancement of the device photoresponse with increasing glucose concentration. A linear correlation was established between the photocurrent and glucose concentration (
Fig. 5c), and the regression equation (I in µA cm
−2 = 6.226 + 0.173 C
glucose in µmol L
−1) was derived. The linear relationship displays a high correlation coefficient (
R2) of 0.997. Notably, the device demonstrates a remarkable sensitivity with a value of 0.173 µA µM
−1 cm
−2, along with a low detection limit (LOD) of 0.07 µM (S/N = 3). These results establish a solid foundation for the quantitative determination and detection of glucose. The glucose sensing performance of the
p-
n GaN/CoNiO
x was compared with those of reported glucose sensors and summarized in Table S2. Compared with other sensors, our device exhibits higher sensitivity and lower detection limit in the detection of glucose. These are attributed to remarkable device stability and excellent glucose catalytic activity. Moreover, compared with most sensors, our device operates under self-powered conditions, which exhibit greater application potential. Moreover, to evaluate the reproducibility, five
p-
n GaN/CoNiO
x photoelectrodes were prepared using identical conditions, yielding a calculated relative standard deviation (RSD) of 3.27% (
Fig. 5d). Additionally, to assess the long-term stability of the PEC sensing system, the constructed photoelectrode was stored under dry conditions at room temperature. The photoresponse was recorded every 2 days, revealing that the photoelectrode maintained 91% of its initial photoresponse over a 20-day storage period (
Fig. 5e). In Fig. S12, SEM images exhibit the morphology of the freshly fabricated
p-
n GaN/CoNiO
x nanowires and the morphology after undergoing 20 days of stability testing. Impressively, the nanowire structure remains nearly unchanged, demonstrating excellent corrosion resistance. Furthermore, we also assessed the selectivity of the glucose sensor. In real glucose sensing conditions, there are other compounds such as fructose, lactose, maltose, urea, and uric acid [
63]. The presence of these coexisting compounds can introduce interference and impact the accuracy of glucose sensing. In Fig. S13, we initially added glucose to the electrolyte and observed an increase in current. Subsequently, we sequentially added fructose, lactose, maltose, urea, and uric acid to the solution, but no significant change in current was observed. When glucose was reintroduced to the mixed solution, the current once again exhibited a prominent increase.
Figure 5f displays the currents obtained when adding different compounds, as well as the current difference (∆Current) each time a new compound is added (data are extracted from Fig. S13). The ∆Current caused by glucose is significantly greater than those of other interfering compounds at equivalent concentrations. Hence, the interference from these coexisting compounds is negligible, indicating the high selectivity of glucose sensing and verifying the selective catalytic effect of CoNiO
x on glucose detection. Finally, the constructed sensor was utilized to examine the glucose levels in human serum. Three human serum samples were obtained, and without any pretreatment, only the serum was diluted in electrolytes before testing. The glucose concentrations measured are shown in
Table 2, which are acceptable compared with the values measured at the local hospital. These results provide compelling evidence for the reliability of the fabricated PEC sensor in accurately detecting glucose levels in real human blood serum, demonstrating its practical potential for PEC biosensing applications.