PurposeThis study aims to report the development and experimental evaluation of two kinds of PANI@semiconductor based photocathodic anti-corrosion coating, for application on stainless steel substrates.Design/methodology/approachPANI was in situ chemical polymerized on TiO2 and BiVO4 particles, and FT-IR and SEM/EDS were used to understand the characteristics and elemental distribution of the composite particles. Composite coatings, which consisted of epoxy, PANI@TiO2 or PANI@BiVO4 and graphene, were prepared on the 304L stainless steel. Photoelectrochemical response measurement, electrochemical tests and immersion tests were used to assess the anti-corrosion performance of the prepared coatings in 45°C 3.5 wt.% NaCl solution. And the corrosion protection mechanism was further explained by combining with surface observation.FindingsThe photoelectrochemical response tests revealed the good photocathodic effect of the coatings, and the reversible oxidation-reduction properties of PANI (pseudocapacitive effect) leading to the repeated usage of the coatings. Consequently, the anti-corrosion mechanism of the composite coating is attributed to the physical barrier effect of the coating, the anodic protection effect of PANI and the photocathodic and energy store effect.Originality/valueThese kind coatings could prevent corrosion from day to night for stainless steel, which has great engineering application prospects on stainless steel corrosion protection.