A series of nickel–cerium hydroxides was prepared via electrodeposition with a designed pH testing system to measure the pH change at the electrode/solution interface in situ. The nickel and cerium contents of these hydroxides were determined by inductively coupled plasma-atomic emission spectrometry. The results indicate that the ratios of Ce/Ni in the obtained nickel–cerium hydroxides have a functional relationship with the pH values of the electrode/solution interface. A thermodynamic study of the Ni–H2O and Ce–H2O systems also confirmed the functional relationship between these systems. Therefore, by adjusting the pH value of the electrode/solution interface using simply designed equipment, the speciation distribution of the two kinds of metal ions in electrodeposition compounds can be controlled approximately.