In this paper, a novel, facile and self-operating photocathode based on hemin sensitized three-dimensional (3D) nanoporous NiO was developed. Compared with pure NiO nanomaterials, the as prepared hemin sensitized NiO photocathode showed enhanced cathodic photocurrent under visible-light irradiation (λ≥400nm). The cathodic photocurrent was sensitively and selectively enhanced upon the addition of H2O2. The common interferents such as ascorbic acid, dopamine, and glutathione, caused less than 10% of the photocurrent change compared with the photocurrent response of the same concentration (2.0×10−5mol/L) of H2O2 on ITO/NiO/hemin electrode, indicating good selectivity of the method. The ITO/NiO/hemin electrode showed a linear range of 0.5–500μmol/L with a low detection limit of 0.1μmol/L (S/N=3) for the detection of H2O2. In addition, the method was also successfully applied to the detection of H2O2 in real samples.