Introduction

Cast iron is an essential material that is used in masonry buildings, car engines, gears, door steps, cooking wares and flywheels. It is also used in textile mills due to its toughness, durability, conductivity and tensile strength properties. The corrosion behaviour of cast iron in acidic media is an area of great interest due to its importance in applications. Acid solutions are widely used in pickling, refining crude oil, descaling and cleaning processes [13]. Corrosion of metal is very serious issue for the quality of metals, and losses due to them are incredible. It is required to reduce or control corrosion of metals. Corrosion can be blocked entirely only under ideal conditions, but the achievement of ideal conditions is impossible. However, it is possible to decrease corrosion considerably. One of the common ways of dealing with this trouble is based on the use of synthetic organic compounds as corrosion inhibitors in acidic media [46]. Many of them are highly toxic, expensive and cause severe environmental hazards. Therefore, the study of ncompounds that are less of non-toxic, cheap and have low or zero environmental impact is important to overcome this problem [79].

In recent years, drug molecules have been studied widely as a potential candidate for the inhibition of metal corrosion. To date, only a few eco-friendly pharmaceutical compounds have been investigated as corrosion inhibitors. For example, penicillin G [10], amoxycillin [11], floxacillin [12], secnidazole [13], ampicillin [14], cloxacillin [15], cefazolin [16], cefatrexyl [17], mebendazole [18], streptomycin [19], doxycycline [20], orphenadrine [21], ethambutol [22], cefotaxime [23], captopril [24], amlodipine besylate [25], meropenem [26] and rhodanine [27] drugs have been found to be efficient corrosion inhibitors for acidic solution. Likewise the use of expired drugs as non-toxic corrosion inhibitors for mild steel and Al in acidic media was reported by Abdel Hameed [28, 29]. Al-Shafey et al. [30] have reported on expired phenytoin sodium drugs as effective inhibitors for carbon steel in 1 M HCl solution. Also, expired carbamazepine and paracetamol tablets have been used as good inhibitors for carbon steel corrosion [31].

In view of the above, in this study, four expired pharmaceutical compounds were examined for corrosion inhibition of cast iron in acidic medium using chemical and electrochemical methods. Various adsorption isotherms were plotted to expose the inhibition mechanism. The effect of halide ions on the inhibition efficiency of the inhibitors has also been analysed. The observation of the protective film formation on the metal surface during the inhibition process prompted us to analyse scraped samples by means of FT-IR, UV–Vis, FE-SEM and WA-XRD analysis. The tested drugs are in the antibiotic category, used to treat many kinds of infections in their active state such as bacterial eye infection and urinary tract infection. These drugs are cheap, non-toxic and eco-friendly as well as possessing different hetero-atoms like nitrogen and oxygen which make them good corrosion inhibitors.

Experimental

Preparation of specimen

The specimens of cast iron utilized for the studies has the composition (wt%) C, 6.09; Al, 1.13; Mn, 0.78, and the remainder being Fe. The specimens were mechanically press-cut into 1 × 1.5 × 0.02 cm size, and used for weight loss measurements, while specimens with 1 × 1 cm2 dimensions were employed as working electrodes for electrochemical studies and SEM analysis. Prior to all measurements, the cast iron specimens were abraded with a series of emery papers up to 1200 grade. They were then washed thoroughly with double-distilled water, degreased with acetone and dried in moisture-free desiccators.

Preparation of solution

The aggressive solution (1 M HCl; Merck) was prepared by dilution of AR grade 37% HCl with distilled water. Active drugs (inhibitors) about to expire [cefpodoxime (CF), levofloxacin (LV), ofloxacin (OX) and linezolid (LZ)] were from Ranbaxy Pharmaceutical and stored at room temperature. After the specific expiry date, the drugs were evaluated for their corrosion inhibition properties. Their chemical structures are shown in Fig. 1. The inhibitors were dissolved in distilled water and the concentration range was varied from 30 to 240 ppm. Solutions of 0.01% of the halides (KI and KCl; Merck) were prepared in a blank solution and in 240-ppm inhibitor solutions. The concentration range of the halides used was 2–14 ppm.

Fig. 1
figure 1

Chemical structure of inhibitors, CF cefpodoxime, LV levofloxacin, OX ofloxacin, LZ linezolid

Chemical method

The weight loss experiments were performed according to a similar procedure illustrated in our earlier reports [3234]. In brief, the cast iron specimens as described above were dried and weighed. They were then immersed in 100 mL of 1 M HCl without and with various concentrations of the tested inhibitors at different temperaturse. After 2 h of exposure, the specimens were withdrawn, rinsed with distilled water, washed, dried and weighed accurately using a Shimadzu AUX320 type balance. Three measurements were made in each case and the average value of the weight loss was taken. The inhibition efficiency (IE%) and corrosion rate were determined from

$$I\% = \frac{{W_{\text{blank}} - W_{\text{inhib}} }}{{W_{\text{blank}} }} \times 100$$
(1)
$$C_{\text{R}} = \frac{{87.6 \times W_{\text{blank or inhib}} }}{ATD}$$
(2)

where, \(W_{\text{blank}}\), \(W_{\text{inhib}}\) are the weight loss values of the cast iron specimens in the absence and presence of the inhibitors. A is the area of the specimen (cm2), T is the exposure time (h), and D is the density of the specimen.

Electrochemical method

The electrochemical measurements were conducted using a CHI 760C electrochemical analyser consisting of platinum as the counter electrode, saturated calomel (SCE) asthe reference electrode, and the cast iron specimen as the working electrode. Before starting the experiments, the working electrode was immersed in a test solution for 45 min until a steady-state open circuit potential was attained. All electrochemical measurements were carried out at 298 K.

Tafel polarization curves were made by changing the electrode potential from −0.2 to −0.8 V versus the open circuit potential (OCP) at a scan rate of 0.01 V s−1. The inhibition efficiency (IE%) was calculated by the following equation:

$$IE\% = \frac{{I_{\text{blank}} - I_{\text{inhib}} }}{{I_{\text{blank}} }} \times 100$$
(3)

where \(I_{\text{blank}}\)and \(I_{\text{inhib}}\) are the corrosion current density values of the cast iron specimen in the absence and presence of the inhibitors.

The electrochemical impedance spectroscopy (EIS) experiments were carried out at OCP in the frequency range 104–101 Hz, and the AC signal was 0.005 V in amplitude. EIS diagrams are given in the Nyquist representation (Z real vs. Z imaginary). For the analysis of impedance spectra, the standard Randles circuit (Fig. S1) was used. The inhibition efficiency was estimated from the following relationship:

$$IE\% = \frac{{ R_{\text{ct,inhib}} - R_{\text{ct,blank}} }}{{R_{\text{ct,inhib}} }} \times 100$$
(4)
$$C_{{{\text{dl}} }} = \frac{1}{{2\pi R_{\text{ct}} f_{ \hbox{max} } }}$$
(5)

where R ct,inhiband R ct,blank are the charge transfer resistance in the presence and absence of the inhibitors, respectively, C dl is the double-layer capacitance, and f max is the frequency at the maximum in the Nyquist plot.

Spectroscopic studies

To examine the interaction between the cast iron surface and the inhibitor molecules, cast iron scraps were produced according to the literature method [35, 36]. In brief, the cast iron specimens were immersed for 2 h in a 1-M HCl solution containing a 240-ppm concentration of inhibitors. Then, the specimen was taken out, washed with distilled water and dried under vacuum for 48 h at room temperature. The inhibitor adsorbed onto the cast iron surface was scraped off carefully using a knife and collected [36]. The scraped samples were designated as Inhads. Both the inhibitors and the corresponding Inhads were subjected to FT-IR (Perkin Elmer spectrometer) and UV–Vis spectra (PG Intruments model T90+ spectrophotometer).

Field emission scanning electron microscopy (FE-SEM)

In order to discover the surface morphological changes, the test specimens were dipped in 100 mL of 1 M HCl solution both in the presence and absence of the inhibitor (240 ppm) for 2 h. After the termination of the experiment, the specimen was removed, washed, dried and analysed without any further treatment by FE-SEM (Hitachi model-3000H).

Wide-angle X-ray diffraction (WA-XRD)

During WA-XRD analysis, the inhibitors and Inhads were studied by using a Rotaflex RTP300 X-ray diffractometer (Rigaku, Japan). The instrument was controlled at 50 kV and 200 mA with an angular range of 5° < 2θ < 70° at room temperature. Nickel-filtered Cu Kα radiation was used for the measurements.

Results and discussion

Chemical method (weight loss measurements)

Effect of inhibitor concentration

The values of the corrosion rate (C R), surface coverage (θ), and inhibition efficiency (IE%) obtained from the weight loss method at various concentrations (30, 60, 120, 180, and 240 ppm) of inhibitor for 2-h immersions are summarized in Table S1. This shows that the addition of an inhibitor to the acidic solution retarded the corrosion rate of the cast iron and that the extent of the retardation is concentration-dependent [3739]. It is clear that the tested inhibitors efficiently inhibit the corrosion rate of cast iron in 1 M HCl. Figure 2 shows that the values of inhibition efficiency increased with an increase in inhibitor (CF, LV, OX and LZ) concentration at 298 K. This may be because increasing the concentration of the inhibitor increased the availability of electron-donating atoms like sulfur, oxygen, nitrogen and aromatic rings. The results support the assumption that the cast iron surface can be well covered by inhibitor molecules at 240 ppm at 298 K. The inhibition efficiency achieved by the inhibitors at various concentrations decreases in the following order CF > LV > OX > LZ.

Fig. 2
figure 2

Effect of inhibitor concentration on inhibition efficiency

Effect of temperature

Temperature is an essential factor in studies of metal dissolution. The values of the corrosion rate (C R), surface coverage (θ) and inhibition efficiency (IE%) of different concentrations of inhibitors over a temperature range 298–328 K are reported in Table 1. It can be seen that the corrosion rate for all the inhibitors rises with increasing temperature, while the surface coverage and inhibition efficiency are reduced. This may be due to the fact that the inhibitor molecules are adsorbed through weak van der Waals forces (physisorption) on the cast iron surface. The increase of the temperature might cause an enhanced rate of desorption of inhibitor molecules from the metal surface for all the inhibitors [34]. The inhibition efficiency of the examined inhibitors at different temperatures followed this order: CF > LV > OX > LZ.

Table 1 Inhibition efficiency of inhibitors in different concentrations for the cast iron corrosion in 1 M HCl at different temperatures from weight loss measurements

Effect of immersion time

Table S2 and Fig. 3 give the results of inhibition efficiency for optimum inhibitor concentrations at different immersion periods (2, 4, 6, 8, and 24 h). Inspection of the Table and the Figure reveals that the linear decrease in inhibition efficiency with time in inhibited solutions signals the absence of insoluble surface films during corrosion. This result clearly explains that the inhibitors are first adsorbed on the cast iron surface and then impede corrosion either by merely blocking the reaction sites (cathodic and anodic) or by changing the mechanism of the cathodic and anodic processes [40]. In all cases, the IE% values continued to reduce and no improvement in IE% values was noticed. Therefore, the studied inhibitors (CF, LV, OX, and LZ) can perform as potential inhibitors at 2 h of immersion.

Fig. 3
figure 3

Effect of immersion time on inhibition efficiency

Adsorption isotherm

The interaction between the metal surface and the inhibitor can be expressed by the adsorption isotherms. The surface coverage (θ) values have been calculated from the weight loss and electrochemical methods as a function of the temperature of the inhibitors. The θ values for different concentrations of inhibitor at various temperatures were tested by fitting to different adsorption isotherms including Langmuir, Temkin, Frumkin and Freundlich. The linear correlation co-efficient (R 2) value is almost unity for both methods used in this investigation. Therefore, all inhibitors best fitted the Langmuir adsorption isotherm. Figure 4 shows the Langmuir adsorption isotherm for the weight loss data. This isotherm supposed that the adsorbed molecules occupied only one site and that there was no interaction with other molecules adsorbed. This isotherm can be represented as in the following equation [41]:

$$\frac{{C_{\text{inh}} }}{\theta } = \frac{1}{{K_{\text{ads}} }} + C_{\text{inh}}$$
(6)

where \(C_{\text{inh}}\) is the concentration of the inhibitor, θ is the surface coverage, K ads is the equilibrium constant for adsorption–desorption process.

Fig. 4
figure 4

Langmuir adsorption isotherm of different inhibitors on the cast iron surface in 1 M HCl

The slope values of all the inhibitors at all the tested temperatures are reported in Table 2. The variation of the slope from unity is often taken as meaning that the adsorbing species fills a more or less distinctive adsorption site at the metal–solution interface. From this result, we can conclude that the number of adsorbed species on the metal surface with the increase of inhibitor concentration at different temperatures increases up to saturation conditions, at which point a monolayer of adsorbate may be produced.

Table 2 Thermodynamic parameters for the cast iron in 1 M HCl in the presence of the inhibitors (240 ppm) at different temperatures

Thermodynamic parameters

The values of thermodynamic parameters can give important information about the mechanism of corrosion inhibition. The thermodynamic functions (K ads, ∆G ads, ∆H ads, ∆S ads) were calculated at different temperatures by the following equations:

$$\Delta G_{\text{ads}} = - RT\ln \left( {55.5K_{\text{ads}} } \right)$$
(7)
$$\Delta H_{\text{ads}} =\Delta G_{\text{ads}} - T\Delta S_{\text{ads}}$$
(8)
$${\text{Intercept}} = \log \frac{R}{Nh} + \frac{{\Delta S_{\text{ads}} }}{2.303R}$$
(9)

where ∆G ads is the standard free energy of adsorption, R is the gas constant (8.314 J K−1 mol−1), T is the absolute temperature, 55.5 is the concentration of water in the solution, ∆H ads and ∆S ads are the standard heat and entropy of adsorption, respectively N is Avagadro’s number, and h is Planck’s constant.

It is well known that K ads designates the adsorption and desorption power of an inhibitor onto the iron surface. For inhibitor CF at all temperatures (except 328 K), the adsorption–desorption constant values reduced, clearly indicating that the inhibitor might have been physically adsorbed onto the iron surface. Meanwhile, for inhibitors LV and OX at all temperatures (except 318 and 328 K), the K ads values decreased indicating that these inhibitors were also adsorbed onto the iron surface by physisorption [42]. In the case of inhibitor LZ, the K ads value increased with increasing temperature which may indicate possible chemisorptions of inhibitor molecules on the iron surface [34]. However, the IE% of all the inhibitors diminished with increasing temperature, showing that the inhibitor molecules were adsorbed predominantly by physisorption. The corrosion inhibition of the drug inhibitors for iron surfaces may be clarified via a thermodynamic model, so the free energy, the standard heat and standard entropy of adsorption have been calculated and given in Table 2. In the present study, the negative values of ∆G ads demonstrated that the adsorption of the inhibitor molecules on the cast iron surface is a spontaneous process. Generally, ∆G ads values around −20 kJ mol−1 or lower are consistent with physisorption (electrostatic interaction), while those around −40 kJ mol−1 or higher are associated with chemisorption. The value of ∆G ads of the tested inhibitors was found in the range −17.39 to −20.26 kJ mol−1, implying that the inhibitor molecules adsorbed on the iron surface by electrostatic interaction (physisorption). This conclusion is also supported by effect of temperature as discussed above. The values of K ads and ∆G ads calculated from the Tafel and EIS methods are in good agreement with the weight loss measurements. The negative value of ∆H ads signifies that the adsorption process is exothermic, which means that IE% decreases with the increase in emperature. An exothermic process (∆H ads < 0) may involve either physisorption or chemisorption or a mixture of both. In our case, the ∆H ads value for all inhibitors was obtained between −15.52 and −46.25 kJ mol−1 (Table 2), which is less than zero, suggesting that an intermediate case (physisorption and chemisorption) might occur. On the other hand, the magnitude of ∆H ads is larger than the common physisorption, but less than the common chemisorption, possibly meaning that both physical adsorption and chemical adsorption occur [42, 43]. The negative values of standard entropy (∆S ads) might be prior to the adsorption of the inhibitors onto the iron surface and that the inhibitor molecules travel freely in the bulk solution (the inhibitor molecules were disordered), but with the progress in the adsorption, the inhibitor molecules were systematically adsorbed onto the iron surface and effect a reduction in entropy [44].

Activation parameters

The activation parameters such as activation energy (E a), activated enthalpy (∆H*), and the activated entropy (∆S*) were calculated similar to our previous report, and the values are shown in Table S4. The results indicate that the ∆H* and E a values were close to each other, which is based on transition state theory, and both the parameters are similarly proportional to the inhibitor concentrations. The negative signs of ∆S* indicate that the adsorption processes in this study were exothermic in nature [45].

Effect of halide ions

Halide ions make possible the adsorption of inhibitors in acidic media by producing intermediate bridges between positively charged inhibitor molecules and the metal surface [46, 47]. Figure S2 shows the results of the addition of halide ions (KX, X = Cl and I) to the inhibitor solution so as to study the effect of halide ions at 298 K. The IE% for the inhibitors alone and in combination with KX were calculated and are summarized in the Table S3. Inspection of the Fgure and Table shows that the IE% of the examined inhibitors decreases significantly with the addition of low concentrations (2–8 ppm) of halide ions due to an antagonistic effect. However, considerable increases in IE% were noted with the addition of high concentrations (10 and 14 ppm) of halide ions to the inhibitors. Umoren et al. [48] observed that the addition of halide ions to the inhibitors antagonized the inhibition of mild steel in an acidic environment. This synergistic effect improved in the order Cl < I, indicating a possible role for the radius of the halide ions, which also enhances in the order Cl (0.09 nm) < I (0.135 nm).

Electrochemical methods

Tafel polarization measurements

Figure 5 demonstrates the Tafel polarization curves for cast iron in 1 M HCl with and without the addition of different concentrations of inhibitors at 298 K. The important corrosion parameters such as corrosion current density (I corr), cathodic Tafel slope (b c ), anodic Tafel slope (b a ), corrosion potential (E corr ), and its corresponding inhibition efficiency (IE%) found from these curves are given in Table 3, from which it is understandable that the corrosion current density (I corr) decreased in the presence of different inhibitors (CF, LV, OX and LZ) more than in their absence. It can be clearly concluded that the values of I corr are decreased while the IE% increased with increasing inhibitor concentration from 30 to 240 ppm. It can also be observed that the cathodic and anodic Tafel slopes were not much affected, denoting that the inhibiting action of these inhibitors has arisen by merely blocking of the available surface area through adsorption. In other words, the tested inhibitors reduced the surface area available for anodic dissolution and hydrogen evolution without changing the reaction mechanism [49]. The shift of the E corr values is not more than 85 mV, hence the studied inhibitors may be classified as mixed-type. The IE% demonstrates the same trend as those achieved from the weight loss measurements (Table S1) i.e., CF > LV > OX > LZ.

Fig. 5
figure 5

Tafel polarization plot for cast iron in the absence and presence of different concentrations of inhibitors at 298 K

Table 3 Tafel polarization parameter values for the cast iron corrosion in 1 M HCl in the absence and presence of inhibitors at 298 K

Electrochemical impedance spectroscopy measurements

Nyquist diagrams obtained for cast iron in the presence and absence of different concentrations of inhibitors are shown in Fig. 6. Electrochemical parameters such as charge transfer resistance (R ct), double-layer capacitance (C dl) and frequency maximum (f max) and the corresponding IE% are listed in Table 4, from which it can be seen that the increase in R ct value as a function of concentration is attributed to the formation of a protective film on the metal–solution interface [50, 51]. The decrease in C dl is ascribed to enhancing the thickness of the electronic double-layer [52]. It is also obvious from Fig. 6 that the Nyquist plots of cast iron contain a depressed semi-circle, clearly showing that the corrosion of cast iron in acidic medis is mainly controlled by a charge transfer process [53]. Moreover, the diameter of the Nyquist plot is increased by increasing the inhibitor concentration, indicating that the formed protective film was strengthened by the addition of the inhibitor. This consequence has been clarified by the smaller adsorption capability of chloride ions on the cast iron surface which results in the availability of more sites on the iron surface in acid solution. Therefore, the IE% of the inhibitors increased with increasing the inhibitor concentration in 1 M HCl medium [41]. The IE% exhibits the similar tendency as those attained from the weight loss and Tafel methods. i.e., CF > LV > OX > LZ. The Bode-phase plots are shown in Fig. S3. The results indicate that there is an increase of impedance values over the whole frequency region. The inhibition mechanism in this study involved two relaxation time constants. One is attributed to the relaxation of the electrical double-layer capacitor and the other is due to the relaxation of adsorbed inhibitor molecules.

Fig. 6
figure 6

Nyquist plot of EIS measurements for cast iron in the absence and presence of different concentrations of inhibitors at 298 K

Table 4 Electrochemical impedance spectroscopic parameters for the cast iron corrosion in 1 M HCl in the absence and presence of inhibitors at 298 K

Inhibition mechanism

Compounds containing hetero-atoms with high electron density such as sulfur, nitrogen, oxygen or those having multiple bonds or aromatic rings, known as major adsorption centres, are effective in blocking the corrosion active sites. The inhibitive effect of organic compounds depends upon the molecular size, shape, structure, functional groups, aggressive medium and nature of the metal [47, 49]. Generally, the adsorption of inhibitors on the metal surface in acidic media may be as follows:

  1. 1.

    Physical adsorption due to inhibitor molecules can be adsorbed on the metal surface via electrostatic interaction between the protonated inhibitor molecule and the charged metal surface.

  2. 2.

    Chemical adsorption occurs by the donor–acceptor interactions between the free electron pairs of the heteroatoms or the π electron of the aromatic rings and vacant d-orbitals of iron [49].

  3. 3.

    Combination of (1) and (2). In the present case, the standard free energy of the adsorption (∆G ads) values vary between −17.39 and −20.26 kJ mol−1, hence showing that the adsorption mechanism of the inhibitor molecules on the cast iron surface in 1 M HCl is a physical adsorption. Even so, it is apparent from Table 2 that the values of ∆G ads decreased at elevated temperatures. This result confirms that the adsorption of inhibitor molecules is not favoured at higher temperatures. Furthermore, the inhibiting action of the investigated inhibitors in acidic media can be explained as the results found from weight loss, Tafel polarization and electrochemical impedance spectroscopic measurements showing that the extent of corrosion inhibition of the inhibitors followed the order: CF > LV > OX > LZ. CF exhibits a higher inhibition efficiency than the others due to its higher molecular weight (427.45 g mol−1) wihch makes for better surface coverage. It also has a higher number of adsorption centres (2-sulfur, 5-nitrogen and 6-oxygen atoms) than other inhibitors. LV (3-nitrogen and 4-oxygen atoms) comes after CF in IE%, for the reason that it has smaller molecular weight (361.36 g mol−1). The remaining inhibitors, OX (3-nitrogen and 4-oxygen atoms) and LZ (3-nitrogen and 4-oxygen atoms), have shown the smallest IE%, which is because of their low molecular weights (361.36 and 337.34 g mol−1) and their low number of adsorption centres.

FT-IR spectroscopy

To analyse the types of interaction (chemisorption and physisorption) of the inhibitors with the cast iron surface in 1 M HCl, FT-IR spectra were recorded for the inhibitors alone (CF, LV, OX and LZ) and for Inhads. The characteristic changes in the FT-IR spectra (Fig. 7) are presented below.

Fig. 7
figure 7

FT–IR spectra of inhibitors and Inhads

  1. (i)

    The bands in the range 1710–1755 cm−1 are assigned to –C=O for all inhibitors. In the case of Inhads, the bands disappear.

  2. (ii)

    For inhibitors CF, LV and OX, the O–H stretching vibrations appear at 3308, 3257 and 3328 cm−1, whereas for Inhads, the bands were shifted to 3147, 3156−1, and 3190 cm−1, respectively.

  3. (iii)

    LV, OX and LZ show the peaks at 1288, 1291, 1326 cm−1 due to ν (C–O) stretching vibrations. They completely disappear in the scraped samples (Inhads).

  4. (iv)

    Stretching due to –N–H appears at 2920, 2786 and 3358 cm−1 for CF, OX and LZ, respectively. They vanished in the case of Inhads, as expected.

  5. (v)

    The band at 1032 cm−1 found in the inhibitor CF confirmed the presence of C–S stretching. In the case of Inhads (CF + Fe), the band disappeared, proving the formation of a complex. Nevertheless, shifts of peaks corresponding to ν (O–H)/ν (C=O) for the inhibitors were noticed, and the absence of a Fe–O stretching vibration in the range 672–688 cm−1 suggests that the adsorption mechanism at room temperature was most likely physisorption [55]. These experimental changes in the absorption frequencies of the IR spectra supported the interaction between the functional groups of the inhibitor with the cast iron surface.

UV–Vis spectroscopy

UV–Vis spectroscopy is an appropriate technique for identifying the complex formation of inhibitors with Fe2+ ions in acidic solutions after the corrosion process. UV–Vis absorption spectra of ithe nhibitors and Inhads are shown in Fig. 8. The electronic spectra of all the inhibitors show absorption bands in the region of 290–330 nm, which can be assigned to π → π* and n → π* transitions due to the presence of the carbonyl (C=O) and amine (N–H) groups, respectively. The Inhads shows a broad band of more or less 340–370 nm. The broadness as well as the small change of the band clearly proves the formation of a complex between the electron-containing inhibitor and the cast iron (Fe2+) surface [37, 56].

Fig. 8
figure 8

UV–spectra of inhibitors and Inhads

Scanning electron microscopy (SEM)

SEM images were recorded to investigate the interaction of the inhibitors with the metal surfaces. Figure 9(i) demonstrates SEM images of the polished cast iron surface and shows some scratches in the polished iron surface which occurred during polishing. The SEM image of the surface of the cast iron that was immersed in 1 M HCl medium for 2 h shows a rough surface covered by pits and cavities due to the violent attack of the aggressive medium (HCl) (Fig. 9ii). Figure 9(iii, vi) clearly shows that the specimens immersed in the inhibitor solutions (CF + 1 M HCl; LV + 1 M HCl; OX + 1 M HCl; LZ + 1 M HCl) are in better condition , and further indicated that the tested inhibitors were adsorbed and formed protective layers on the cast iron surface. The formation of protective layers reduces the corrosion and also any pits and cavities. Based on the above discussion, it can be concluded that the inhibitors slow down the steel dissolution by forming protective organic layers on the iron surface [57].

Fig. 9
figure 9

FE-SEM images of cast iron sample (i) blank (ii) immersed for 2 h in 1 M HCl (iii) immersed for 2 h in CF + 1 M HCl (iv) immersed for 2 h in LV + 1 M HCl (v) immersed for 2 h in OX + 1 M HCl, and (vi) immersed for 2 h in LZ + 1 M HCl

Wide-angle X-ray diffraction (WA-XRD)

Figure 10 illustrates the very high relative intensities of the peaks in the range 10°−23° for all the tested inhibitors, signifying a crystalline nature. In the case of Inhads, broad peaks were detected. The changes in the XRD pattern of Inhads implies that the inhibitors may chemically interact with the cast iron surface. The amorphous nature of the Inhads demonstrates that the inhibitors chemically adsorbed on the iron rather than a physical adsorption [58, 59].

Fig. 10
figure 10

WA–XRD patterns of inhibitors and Inhads

Conclusion

The inhibiting effect of expired waste pharmaceutical compounds (CF, LV, OX and LZ) on cast iron corrosion in 1 M HCl were examined using chemical, electrochemical and spectroscopic techniques. The expired drugs performed as efficient corrosion inhibitors for cast iron in 1 M HCl with good inhibition efficiencies in the following order: CF > LV > OX > LZ. Electrochemical measurements of all the tested compounds showed that they acted as mixed-type inhibitors. They inhibited both anodic dissolution and cathodic evolution reactions by adsorption on the iron surface. The inhibitors were adsorbed on the cast iron surface according to the Langmuir adsorption isotherm model.The ∆H ads value of the inhibitors denotes that the adsorption process is exothermic. The inhibitors were adsorbed through both physisorption and chemisorption, but physisorption occurred predominantly. The effect of temperature provided evidence for the physisorption mechanism and FT-IR and UV–Vis spectra gave proof for the chemisorption mechanism. SEM images showed that a protective layer formed on the cast iron surface. The amorphous/crystalline nature of the Inhads and the inhibitors was investigated by WA-XRD. The inhibitors are of economically low cost, less toxic and environmentally safe substances for inhibiting the acidic corrosion of cast iron.