A novel ionic liquid (IL) (1-octyl-3-propyl-1H-imidazole-3-ium iodide) was synthesized and used as a corrosion inhibitor for battery electrodes in 34% H2SO4 solution because IL compounds have high ionic conductivity and superior adsorption capabilities. Fourier transform infrared spectroscopy (FT-IR) and proton nuclear magnetic resonance (1H NMR) spectroscopy were used to identify the novel IL. According to electrochemical measurements, IL molecules adsorption on the electrode surface of the battery increased the charge transfer resistance, which in turn enhanced the inhibition efficiency, which reached 91.64% in the electrochemical impedance spectroscopy (EIS) and 87.70% in the electrochemical frequency modulation (EFM) technique. The adsorption of IL molecules on the surface of the battery electrode is demonstrated by several surface morphology investigations. The battery tests were performed using Pb–Ca alloy as the working electrode. Results of the tests indicated an increase in both electrical capacity efficiencies from 84.66 to 97% and reserve capacity from 50 to 60 min. Thus, this IL compound can improve the battery performance if used as an electrolyte additive.