TiO2/vanadium pentoxide (V2O5) and TiO2–V2O5 coatings were prepared on type 304 stainless steel substrates via a sol–gel method, respectively. The TiO2/V2O5 coating is compared with the TiO2–V2O5 coating in terms of the photo-electrochemical performance. The two coatings can be stored with photogenerated electrons under UV irradiation in 3 wt% aqueous NaCl. The self-discharging time of the TiO2/V2O5 coating is slower than that of the TiO2–V2O5 coating. The slow discharging may be suitable for an anti-corrosion application for stainless steel. In the case while the two coatings are electrochemically charged under UV irradiation for 1 h, the TiO2/V2O5 coating can maintain a good cathodic protection for type 304 stainless steel for 6 h in the dark, while the TiO2–V2O5 coating can only maintain a good cathode protection for 0.5 h in the dark.