Modified polymer electrodes are of particular importance in analytical and environmental applications. The goal of this paper is the modification of a polymer surface for sensing applications and the detection of trace- metal ions in aqueous solution. This study offers a novel electrochemical sensing device to detection copper and cadmium ions, created via modifying a glassy carbon electrode GC with a polyimine based pyrrole by using square wave voltammetry. Polyimine polymer film was characterized and examined via Fourier transform infrared (FTIR) spectroscopy, cyclic voltammetry (CV), and scanning electron microscopy (SEM). Spectroscopic devices were employed to identify the chemical structure of the prepared monomer, such as FTIR, 1H NMR, 13C NMR, and mass spectroscopy. Furthermore, rate of scan effects on the electrical performance of the polyimine film was also examined. Electro- experimental data were employed to calculate coverage of surface’s substance and their electrical stability in blank solutions. Polyimine film thickness and the effects of (pH) of the medium were also investigated. Linear responses to Cu(II) and Cd(II) ions in the range of concentration (5 to 100 µg L− 1) were acquired. Limit of detection (LOD) for the assay of Cu2+ and Cd2+ ions were 1.81 µg L− 1 and 2.68 µg L− 1, respectively. Encouraging results above indicated that modified polyimine films could potentially represent a viable candidate for electrochemical-sensor technologies.