A simple and easy method was implemented for the contemporary detection of cadmium (Cd2+) and lead (Pb2+) ions using 1,3,6,8-pyrenetetrasulfonic acid sodium salt-functionalized carbon nanotubes nanocomposites (PyTS–CNTs). The morphology and composition of the obtained PyTS–CNTs were characterized using scanning electron microscopy (SEM), energy dispersive spectrometry (EDS), and X-ray photoelectron spectroscopy (XPS). The experimental results confirmed that the fabricated PyTS–CNTs exhibited good selectivity and sensitivity for metal ion-sensing owing to the insertion of sulfonic acid groups. For Cd2+ and Pb2+, some of the electrochemical sensing parameters were evaluated by varying data such as the PyTS–CNT quantity loaded on the pyrolytic graphite electrode (PGE), pH of the acetate buffer, deposition time, and deposition potential. These parameters were optimized with differential pulse anodic sweeping voltammetry (DPASV). Under the optimal condition, the stripping peak current of the PyTS–CNTs/Nafion/PGE varies linearly with the heavy metal ion concentration, ranging from 1.0 μg L−1 to 90 μg L−1 for Cd2+ and from 1.0 μg L−1 to 110 μg L−1 for Pb2+. The limits of detection were estimated to be approximately 0.8 μg L−1 for Cd2+ and 0.02 μg L−1 for Pb2+. The proposed PyTS–CNTs/Nafion/PGE can be used as a rapid, simple, and controllable electrochemical sensor for the determination of toxic Cd2+ and Pb2+.