Photoelectrochemical (PEC) detection as a potential development strategy for hydrogen peroxide and dopamine sensors has receivedextensive attentions. Herein, BiOI/ZnIn2S4-X (X = n (BiOI)/n(ZnIn2S4)) heterojunction was synthesized using various molar ratios via a two-step method. A series of characterization techniques were employed to analyze the composition, surface structure, valence state, and optical properties of BiOI/ZnIn2S4-X. The results show that BiOI/ZnIn2S4-X perform significantly better than both BiOI and ZnIn2S4. Furthermore, BiOI/ZnIn2S4-9% exhibits superior visible light absorption capacity and photocurrent response among all of the BiOI/ZnIn2S4-Xtested. Therefore, a PEC sensor was developed using BiOI/ZnIn2S4-9% for the detection of hydrogen peroxide and dopamine. The linear detection range for hydrogen peroxide spans from to 1 ~ 40,000 µM, with the LOD of 0.036 µM (S/N = 3). For dopamine, the corresponding values are 2 ~ 250 µM for the linear detection range, and 0.017 μM for the LOD, respectively. Thesensor exhibitsdemonstrates excellent stability, reproducibility and resistance to interference, enabling the detection of real samples and thus holds promising application potential.