In this paper, PDAn/CeO2/In2S3-X (X = m(CeO2)/m(CeO2 +In2S3), n = m(PDA)/ m(catalyst)) heterojunction was successfully fabricated by three steps to detect glucose and hexavalent chromium (Cr(VI)). CeO2 was initially synthesized by calcination, followed by a hydrothermal method to make In2S3 compounded with CeO2. Specifically, by optimizing the ratio of CeO2 and In2S3, CeO2/In2S3-15 % showed the best photoelectric responses and sensing performances. In order to further improve the performance, polydopamine (PDA) was modified on the surface of CeO2/In2S3-15 % (PDAn/CeO2/In2S3-15 %). Besides, the results from optical characterizations and performance testings showed that PDA0.1/CeO2/In2S3-15 % exhibits the best absorption capacity and photocurrent responses. Interestingly, PDA0.1/CeO2/In2S3-15 % was applied to detect Cr(VI) and glucose in an effective fashion. The PEC glucose sensor based on PDA0.1/CeO2/In2S3-15 % showed an acceptable detection range between 0.5 μM and 27 mM with good sensitivity (575.20 µA·mM−1·cm−2) and low detection limit (0.076 μM). Meanwhile, for Cr(VI) sensing, it has a wide linear range of 0.5–240 µM with a high sensitivity of 1053.60 µA·mM−1·cm−2, and the low detection limit is 0.098 µM. Furthermore, it could be also employed in real samples (human blood serum or sewage). Thus, the PEC sensor based on PDA/CeO2/In2S3 has potential applications in glucose and Cr(VI) detection.