In this work, we explored way to improve the photocatalytic hydrogen production activity of C3N5. A spot of CdS precursor was doped into the prepared porous C3N5 precursor, and CdS/C3N5 compounds were synthesized by hydrothermal method. Compared with C3N5, the absorption range of the CdS/C3N5 materials decreased slightly (1.765 eV), but the charge carrier mobility increased. And the electron-hole recombination rate greatly decreased via heterojunction Type-I, which resulted in the better photocatalytic performance. Experimental results show that the optimal CdS/C3N5 can produce hydrogen more than 4 times than pure C3N5, and the stability is far better than that of single photocatalytic material.