In order to improve the conversion and transmission efficiency of the photoelectron, core–shell spheroid structure titanium dioxide/cadmium sulfide (TiO2/CdS) composites were synthesized as epoxy-based coating fillers using a simple hydrothermal method. The electrochemical performance of photocathodic protection for the epoxy-based composite coating was analyzed by coating it on the Q235 carbon steel surface. The results show that the epoxy-based composite coating possesses a significant photoelectrochemical property with a photocurrent density of 0.0421 A/cm2and corrosion potential of −0.724 V. Importantly, the modified composite coating can extend absorption in the visible region and effectively separate photoelectron hole pairs to improve the photoelectrochemical performance synergistically, because CdS can be regarded as a sensitizer to be introduced into TiO2to form a heterojunction system. The mechanism of photocathodic protection is attributed to the potential energy difference between Fermi energy and excitation level, which leads to the system obtaining higher electric field strength at the heterostructure interface, thus driving electrons directly into the surface of Q235 carbon steel (Q235 CS). Moreover, the photocathodic protection mechanism of the epoxy-based composite coating for Q235 CS is investigated in this paper.