1 Introduction

Metal corrosion has been a serious industrial threat that has received much attention [1, 2]. Substantial economic losses are reported worldwide due to corrosion-related activities [3]. These losses can be direct (labour cost of replacement) and indirect losses (plant shutdown, efficiency loss, and product leakages) [4, 5]. The cost of replacing material and equipment lost through corrosion has been estimated to be 9 billion US dollars annually [6]. Mild steel is a common metal widely used in every sector of the economy, especially in industries, since it is readily available and inexpensive [7]. It is used to construct metal-related products such as tanks, pipes, etc. [8].

Sulphuric acid is generally used in the processes of metal pickling in industries, which quickens the corrosion rate in oil and gas areas [9]. Metal corrosion has been reduced through corrosion inhibitors [2, 7]. In the past, inorganic inhibitors have been widely used [2, 9]. Still, due to prevalent environmental and economic problems (such as cost and toxicity) from their usage, attention has drifted toward eco-friendly inhibitors [2, 10, 11]. Thus, this makes using green inhibitors, primarily organic, a preferable and more viable option. Organic substances containing heteroatoms (N, S, O, and P) have been reported to have excellent inhibitory abilities [12]. Plant extracts constitute several organic compounds with these functional groups [2, 10, 13]. Several plant extracts have been utilized as green inhibitors in the acidic medium [8, 9, 12,13,14,15].

Gongronema latifolium methanol leaves extract was used as a corrosion inhibitor of MS in 3 M HCl, and it gave 77.17% inhibition efficiency at 0.5%w/v concentration, showing the potential use of the extract in inhibition studies [13]. Another study used Portulaca oleracea ethanol leaf extract in a corrosion inhibition study. It was confirmed that the extract could inhibit corrosion of MS in 2 M H2SO4 solution with a maximum I.E of 68.19% [15]. Ziziphora leaf extract was utilized to inhibit MS corrosion in 1 M HCl, which gave an I.E of 91% [16].

Methanol leave extract of Gongronema latifolium demonstrated its I.E of 81.69% at 0.5 w/v for MS corrosion in 0.5 M HCl solutions. The I.E% was linked to phytochemical compounds containing functional groups with heteroatoms [12]. Al-Mhyawi reported that the Juniperus plant extract was utilized as an inhibitor for MS in 2 M H2S04, which gave 82.83% inhibition efficiency [10]. Solanum Melongena ethanol leaves extract was used as an inhibitor for the corrosion of mild steel in 0.1 M HCl. The result indicated 80.23% maximum I.E [17]. Ihebrodike et al. studied corrosion inhibition using the leaf extract from Solanum melongena L on the corrosion of aluminum in sulfuric acid, which showed good inhibition potentials of the extract [18].

Therefore, this has made plant extracts an excellent and preferable choice for environmentally friendly, readily available, low-cost processing, biodegradable, and non-toxic [12, 17]. Few or no studies have used Solanum macrocarpon leaf extract for corrosion inhibition studies on MS in sulphuric acid medium. Consequently, the current work is an effort to contribute to the recent interest in eco-friendly, readily available, biodegradable, and non-toxic corrosion inhibitors. The study examined the SM leaves' methanol extract's ability to operate as a green inhibitor against mild steel's corrosive impacts from sulphuric acid. SM, the African eggplant, is a member of the solanaceae family [19]. SM is widely cultivated in many world regions, including Nigeria, for food, medicinal purposes, and ornamental use [19, 20].

2 Materials and methods

2.1 Preparation of materials

The mild steel was sourced commercially and displayed the following chemical compositions by weight (%): C (0.2), Si (0.1), S (0.01), P (0.01), Mn (0.1), and the balance Fe. The mild steel has a thickness of 0.12 cm and was cut into different coupons with a 4.0 × 3.0 cm dimension. The coupons have a little hole drilled to suspend the mild steel in the acidic medium. Ethanol was used to clean each coupon, rinsed with acetone, and stored in a desiccator until required [18]. For all the tests, distilled water was utilized to prepare analytical-grade chemicals and reagents procured from Sigma-Aldrich, USA. Freshly prepared 0.5 M H2SO4 was used for the work.

2.2 Extraction and preparation of extracts

SM leaves were purchased from Eke Awka market in Awka, Anambra State, and were identified by Mr P.O Ugwuozor at the Herbarium of Nnamdi Azikiwe University, Awka. The Solanum macrocarpon leaves were thoroughly cleaned, dried, ground, and extracted with methanol using the soxhlet method. Methanol was taken out of the solution by evaporating it at 65 °C. Using 0.5 M H2SO4, the crude extract left after evaporation was diluted to create inhibitor solutions with a 0.1–0.5% w/v concentration.

2.3 Phytochemical analysis of the extract

Phytochemical analysis was investigated on the crude extract using standard methods [21, 22].

2.3.1 Test for alkaloids

1 mL of the extract and 5 mL of the 2% HCl solution were put into a test tube. It was filtered after being heated for 10 min. 1 mL of filtrate was added to a test tube, followed by 1 mL of Wagner’s reagent. It was mixed correctly to observe colour change. A reddish-brown precipitate showed the presence of alkaloids.

2.3.2 Test for flavonoids

1 mL of the extract was added to a test tube using a pipette, followed by 1 mL of 10% Pb(C2H3O2)2 solution. The solution was correctly mixed for colour change or precipitate observation. The observation of yellow colour precipitates showed the presence of flavonoids.

2.3.3 Test for tannins

1 g of the extract was dissolved in 30 mL of distilled water in a beaker. The mixture was filtered. 5% FeCl3 solution was added to 2 mL of the filtrate in a test tube. The observation of a brownish-green colouration showed the presence of tannins.

2.3.4 Test for proteins

2 mL of the filtrate was added to a test tube. Two drops of a million reagents were added. A white precipitate showed the presence of protein.

2.3.5 Test for saponins

20 mL of distilled water was used to boil 2 g of the plant extract, and the mixture was then filtered. A stable precipitate foam was produced by rapidly shaking 10 mL of the filtrate with 5 mL of distilled water. Three drops of olive oil were added to the foam, which was vigorously shaken before being checked for the development of an emulsion.

2.3.6 Test for glycosides

10 cm3 of 50% H2SO4 was added to 1 mL of the extract, then boiled for 5 min in boiling water. 10 cm3 of the Fehlings solution (5 cm3 of solutions A and B) was added and boiled. A brick-red precipitate indicated the presence of glycosides.

2.3.7 Test for cardiac glycosides

In a test tube, 0.5 g of the extract was mixed with 2 mL of glacial acetic acid and a few drops of 5% FeCl3. It was under-layered with 1 mL of concentrated sulphuric acid. The emergence of a brown ring at the interface revealed the presence of cardiac glycosides.

2.3.8 Test for carbohydrates

0.1 g of the plant extract was mixed with a few drops of iodine solution to test for carbohydrates. A blue-black colour indicated the presence of starch.

2.3.9 Test for terpenoids

Concentrated 3 mL H2SO4 was gently added to produce a layer after 5 mL of the extract was carefully added to 2 mL of chloroform. A reddish-brown colouration of the inner face showed the presence of terpenoids.

2.3.10 Detection of steroids

0.5 mL of the plant extract was added to a test tube. A lower layer was created by mixing 1 mL of chloroform with a few drops of concentrated H2SO4. The development of a brown ring at the interface showed the presence of steroids.

2.3.11 Detection of phenols

In a test tube, 3 mL of 10% Pb(C2H3O2)2 solution was added after dissolving 5 mg of the extract in distilled water. A large white precipitate indicated the presence of phenols.

2.4 FTIR analysis

With the help of a Buck 530 IR mortar, 0.5 g of KBr and 2 g of the plant extract were crushed. With the help of a syringe, 1 mL of nujol (the solvent used to prepare samples for the Buck 530 IR spectrophotometer) was pipetted into the sample to create a paste. The paste was placed within the instrument sample mold, and its spectra lines were obtained by scanning the paste at a wavelength between 600 and 4000 nm.

2.5 Gravimetric experiment

Each set of studies was conducted using six samples of the mild steel coupons in 250 mL beakers at 303, 313, and 323 K. A 250 mL beaker containing 0.5 M H2SO4 (blank) and various inhibitor concentrations (0.1–0.5% w/v) was dipped with mild steel coupons with dimensions (4 × 3 × 0.12 cm) that had previously been weighed with threads in a water bath [12]. For five days, the mild steel sheets were removed at 24-h intervals. They were reweighed after scrubbing clean with a brush and ethanol before being dried in acetone. The average data for the five days were utilized, and the experiments were performed on triplicate mild steel coupons to ensure accuracy.

The following equations were used to compute the parameters corrosion rate (CR), inhibition efficiency (I.E%), and surface coverage (ϴ) based on the findings of weight loss experiments [23].

$${\text{Inhibition }}\;{\text{efficiency }}\left( {{\text{I}}.{\text{E }}\% } \right) \, = \frac{{W_{0} - W_{i} }}{{W_{0} }} \times \frac{100}{1}$$
(1)

The values for weight loss in the absence and presence of an inhibitor, respectively, are \({W}_{0}\) and \({W}_{i}.\)

$${\text{Surface coverage }}\left( \theta \right) \, = \frac{{W_{0} - W_{i} }}{{W_{0} }}$$
(2)
$${\text{Corrosion}}\;{\text{ rate }}\left( {{\text{CR}}} \right) \, \left( {{\text{mm}}/{\text{yr}}} \right) \, = \frac{{{ }87.6 \times {\text{W}}}}{\rho \times A \times T}$$
(3)

where W = weight loss in m, \(\rho\) = density (7.85 g/cm3 for the mild steel), A = area in cm2 (25.68 cm2 exposed surface area for the mild steel), T = exposure time in hours, and 87.6 = Rate constant.

2.6 Thermodynamic parameters

The Arrhenius equation was used to examine the activation energy of the process [1, 18].

$${\text{ log}}_{10} \frac{{CR_{2} }}{{CR_{1} }} = \frac{{E_{a} }}{2.303R}\left( {\frac{1}{{T_{1} }} - \frac{1}{{T_{2} }}} \right)$$
(4)

where CR1 and CR2 are the mild steel corrosion rates at T1 (303 K) and T2 (323 K), respectively. \({E}_{a}\) is the activation energy, and R is the molar gas constant (8.314 JK−1 mol−1).

Enthalpy variation ΔH and entropy variation ΔS of activation for the corrosion process were derived from the transition state Arrhenius Equation [10].

$${\text{log}}\left( {\frac{{C_{R} }}{T}} \right) = \log \left( \frac{R}{Nh} \right) + \frac{\Delta S}{{2.303R}} - \frac{\Delta H}{{2.303RT}}$$
(5)

where; N = Avogadro’s constant (6.02214129 \(\times\) 10−23 mol), h = Planck’s constant (6.62606957 \(\times\) 10−34 J.S), R = Universal gas constant (8.314 J/mol/K).

The following equations were also used to evaluate the adsorption's free energies [7].

$$\Delta G_{ads} = \, - {2}.{3}0{\text{3 RTlog}}_{{{1}0}} \left( {{55}.{\text{5 K}}_{{{\text{ads}}}} } \right)$$
(6)

where R = molar gas constant, T = temperature (303 K), 55.5 = molar concentration of water, and Kads = equilibrium constant which is given as

$${\text{K}}_{{{\text{ads}}}} = \frac{\theta }{{\left( {1 - \theta } \right)}} \times \left[ C \right]$$
(7)

3 Results and discussions

3.1 Phytochemical screening

Table 1 shows the results of the phytochemical analysis of the methanol extract of leaves of SM. The results show that the leaf extract contains phytochemical compounds (alkaloids, tannins, steroids, etc.) essential in corrosion inhibition [18]. The phytochemical components in the extract were primarily responsible for the extract's inhibitory effects, which contain heteroatoms that form complex chemical bonds between the mild steel and the extract [16]. Heteroatoms are usually found in organic compounds used as corrosion inhibitors because of N, O, P, and S and polar functional groups such as CHO, COOH, and OH in these aromatic and heterocyclic compounds [8, 9]. The lone pair of electrons on the metal surfaces of these hetero-atoms aid in creating protective shields, which lower the corrosion rate [10, 24]. Since corrosion is an electrochemical process that involves electron loss, heteroatoms act as corrosion inhibitors via the adsorption process on the metal/corrodent interface, thereby supplying the loss of electrons and inhibiting further corrosive attack on the MS surface [24]. A similar conclusion was also observed [12, 18]. The findings showed that the phytochemicals with hetero-atoms give Solanum macrocarpon leaf extract a high level of inhibition.

Table 1 Results of phytochemical analysis

3.2 Fourier transform infra-red spectrophotometric study

The Fig. 1 reveals the FTIR spectrum of the methanol leaves extract of Solanum macrocarpon. The FTIR spectra analysis revealed the presence of the following functional groups and elucidation of the organic compounds present in the extract, as depicted in Table 2. The extract was shown to contain a variety of functional groups. Organic substances (plant-based) containing polar functional groups with heteroatoms (N, S, O, and P) in a conjugate system display excellent inhibiting characteristics [25,26,27,28].

Fig. 1
figure 1

Fourier Transform Infra-Red spectra for Solanum macrocarpon leaves extract

Table 2 Interpretation of FTIR spectrum of Solanum macrocarpon

Heteroatoms have high basicity and electron density, which makes corrosion inhibitors active centres for the adsorption process, which helps in corrosion inhibition [25]. When these functional groups with heteroatoms are substituted for hydrogen in a carbon ring, it improves inhibition [26]. Hence, from the results obtained from the FTIR study of the leaf extract, we can deduce that the excellent inhibiting property of the methanol leaf extract of SM for the corrosion of mild steel was due to the presence of these organic compounds containing polar functional groups with heteroatoms.

3.3 Weight loss data

The mean standard deviation of weight loss with time at 303, 313, and 323 K was represented in Tables 3, 4, and 5. Figure 2 also demonstrated the weight loss with immersion time for different concentrations of the extract in 0.5 M H2SO4 at 303 K.

Table 3 The mean standard deviation of the weight loss at 303 K
Table 4 The mean standard deviation of the weight loss at 313 K
Table 5 The mean standard deviation of the weight loss at 323 K
Fig. 2
figure 2

Variation of weight loss with immersion time for different concentrations of the extract in 0.5 M H2SO4 at 303 K

It was shown that the weight loss increased with extended immersion times and decreased with higher inhibitor concentrations in the acid solutions at different temperatures (303–323 K). Additionally, the results demonstrated that mild steel corroded in a solution of 0.5 M H2SO4, although the presence of the inhibitor reduced the degree of metal deterioration. So, this suggested that the extract of Solanum macrocarpon leaves prevented the mild steel from rusting in an acidic environment. A similar result was observed by [15, 17, 26].

Furthermore, the temperature dependence of the weight loss experiment was also depicted in Fig. 3, 4, and 5.

Fig. 3
figure 3

Variation of weight loss with temperature after immersion time of 24 h

Fig. 4
figure 4

Variation of weight loss with temperature after immersion time of 48 h

Fig. 5
figure 5

Variation of weight loss with temperature after immersion time of 72 h

The Figs. 3, 4, and 5 show that the rate of weight loss increases with temperature given the same exposure time and concentration. Similar trends were reported by [14, 15]. Hence, the corrosion rate tends to be faster at higher temperatures due to increased reaction rates.

The standard deviation values obtained from the mean weight loss experiment for 303, 313, and 323 K were also demonstrated using Fig. 6, 7, and 8.

Fig. 6
figure 6

Scatter bars of the standard deviation of weight loss at 303 K

Fig. 7
figure 7

Scatter bars of the standard deviation of weight loss at 313 K

Fig. 8
figure 8

Scatter bars of the standard deviation of weight loss at 323 K

3.4 Inhibition efficiency data

The Fig. 9 shows how effectively the inhibitor inhibits the reaction at 303 K. The extract content in the acid solutions enhances the effectiveness of the inhibition (with an optimal efficiency of 95% at 0.5%w/v concentration). A saturation point was reached at which an increase in the inhibitor concentration produced only an insignificant increase in I.E %. So, this implied that the inhibition process was characterized by an initial rise in the surface coverage with increasing extract concentration until a particular concentration was reached, after which the increase in the surface coverage with extract concentration became limited (Eddy et al., 2010). A similar trend was established by researchers [14, 29]. This trend also indicated that at a higher level of extract concentration, the metal surface reached saturation conditions with the adsorbed species [10, 18, 30].

Fig. 9
figure 9

Plot of inhibition efficiency against immersion time at 303 K

As immersion time was increased, the inhibition efficiency gradually declined due to the desorption of the inhibitor molecules on the MS [30]. Additionally, Fig. 10 illustrates the impact of temperature on the effectiveness of inhibition at various concentrations. It was shown that the inhibitory efficiency increased with rising concentration and fell with rising temperature. The decrease in I.E% is attributed to the faster migration of the protons and sulfate anions [17]. These protons and sulfate anions with greater kinetic energies can interfere with inhibitor adsorption and promote weaker adsorption [12, 13].

Fig. 10
figure 10

The variation of I.E % with temperatures

Table 6 compares other plant extracts used in previous studies on corrosion inhibition using mild steel. It was observed that previous works reported higher inhibition efficiency than the present study [5, 9]. Other results were lower than the maximum inhibition efficiency reported by this study [8, 10, 12,13,14,15,16, 29, 31]. Dongy et al. reported maximum inhibition efficiency similar to the present study [30]. So, this shows that the methanol extract of Solanum macrocarpon was an excellent inhibitor for mild steel corrosion.

Table 6 Comparison of different plant inhibitors in mild steel corrosion

3.5 Surface coverage data

The surface coverage (θ) results at 303, 313, and 323 K were clearly illustrated using Tables 7, 8 and 9. Figure 11 also demonstrated the surface coverage (θ) with inhibitor at different immersion times at 303 K.

Table 7 The degree of surface coverage values with inhibitor concentrations at 303 K
Table 8 The degree of surface coverage values with inhibitor concentrations at 313 K
Table 9 The degree of surface coverage values with inhibitor concentrations at 323 K
Fig. 11
figure 11

Variation of surface coverage with inhibitor concentrations at 303 K

The results demonstrated that the surface coverage increases with an increase in inhibitor concentration given the same immersion time at different temperatures, implying that the number of the extract's molecules adsorbed on the metal surface increases with the extract concentration [8, 32]. The fraction of the surface covered by adsorbed molecules is a measure of the effectiveness of the adsorbed species and directly relates to the efficacy of inhibition [33]. The surface coverage (Ɵ) decreased as the temperature was increased due to the desorption of the extract molecules on the MS surface [12, 15]. These findings were reported by different authors [8, 9, 16].

3.6 Corrosion rate

The Fig. 12, 13, and 14 show how the mild steel's corrosion rate varied with immersion time in 0.5 M H2SO4 acid solutions that were uninhibited and inhibited at various concentrations at 303, 313, and 323 K.

Fig. 12
figure 12

Corrosion rates at various inhibitor concentrations and immersion times at 303 K

Fig. 13
figure 13

Corrosion rates at various inhibitor concentrations and immersion times at 313 K

Fig. 14
figure 14

Corrosion rates at various inhibitor concentrations and immersion times at 323 K

It was revealed that the presence of SM leaves reduced the corrosion rate of the MS in 0.5 M H2SO4. The corrosion rate also decreased as the inhibitor concentration increased. Other researchers reported similar findings [12, 34, 35]. Moreover, it was revealed that the corrosion rate of mild steel in both the uninhibited and inhibited 0.5 M H2SO4 acid solutions of different concentrations further decreases with an increase in immersion time due to the desorption of the inhibitor particles on the MS surface [34]. Furthermore, the temperature effect of the corrosion rate of MS was also illustrated in Fig. 15.

Fig. 15
figure 15

Variation of corrosion rate at different temperatures

The findings unmistakably show that as the temperature rises, the rate of metal corrosion both in the unrestrained and inhibited 0.5 M H2SO4 acid solutions increases. It abides by the chemical reaction rate law, which stipulates that when temperature rises, reaction rates tend to rise as well [36]. A rise in corrosion rate could be attributed to the desorption of previously bound inhibitor molecules, exposing a new and larger surface area of MS to acid attack [37]. Therefore, the leaf extract from Solanum macrocarpon can effectively prevent mild steel corrosion in acidic solutions, and the inhibitor's adsorption verifies the physical adsorption mechanism.

3.7 Thermodynamic studies

The kinetic and thermodynamic values are shown in Table 10.

Table 10 Thermodynamics adsorption parameters of Solanum macrocarpon extract

The activation energies (\({E}_{a}\)) were between 43.82 to 63.70 kJmol−1 in Table 10. The values are higher than the blank, indicating that the Solanum macrocarpon leaf extract reduced corrosion in the acid solutions by forming protective films on the mild steel surface [37, 38]. Similar observations were reported [39, 40]. Additionally, the activation energies fell below the 80 kJmol-1 threshold necessary for physisorption [37, 39]. Moreover, the temperature effect of the \({E}_{a}\) values of the inhibitor concentrations at (303–323 K) was higher than the blank, indicating that the inhibitive molecules lowered the inhibition efficiency at higher temperatures, reflective of a physical type adsorption mechanism [40].

Gibb's free energy values at 303 K were also presented in Table 10. With increasing concentrations of the inhibitor, the values of \(\Delta {G}_{ads}\) tended to be more negative and varied from − 6.84 to − 14.17 kJ/mol. These demonstrated the spontaneity of the adsorption. Similar trends were reported by [39, 40]. Physical adsorption is compatible with \(\Delta {G}_{ads}\) \(\le\) −20 kJmol−1 values, whereas chemisorption is connected to values \(\ge\) −40 kJmol−1 [38]. The adsorption process involves weak electrostatic interactions between metal atoms and adsorbate species [39]. Therefore, the adsorption supports the physisorption mechanism.

The entropy and enthalpy values of the reaction are also presented in Table 10. The plot of the log of CR/T against 1/T (Transition state) gives a straight line with slope equal to − ΔH/2.303R and intercept of Iog (R/Nh) + ΔS/2.303R in Fig. 16. The enthalpy values of the reaction were higher in the presence of the inhibitor than the absence of the inhibitor, which was attributed to the presence of energy barrier for the reaction process [35]. The positive values indicated that the dissolution of mild steel was an endothermic process, which means that mild steel dissolution was difficult [30, 36]. The entropy of activation values (Table 10) increased in the presence of the inhibitor compared to the uninhibited system. The ΔH were negative, indicating that the adsorption process was slow, and the complex compound formation was associated with the rate determination step, meaning that a decrease in disorderliness occurred on going from reactants to the activated complex [30].

Fig. 16
figure 16

The plot of log (Cr/T) against 1/T of corrosion inhibition of mild steel in 0.5 M H2SO4

3.8 Corrosion inhibition mechanism

The methanol leaf extract of Solanum macrocarpon was stably adsorbed on the mild steel surface through the formation of chemical bonds with the lone electron pairs of heteroatoms and the empty orbital of metal [35, 36]. As a result of the electrostatic interaction between molecules, the inhibitor molecules can also produce physical adsorption on the surface of MS [40].

4 Conclusion

The Solanum macrocarpon methanol leaves extract was used as a corrosion inhibitor for MS in 0.5 M sulphuric acid solutions. The extract contains several phytochemical compounds that contain functional groups with heteroatoms that help facilitate inhibition activities. The I.E % of the extract was increased with a rise in extract concentrations. The I.E % of the extract decreased with a temperature rise. Optimum efficiency of 95% was achieved, showing the inhibition abilities of the extract. Thermodynamics parameters such as \(\Delta {G}_{ads}\), and \({E}_{a}\) demonstrated that the adsorption process followed the physisorption mechanism. Therefore, this work has shown the effective use of SM extract in corrosion inhibition and can be used in industries to mitigate corrosion of metals.