Introduction

Corrosion is devastating adversity in gas and petroleum industries, which make steady use of mineral acids such as hydrochloric acid for varying processes including well acidizing, water treatment, chemical cleaning, and acid pickling (El Haddad et al. 2019). Mild steel (MS) is the foremost metal utilized in the industrial world accounting for its higher strength, weldability, toughness, ductility, and moderate cost. But it has irresistibility against corrosive oxidation on the subjection of the acidic medium in the diffusion-controlled processes (Hashim et al. 2019). The inclusion of corrosion inhibitors into the acid solution has turned out to be one of the most coherent and suitable routes to attenuate corrosion and widen the lifespan of metals. The inhibitor molecules orient themselves toward the steel surface by adsorption; get encapsulated inside the reactive corrosion spots present on steel to hinder the steel’s surface contact with the acid environment. The structural configuration of inhibitor, nature of steel substrate, and reactivity of acidic medium is the prime determinant discerning corrosion deceleration effectiveness (Mehdipour et al. 2015). Different substances such as surfactants (Mobin and Aslam 2017; Zhu et al. 2017; Mobin et al. 2019a, b; Aslam 2019), Schiff bases (Shetty 2020), dyes (Amoko et al. 2019; Aslam et al. 2021b, a), polymers (Arthur et al. 2013; Aslam et al. 2019; Mobin and Rizvi 2016), amino acids and their derivatives (El Ibrahimi et al. 2020; Parveen et al. 2018; Mobin et al. 2016) have been used significantly to prevent mild steel corrosion. The π electrons of the conjugated system, non-bonded electrons on heteroatoms (N, O, P & S) promote bonding interactivity of inhibitor with the Fe atoms on steel surface, resulting in the protective adsorption layer formation. Despite all these advantageous aspects associated with corrosion inhibitors, their consumption is prohibited due to intensifying environmental crisis, as these inhibitors induce undesirable by-products. Wherefore, pioneers have progressed in the direction of designing non-toxic, low-price, and environmentally positive inhibitors.

Being a genus of naturally occurring ingredients, plant extracts represent a plenteous category of corrosion inhibitors as these are easily obtainable, inexhaustible, and non-poisonous. Polyphenolic secondary metabolites, viz. flavonoids, tannins, and resveratrol existent in plant extracts confer generous corrosion protection for mild steel (Saxena et al. 2018). A variety of publications scrutinized on plant extracts have familiarized that distinctive extracts like leaf, root, bark, stem, pulp, and fruit are being probed as inhibitors against corrosion prevention for different metals and their alloys (Verma et al. 2018). Also, plant products are inexpensive, eagerly obtainable, and renewable sources of materials. Extracts from their barks, leaves, seeds, roots, and fruits contain the mixtures of organic compounds including sulfur, oxygen, and nitrogen atoms, and they have been reported as efficient corrosion inhibitors (El Hamdani et al. 2015; Rekkab et al. 2012).

Majd et al. (2019) studied the inhibition performance of Primula vulgaris flower extract (PVFE) on MS exposed to 1 M HCl environment. The inhibition efficiency of 95.5% was obtained at a quite higher concentration of 1000 ppm. Urtica dioica was used by Ramezanzadeh et al. (Ramezanzadeh et al. 2018) as an efficient inhibitor for MS corrosion inhibition in 1 M HCl medium. After 2 h of immersion, the maximal inhibitory efficiency of around 92% was achieved. According to MD research, the shielding film's protection mechanism was a donor–acceptor type. Asadi et al. demonstrated that using Lemon balm extract in an acidic corrosive environment may greatly lower the rate of the chemical attack on low-carbon steel, reaching a protection level of 94%. The protection process was proven using quantum and molecular dynamics, as well as Monte Carlo simulations (Asadi et al. 2019). Sanaei et al. employed a Rosa canina fruit extract as an inhibitor of corrosion of MS in a 1 M HCl solution and reported 86% suppression due to the formation of the hydrophobic film (Sanaei et al. 2019). Ramezanzadeh et al. found that diluting 1 M HCl with an ethanolic extract of Mangifera indica (mango) leaves significantly reduces sample corrosion. PDS analysis demonstrated mixed-type inhibition and EIS examination found 92% protection (Alibakhshi et al. 2018). Other researchers had done similar studies in the field of corrosion mitigation of steel in 1 M HCl acidic media. Glycyrrhiza glabra leaves extract (Alibakhshi et al. 2018) yielded 88% inhibition efficiency, Borage flower aqueous extract yielded 91% protection (Dehghani et al. 2019a), Chinese gooseberry fruit shell (Dehghani et al. 2019b) extract yielded 92% protection efficiency, and Citrullus lanatus fruit extract provided 91% protection efficiency. Myrobalan aqueous extract was investigated for mild steel in 1 M HCl. EIS analysis demonstrated 91% efficiency by 800 ppm Myrobalan extract (Dehghani et al. 2020). Aquilaria subintegra leaf extract was examined as a mild steel corrosion inhibitor in 1 M HCl (Sin et al. 2017). At 1500 ppm, the inhibitor was 93.2% effective. At an optimal dosage of 1000 ppm, Rollinia occidentalis extract was examined as a corrosion inhibitor, with inhibitory effectiveness of 85.7%. Leaf extract of Lagerstroemia speciosa (LSLE) (Mobin et al. 2019a, b) was examined as a corrosion mitigating agent against mild steel in 1 M HCl. As revealed by weight loss the extract was above 94% efficient at the concentration of 500 ppm at 333 K. Pterocarpus santalinoides leaves extract (PSLE) was prepared using water, ethanol, and methanol as extraction solvents and tested as a low-carbon steel inhibitor in 1 mol/dm3 HCl solution (Ahanotu et al. 2020). PSLE's inhibitory activity is influenced by concentration, temperature, and extraction solvent. Ethanolic extract, methanolic extract, aqueous extract inhibits corrosion in the following order: ethanolic extract > methanolic extract > aqueous extract. At 60 °C, inhibition effectiveness of > 90% was found with 0.7 g/L PSLE. Zheng et al. investigated the inhibitory activity of Loquat leaves extract for MS in a 0.5 M H2SO4 medium. EIS and Tafel examinations were used to assess the inhibitor’s performance. The EIS tests revealed that dissolving 10 ccs of aqueous extract of Loquat leaves in 100 cc electrolyte resulted in a 96% inhibition performance. The polarization diagrams also demonstrated the mixed-type inhibitory action of Loquat leaves (Zheng et al. 2018). Banu et al. investigated the anti-corrosive properties of Pedalium murex L. for MS in 1 M HCl solution. According to EIS results, the optimal condition showed 89% efficiency. Pedalium murex L. control corrosion limiting cathodic reactions (Riaz et al. 2018).

The current study reports on the corrosion inhibition properties of acidic Eucalyptus bark (EB) extract of high-altitude Eucalyptus globulus plant of India. An acidic (5% HCl) extract of bark at various concentrations has been studied as a corrosion inhibitor. Nowadays, green corrosion inhibitors are considered an attractive substitute. In this regard, numerous efforts have been made for the practical application of green corrosion inhibitors to have a superior future, a secure atmosphere, and a healthy life. The yield of these natural products and the corrosion inhibitory efficiency of the plant extracts differ widely depending on the part of the plant (Okafor et al. 2008). and its location (Tezeghdenti et al. 2015). In this view, the purpose of the present study is to examine the corrosion inhibition of the EB barks extracts onto mild steel in 5% HCl by employing weight loss measurement, electrochemical impedance (EIS) spectroscopy, potentiodynamic polarization (PDP) measurements coupled with surface topographical assessment by scanning electron microscope (SEM). The principal constituents prevailing in EB were identified utilizing phytochemical tests and Fourier transforms infrared spectroscopy (FTIR).

Materials and methods

Materials and solutions

The percentage elemental composition of MS specimens opted for this study was as follows (wt%): C—0.061; Si—0.38; P—0.018; S—0.05; Mn—0.181; Al—0.01; Cr—0.035; and remaining Fe. MS specimens were prepared by abrading them with a variety of different grades emery sheets followed by 10-min sonication in ethanol, then acetone degreasing and drying. For the gravimetric experiment, rectangular specimens (2.5 × 2 × 0.1 cm3 and surface area: 10.9 cm2) were used. For the electrochemical test, circular specimens with 1.0 cm2 exposed surface area were used. Dilution of 37% HCl with de-mineralized water yielded a corrosive solution of 5% HCl which was exploited as a blank reference medium during the entire series of experiments. Scheme 1 shows the experimental procedure.

Scheme 1
scheme 1

Experimental procedure

Collection and preparation of ethanol extract

Fresh eucalyptus bark was collected from the Aligarh, India, and used to retrieve their extraction. The bark was properly cleaned with tap water and then distilled water to eliminate dust particles before being air-dried and incised into little pieces. Twenty five grams of finely chopped bark was weighed and boiled for 30 min in a 250 mL Erlenmeyer flask holding 100 mL ethanol. The raw extract obtained was filtered in hot conditions using Whatman No. 1 filter paper to remove fibrous impurities. The ethanolic extract were then refrigerated and further used for the experiments. Freshly prepared ethanolic bark extract was used within two weeks for all experiments.

Phytochemical screening (qualitative and quantitative analyses) of crude extracts

The phytochemical screening of crude eucalyptus bark extract was screened using the methods reported in the literature (Trease and Evans (1989; Jain et al. 2010). The components analyzed are saponins, tannins, steroids, flavonoids, and cardiac glycosides. The phytochemical constituents of Eucalyptus camaldulensis plant sections ethanolic extract are presented in Table 1.

Table 1 Phytochemical analysis of ethanolic bark extracts of EB

Gravimetric experiment

The gravimetric experiment was carried out to ascertain the concentration effect of EB at different temperatures of the studied medium. It was followed as per the ASTM G1-90 designation (ASTM Philadelphia 1993) by immersing MS specimens in 5% HCl for 6 h at temperatures 30, 40, 50, and 60 °C. After the elapsed time, to remove the corrosion products, MS specimens were thoroughly rinsed with demineralized water and lightly scrubbed with a bristled brush. After that, they were cleaned with double distilled water and acetone. Finally, the test specimens were dried to ensure a consistent weight. To ensure the reproducibility of the findings, measurements were performed on triplicate specimens, and the average corrosion rate was calculated. The following equation was used to calculate corrosion rates (CR) in mpy (Aslam et al. 2020b, a; Mobin et al. 2017a, b).

$$CR = \frac{KW}{{At\rho }}$$
(1)

where K symbolizes a constant with the value 8.76 × 104, W is the weight loss in grams, t is the immersion duration (h), A is the coupon's exposed area, and ρ is the density of MS (7.86 gcm−3).

Corrosion inhibition efficiencies (%IE) were determined with the equation (Mobin et al. 2017a, b; Li et al. 2015):

$$\%IE= \frac{{CR_{0} - CR_{i} }}{{CR_{0} }} \times 100$$
(2)

where CR0 and CRi symbolize corrosion rate excluding and including inhibitor, respectively.

Electrochemical measurements

The electrochemical tests were done employing an Autolab 128 N Potentiostat/Galvanostat. A corrosion cell made up of three necks having a capacity of 1 L comprising of the circular specimen of exposed area 1 cm2 inserted in specimen holder as the working electrode (WE), Ag/AgCl electrode as the reference electrode, and a stainless-steel rod as the counter electrode were taken for the conduction of the experiment. Specimens were statically placed in corrosive solution, before initiation of the electrochemical test. The potential was continuously monitored until it approached a steady-state potential. Half an hour of immersion period was required to stabilize the potential and at the steady-state open-circuit potential (OCP). All the tests were performed in aerated and non-stirred conditions. The PDP test recorded the polarization curves from − 250 to + 250 mV following steady-state OCP at a scan rate of 0.00166 V/s. The corrosion current density (Icorr), anodic Tafel slope (βa), cathodic Tafel slope (βc), and corrosion potential (Ecorr) have been determined. Nova 2.1 program was used to analyze the Tafel polarization plots. The following relationship was used to quantify inhibition efficiency (%IE) using the calculated values of Icorr.

$$ \% IE = \frac{{I_{corr}^{\left( 0 \right)} - I_{corr}^{\left( i \right)} }}{{I_{corr}^{\left( 0 \right)} }} \times 100 $$
(3)

where \(I_{corr}^{\left( 0 \right)}\) and \(I_{corr}^{\left( i \right)}\) symbolize the corrosion current densities of blank reference and inhibited medium, respectively. The impedance tests were carried out in a frequency ranging from 10−2 to 105 Hz and ac signals of 10 mV amplitude. The Nova 2.1 program was used to extract and analyze the impedance parameters. Applying charge-transfer resistance (Rp) in the impedance data of the Nyquist plots, %IE was measured.

$$\% IE = \frac{{R_{p}^{\left( i \right)} - R_{p}^{\left( 0 \right)} }}{{R_{p}^{\left( i \right)} }} \times 100$$
(4)

where \(R_{p}^{\left( 0 \right)}\) and \(R_{p}^{\left( i \right)}\) symbolize the charge transfer resistances of blank reference and inhibited medium, respectively.

FTIR analysis

A PerkinElmer spectrometer in the frequency range of 4000 to 400 cm−1 was used to produce spectra for pure ethanolic EB extract and adsorbed phytoconstituents of EB extract on the MS surface after 6 h immersion in 5% HCl. Scraped film was combined with KBr to make pellets in order to record the spectrum of adsorbed EB.

Surface studies

To support weight loss and electrochemical results, surface morphological examination using SEM was carried out. SEM images of MS specimens exposed to 5% HCl solution during 6 h with and without EB were analyzed using SEM (Model: JEOL JSM-6510LV) at magnification × 1000. FTIR studies of the MS surfaces after 6 h immersion time were carried out using PerkinElmer spectrometer at a frequency ranging from 4000 to 400 cm−1.

Results and discussion

Gravimetric analysis

Effect of concentration and temperature

The gravimetric experiment was conducted to calculate the protection efficiency of EB at increasing concentrations and different temperatures of the testing medium. The calculated parameters like corrosion rate (CR, mpy), surface coverage (θ), and %IE are listed in Table 2. The derived results have declared that EB could effectually protect the MS corrosion in acidic conditions, i.e., 5% HCl solution. The corrosion preventive capacity of EB was found to be ameliorating with its concentration, being highest at 900 ppm. Corrosion protection sustained by EB is credited to the adsorption capability of its inherent chemical constituents, which direct generate a barrier onto the metal surface for hindering mass and charge transference. The adsorption film assemblage opposes the extrinsic attack of aggressive ions of acidic solution (Kalia et al. 2020). The extent of corrosion prevention expands in direct ratio to the fraction of surface covered with adsorbed EB molecules. As the concentration of EB is raised, the adsorption of phytoconstituents of EB increases  on the metal surface. The parameter, θ, is the variable of fundamental importance as it expresses the proportion of metal substrate area covered with EB. It is worth noticing by inspecting the variations gathered in Table 2 that magnitude of θ begins to rise with increasing concentrations of EB but up to 900 ppm of it, beyond that it starts getting lowered. This might be due to the desorption of pre-adsorbed phytoconstituents of EB leaving behind the active corrosion sites vacant which become available to react with aggressive anions of acidic species and thereby accelerate the rate of corrosion and decrease the inhibition efficiency. In addition, the effect of gradual increment of temperature for the whole range of EB extract concentration has been investigated which implied that inhibition efficacy declined on raising the temperature of the studied medium. This pointed that EB phytoconstituents held to steel surface by electrostatic forces of attractions which may deplete due to desorption and disturbance in the arrangement of EB phytoconstituents as these molecules acquire higher kinetic energy and excited to next higher energy level at higher temperatures that reduced adsorption strength (Verma and Khan 2016).

Table 2 Corrosion parameters obtained from weight loss results of MS in 5% HCl at various temperatures for a 6h immersion period in the presence and absence of different concentrations of EB extract

Effect of the immersion period

The stability of EB extract and its persistent inhibition were anatomized by carrying out a weight loss experiment for the period of 170 h. The resultant output is presented in Fig. 1 expressing the variation of inhibition efficiency on varying immersion time. Results have demonstrated that inhibition efficiency got improved on extending the immersion period for 80 h. This advises that bulkier EB molecules adsorbed over the metal surface for an extended immersion period.

Fig. 1
figure 1

Effect of immersion time on inhibition efficiencies of EB extract

Activation parameters

The activation energy and thermodynamic quantities for the adsorption process of EB on mild steel surfaces are shown in Table 3. The process of corrosion may be analogized as an Arrhenius-like reaction. The activation energy (Ea) and pre-exponential factor (A) excluding and including incremental concentrations of EB extract can be deduced from the below-mentioned relation:

$$\log CR = logA - \frac{Ea}{{ 2.303RT}}$$
(5)

where T and R symbolize absolute temperature and gas constant, respectively. The respective magnitudes of apparent activation energy and pre-exponential factor in acid solution (in unprotected and protected phase by EB) have been obtained by the linear regression through the plot of log CR vs. 1/T output placed in Fig. 2a.

Table 3 Activation parameters of MS in 5% HCl in the absence and presence of different concentrations of EB extract
Fig. 2
figure 2

(a) log CR versus 1/T and (b) log CR/T versus T plots for the corrosion of MS in 5% HCl containing different concentrations of EB

The closeness of the R2 value to unity illustrates that MS corrosion in the acid solution can be interpreted in terms of the kinetic model realistically. A noted rise in Ea for protected medium with rising concentrations of EB extract when compared to unprotected one (Table 3) reveals that the reaction barrier for corrosion product formation is heightened leading to delayed process outcome. The enthalpy of activation and entropy of activation values can be calculated from transition state theory as:

$$\log CR = \frac{RT}{{Nh}}\exp \frac{{\Delta S^{*} }}{R}\exp \frac{{ - \Delta H^{*} }}{RT}$$
(6)

where N symbolizes the Avogadro’s No. and h, the Planck’s constant. In the plot of log (CR/T) vs. 1/T (vide Fig. 2b), ∆S* and ∆H* values were derived from the slope (− ∆H*/2.303R) and intercept [log(R/Nh) + ∆S*/2.303R] of Eq. (6). Enlisted in Table 3 are the ∆S* and ∆H* values at all the studied concentrations of EB extract. ∆H* is carrying a positive sign for all the studies conditions that recommends the reactions involving mild steel disintegration are endothermic in behavior and the values of enthalpies showed a downtrend on raising the concentration of EB extract. The change of entropy of activation is positive and showed an uptrend at higher concentrations of EB extract. This is probably due to an increment in the disorganization of the considered system caused by the exchange of a larger number of water molecules by EB phytoconstituents and augmentation in solvent entropy (Parveen et al. 2018; Solomon et al. 2018).

Adsorption isotherm testing and thermodynamic parameters

Studying the adsorption mechanism is chiefly important as it markedly describes the adsorption action of tested inhibitors on metal surfaces. It serves dually providing a glimpse of the interaction of inhibitor on the metal as well as an understanding of corrosion impediment attributes. The extracted surface coverage (θ) parameter from the gravimetric experiment was used to make fit into different isotherm models like Langmuir, Temkin, and Freundlich adsorption isotherm expressed with the following relations (Saini et al. 2018):

Langmuir adsorption isotherm:

$$\frac{C}{\theta } = \frac{1}{{K_{{{\text{ads}}}} }} + C$$
(7)

Freundlich adsorption isotherm:

$$\left( {\frac{\theta }{1 - \theta }} \right)\exp \left( {2a\theta } \right) = K_{{{\text{ads}}}} C$$
(8)

Temkin adsorption isotherm:

$$\exp \left( { - 2a\theta } \right) = K_{{{\text{ads}}}} C$$
(9)

where Kads symbolizes adsorption equilibrium constant and C, the concentration of EB extract. The plot of all studied adsorption models is shown in Fig. 3.

Fig. 3
figure 3

(a) Langmuir; (b) Temkin; (c) Freundlich adsorption isotherm

The most emphatic fitting has been attained for the Langmuir model (vide Fig. 3a) as judged by the values of the regression coefficient (R2) which approached unity (Aslam et al. 2020b, a). The graph between C/θ against C produces a straight line having a slope close to unity. The linear regressions between C/θ and C at different temperatures have been achieved, and the respective values are recorded in Table 4. The magnitude of the slope of Eq. (7) and the coefficient of linear correlation, R2, approaching unity to stipulate that EB adsorption on mild steel surface can be elucidated analogous to the Langmuir model at all studied temperatures.

Table 4 Thermodynamic parameters of MS in 5% HCl in the absence and presence of different concentrations of EB extract

The values of Kads on raising the temperature of the studied medium showed an abrupt decline; this is in line with the diminishing inhibition effectiveness at higher temperatures. Lowered Kads values at higher temperatures proposed that the desorption process dominated over adsorption. The equilibrium constant for adsorption (Kads) is connected to the standard free energy of adsorption by the relationship:

$$\Delta G^{o}_{{{\text{ads}}}} = - RT\ln (1 \times 10^{6} K_{{{\text{ads}}}} )$$
(10)

where R: the universal gas constant, T: the absolute temperature, and the value of 1 × 106 is the concentration of water in solution in ppm. As the ∆G°ads values (vide Table 4) are the measure of the spontaneity of the chemical reactions from the thermodynamic perspectives, the values with negative sign specify that the adsorption of studied EB extracts on steel substrate is spontaneous (Solmaz 2014).

The Van’t Hoff equation was employed to calculate standard adsorption enthalpy (ΔH°ads) using Eq. (11):

$$\log K_{ads} = \frac{{ - \Delta H^{o}_{ads} }}{2.303RT} + cons\tan t$$
(11)

where \(- \Delta H^{o}_{{{\text{ads}}}} /2.303RT\) is the slope of the straight line of the plot between log Kads and 1/T (Fig. 4). Using Eq. (12), the values of the standard entropy of adsorption (ΔS°ads) were obtained:

$$\Delta G^\circ_{{{\text{ads}}}} = \Delta H^\circ_{{{\text{ads}}}} - T\Delta S^\circ_{{{\text{ads}}}}$$
(12)
Fig. 4
figure 4

Linear regression between log Kads and 1/T

The inhibitor adsorption mechanism can be understand by the value of the ΔH°ads. ΔH°ads > 0 reflects chemical adsorption for an endothermic adsorption process, whereas ΔH°ads < 0 reflects physical adsorption (Aslam et al. 2021b, a). The endothermic adsorption process is shown by the negative value of ΔH°ads in this study. As indicated in Table 4, the value of ΔH°ads < zero, supporting the physical adsorption method demonstrated by the percent IE temperature variation. Prior to the inhibitor's adsorption on the metal substrate, the molecules were scattered in the solution. The negative values of ΔS°ads suggest that the inhibitor molecules were orderly adsorbed on the metal surface, significantly lowering the entropy values.

Electrochemical impedance spectroscopy (EIS)

EIS is the nondestructive extremely useful instrumental method to make known clues about the corrosion reactions taking place at the interface of a metal and corrosive electrolyte. Figure 5a displays Nyquist graphs for mild steel in 5% HCl solution excluding and including varying concentrations of EB. Almost similarly shaped depressed capacitive loops have been revealed for each studied case, and the shape of the curves is invariable for the entire range of EB concentration, dictating that the mechanism of corrosion is not influenced by the addition of EB extract (Gerengi and Sahin 2012). The center of the loops is positioned down the real axis alluding to the unevenness, porosity, and inhomogeneity of steel surface (Su et al. 2020). The diameter of the curves has been observed to be broadened for higher concentrations of EB extract; this is due to the accumulation of inhibitor’s molecules on the steel surface, thereon fabrication of defensive covering. Since a greater number of inhibitor molecules are transferred to adsorb at the electrode/electrolyte interface, the corrosion of steel is being controlled by the charge transfer process (Eduok et al. 2019). Indexed in Table 5 are the EIS data achieved. A corresponding equivalent circuit shown in Fig. 6 has been used to fit into the EIS data. In this particular circuit, Rs, Rp, and CPE symbolize solution resistance, charge-transfer resistance, and the constant phase element, respectively. CPE is used in place of double-layer capacitance to rectify the fluctuations from the capacitance behavior (Cao et al. 2020). The CPE impedance (ZCPE) can be determined by the relation:

$$Z_{CPE} = Y_{0}^{ - 1} (j\omega )^{ - n}$$
(13)

where Y0 represents proportionality constant, n is the CPE exponent which ranges from − 1 to + 1 and j is an imaginary number (j = (− 1)1/2. ω is the angular frequency in rad−1.

Fig. 5
figure 5

(a) Nyquist plots, (b) Bode impedance, and (c) Bode phase angle plots of MS in 5% HCl solution without and with different concentrations of the EB at 30 °C (filled and open symbols show experimental and fitted data, respectively)

Table 5 EIS parameters of MS in 5% HCl in the absence and presence of different concentrations of EB extract
Fig. 6
figure 6

Equivalent circuit to fit the EIS data

Cdl is evaluated by the equation (Hsu and Mansfeld 2001).

$$C_{dl} = Y_{0} \left( {\omega_{max} } \right)^{{\left( {n - 1} \right)}}$$
(14)

where ωmax is the frequency at which impedance is maximum.

Cdl may also be obtained by the equation

$$ C_{dl} = \frac{{\varepsilon \varepsilon_{0} }}{d}S $$
(15)

where d is the thickness of the double layer, ε0 is the permittivity of air, ɛ is the local dielectric constant, and S is the surface area of the electrode.

The electrochemical parameters obtained from the EIS outcome using the equivalent circuit are shown in Table 5. It can be elucidated by observing the results in Table 5, when EB is present in the acid solution, Rp values raise, while Cdl values fall, as compared to the unprotected medium. Additionally, as the EB concentration is increased in the range of 50–900 ppm, the Rp values increase, while the Cdl values tend to decrease, indicating a decrease in ε and/or an increase in d due to EB adsorption onto the steel substrate. This type of adsorption took place at the same time as H2O molecules or other ions were being displaced from the steel substrate. As a result, the efficient adsorption of EB molecules on the steel surface can be linked to an increase in Rp and a decrease in Cdl, therefore causing the decline in the rate of corrosion process and enhancement in inhibition efficiency. Gradual increment in EB concentration in a specific concentration range (50–900 ppm) improves inhibition efficiency, although the further increase in EB concentration (1100–1300 ppm) caused inhibition efficiency and Rp to decrease and Cdl values to rise.

The implication of EB undoubtedly diminished the corrosion, which is verifiable with the outcome concluded from Bode modulus and Bode phase graphs depicted in Fig. 5b, c. The phase angle climbs to a higher value for elevated concentrations of EB in the higher-frequency domain in comparison with corrosive electrolytic solution suggesting that a protective layer has been created which provides a superior capacitance response in the presence of EB (Fernandes et al. 2019). Moreover, the magnitudes of absolute impedance in the lower-frequency zone have been shifted toward higher values concerning the corrosive electrolyte reference. This further supports the prevention abilities of investigated inhibitor through its adsorption on the steel surface.

Potentiodynamic polarization (PDP) measurement

Polarization graphs for MS samples excluding and including varying concentrations of EB in 5% HCl medium have been archived as shown in Fig. 7. The PDP parameters, viz. corrosion potential (Ecorr), corrosion current densities (Icorr), anodic and cathodic line slopes (βa and βc), were extracted by extrapolating anodic and cathodic Tafel curves and inhibition efficacies (%IE) are listed in Table 6.

Fig. 7
figure 7

Polarization curves of MS in 5% HCl solution without and with different concentrations of the EB at 30 °C

Table 6 PDP parameters of MS in 5% HCl in the absence and presence of different concentrations of EB

A careful analysis of Tafel curve expresses that cathodic as well as anodic arms got altered when EB is added into acidic medium and the curves moved toward lesser corrosion current densities on adding accretive concentrations of EB extract in acidic solution which affirms that EB extract limited both steel oxidation and reduction of hydrogen ions occurring at MS surface and the studied EB extract acted like a mixed-type inhibitor (Srivastava et al. 2018).

By an investigation of the data indexed in Table 6, it can be detected that the anodic reactions are considerably influenced in comparison with cathodic as βa values are higher than βc. Also, Ecorr values have been adjusted toward the lesser negative or positive side for 5% HCl solution. These results substantiated that the investigated EB significantly lowered the anodic dissolution reaction and moderately cathodic reaction to some extent. As reported by Ferreira, a compound can be labeled as anodic/cathodic type when the shift in Ecorr is at least 85 mV to the blank solution (Yadav et al. 2013). Therefore, EB in the considered system functioned as a mixed-type inhibitor.

FTIR spectroscopy

The FTIR spectra of pure EB and its adsorbed film on the metal surface are shown in Fig. 8. The IR spectrum of pure EB (Fig. 8a) shows the broad band at 3479 cm−1 is related to O–H and N–H stretching and that at 1640 cm−1 to C=O. The band that appeared at 1640 cm−1 is due to C=N and C=C stretching vibration. The absorption bands below 1000 cm−1 correspond to aromatic and aliphatic C–H group. These findings demonstrate that EB contains oxygen and nitrogen atoms in functional groups (O–H, N–H, C=O, C=C, C–H, C–N, and C–O, which meets the general characteristics of conventional corrosion inhibitors. On comparing the spectra of absorbed EB on the metal surface (Fig. 8b), C=O, O–H, and C–N groups show peaks at 1640, 3425, 1021, and 1430 cm−1, respectively. The change/shift in peaks suggests that these groups are involved in film formation using a lone pair of electrons.

Fig. 8
figure 8

FTIR spectra of a pure EB and b Fe2+- EB

SEM spectroscopy

To see the morphological changes in the absence and presence of EB, the SEM analysis was carried out and results are shown in Fig. 9. As shown in Fig. 9a, the mild steel sample before immersion exhibits smooth surface (Fig. 9a) which of free from crack and any type of damage. However, some polishing scratches were seen. When the mild steel was immersed in uninhibited acidic solution, it gets corroded. This is due to the attack of corrosive solution which leads to the dissolution of mild steel. Therefore, producing a rough surface (Fig. 9b). In contrast, in the presence of inhibitor (Fig. 9c), the appearance of the steel surface is significantly improved, with almost no pores except for the polishing lines, that are observed on the micrograph. The behavior is due to the formation of a protective film over metal surface by the adsorbed phytoconstituents of EB extract.

Fig. 9
figure 9

SEM images of a polished MS surface and after 6-h immersion in the 5% HCl solution b without c with 900 ppm EB at 30 °C

Conclusion

The following are the conclusions drawn as an outcome of this investigation:

  • The variation in inhibition efficiency was observed as a function of temperature and concentration of EB extract and attained 98.2% at 900 ppm.

  • The molecules of EB adsorb on the MS surface following the Langmuir adsorption isotherm. The thermodynamic data pointed to a combination of physical and chemical adsorption processes.

  • As a result of multiple adsorption active centers that block the corrosion active sites of MS, the values of both Icorr and Cdl decreases with the addition of EB, while the values of Rp increases.

  • FTIR spectroscopy suggested the functional groups accountable for the adsorption of EB extract on the metal surface.

  • The observation of a smooth and protected metal surface due to suppressed MS corrosion via SEM examination verifies the efficacy of the investigated extract as a potential corrosion inhibitor.