• This hybrid film is formed by the oxidative copolymerization of polydopamine and polyethyleneimine. • The enhanced effect of photoelectrochemical is due to the charge transfer ability of polydopamine and the electric attracting ability of polyethyleneimine. • The achieved photoelectrochemical enhancement effect is versatile for both photoanode and photocathode semiconductors. • The sensor has the ability to analyze ascorbic acid in actual samples. Photoelectrochemical (PEC) active interfaces exhibiting visible-light responses and good electron-transfer capabilities are key to the development of PEC biosensors. In this study, bioinspired polydopamine (PDA)–polyethyleneimine (PEI) hybrid films were designed to engineer inorganic semiconductors and construct PEC biosensing interfaces. The charge-transfer capability and visible-light-response property of PDA were combined with the electron-attracting ability of PEI to produce a synergistic PEC-enhancement effect. The achieved PEC-enhancement effect was versatile for photoanode and photocathode semiconductors. Further, the role of PEI doping was revealed via electrochemical investigations. Compared with the PDA sensing platform, the hybrid sensing interface offered by the PDA–PEI film exhibited enhanced analytical performances toward ascorbic acid (AA), achieving a larger detection range and a lower limit of detection.