Heavy metal Cadmium (Cd) will continuously pollute the atmosphere, soil and various water environments through material circulation, and even pose a threat to human safety. It has been designated as a first-class pollutant in sewage by China, therefore there is an urgent need to find new, more effective, and low-cost method to accurately detect Cadmium ion (Cd2+) concentration. We experimentally prepared a new Cd2+ sensor based on NiS₂ nanomaterials capable of measuring Cd2+ concentration. The corresponding relationship between over potential of NiS₂ nanomaterials in H₂SO₄ electrolyte solutions with different Cd2+ concentration and reduction peak with change of Cd2+ concentration was obtained by electrochemical method.