Introduction

Industries use Mild Steel (MS) for several purposes, but because it corrodes quickly, an inhibitor is needed. The easiest method to prevent MS from corroding in an acidic medium is to use inhibitors (Mallika 2019; Gopi et al. 2010; Li et al. 2017, 2006). Many artificial materials pose serious risks to both people and the environment (Allaoui et al. 2020, 2017; Singh et al. 2012a, b). Because of the potentially dangerous consequences associated with the evacuation of these chemicals, several effective and ecologically friendly inhibitors have been developed. The majority of the time, the goods are natural, non-toxic, biodegradable, and widely accessible. The most crucial components of the plant utilized as a corrosion inhibitor are the seeds, fruits, leaves, and flowers (Shahen et al. 2022; Al-Bonayan 2015).

Extracts are often inexpensive, ecologically friendly compounds for metal corrosion inhibitors in a variety of mediums. The term "eco-friendly inhibitor" refers to chemicals that are easily accessible, derived from renewable resources, naturally biocompatible, and acceptable to the environment. These qualities led researchers to test the effectiveness of some common plant-based compounds and their byproducts as metal inhibitors in various situations (Idu et al. 2016; Acharya et al. 2013). Many studies and research efforts are made in this regard to find new green inhibitor alternatives because many extracts of common plants have been discovered to be helpful (Beenakumari 2011; Abiola et al. 2010; Ji et al. 2015; Vishalakshi et al. 2016a, b; Vishalakshi et al. 2016a, b; Adejumo et al. 2012; Gopi et al. 2015; Zakeri et al. 2022). Some consideration has been given to the use of moringa oleifera as a possible addition for reducing mild steel corrosion in an acidic environment (Jalajaa et al. 2019; Nnanna et al. 2015). One of these significant plants, moringa oleifera (Moringaceae), which is found in many tropical and subtropical nations, is well-known for its medicinal applications and high nutritional value. The numerous parts of this plant contain a large amount of minerals and considered as suitable source of proteins, vitamins, amino acids, and various phenolic compounds (Akalezi et al. 2020). Additionally, it offers a diverse range of medical benefits, including antioxidant, anti-cancer, antibacterial, and antifungal properties. Anti-properties have demonstrated the ability to both receive pain and to repair wounds. Also, the usage of root barks as analgesics, alexetics, antihelminthics, and remedies for heart issues (Allaoui et al. 2020; Farooq et al. 2007). moringa oleifera has been demonstrated to provide a versatile of medical benefits. Its anti-nociceptive effects and ability to heal wounds have also been proven (Adejumo et al. 2012). According to phytochemical screening results, the leaves include phenolics, tannins, flavonoids, and steroids, all of which are crucial for preventing metal corrosion (Odusote et al. 2016). The aim of the present work is to synthesize copper oxide nanoparticles (CuO NPs) using aqueous extract of moringa oleifera leaves (M-CuO NPs) and by using chemical synthetic method (S-CuO NPs). In addition, weight reduction assessment was used to compare the effectiveness of their two methods for preventing MS corrosion in acidic media. Transmission electron microscopy (TEM), energy-dispersive X-ray analysis (EDX), scanning electron microscopy (SEM), and X-ray diffractometry (XRD) were used to assess two compounds. Also, the effectiveness of the layer's adsorption and efficiency inhibition were examined.

Experimental details

Synthesized copper oxide nanoparticles

Fabrication of leaf moringa oleifera extract

The moringa oleifera fresh leaves were from Egyptian supermarkets. To get rid of any remaining debris, the gathered leaves were cleaned with deionized water and allowed to air dry. Moringa oleifera leaves weighing 10 g were cut up into small, wilted pieces and placed in a 250 mL beaker with 100 mL of deionized H2O. As shown in Fig. 1, the mixture was refluxed at 80 to 95 °C for 15 min, allowed to cool at ambient temp., and then filtered using regular filter paper. The filtered extract is utilized to biosynthesize CuO NPs and is kept in a refrigerator at 4 °C.

Fig. 1
figure 1

Laboratory operation flowchart for generating leaf moringa extract and form M–CuO NPs

Green synthesis of the moringa oleifera-copper oxide (M-CuO) NPs

In deionized water, 0.06 M copper acetate monohydrate was produced as an aqueous solution. Moringa oleifera leaf extract was combined in a 250 mL beaker with 0.06 M aqueous copper acetate in a 1:1 ratio while being constantly stirred at 500 rpm using a magnetic stirrer (25 min). After some time, the solution's hue changes to a dark yellow. The mixture was spun at room temperature for five minutes at a speed of 6000 rpm using a cooling centrifuge machine, and the residue was collected after the liquid supernatant was discarded. The obtained moringa nanocrystalline M-CuO NPs powder was carefully collected and packaged for characterization after one hour at 500 °C in a muffle furnace, where it was discovered to be a fine, dark black hue. (Khanderao et al. 2020).

Preparation of S-CuO by chemical synthetic method

By employing copper acetate as a precursor, CuO nanoparticles were created using the precipitation method. The first precursor was dissolved to a concentration of 0.3 M in 100 mL of deionized water. 2 M NaOH solution was gradually added while being vigorously stirred until pH reached 14. The pH was raised to 7 by periodically washing blue precipitates with 100% ethanol and deionized water. The washed precipitates were then dried for 16 h at 80 °C. After one hour at 500 °C in a muffle furnace, the produced moringa nanocrystalline M-CuO NPs were carefully collected and packaged for characterization, where it was found to be a fine, dark black color.

Characterization and analysis of S-CuO and M-CuO NPs

Copper oxide nanoparticle powdered materials were analyzed after preparation by green and chemical methods using XRD, SEM, TEM and EDX.

Electrode preparation

The working electrode was made from mild steel (MS) having composition (wt%) of C 0.09, Si 0.09, Mn 0.46, P 0.03 and the remains Fe. In the weight reduction experiments, MS was mechanically cut from commercially available steel into coupons of 4.0 × 1.5 × 0.0457 cm dimensions, polished with silicon carbide paper from 600 to 1200 grades to a metallic shine. The electrodes were then rinsed with distilled H2O, degreased in ethanol, rinsed again with distilled H2O and finally dried before being weighed. To check reproducibility of results, triplicate samples were immersed in a glass beaker containing 25 mL of the corrosive solution free and containing different concentrations of inhibitors.

Corrosive solution and inhibitors

By diluting reagent grade 37% concentrated acid with bi-distilled water at 25 °C, the corrosive 1 M HCl was created. The tests were carried out in 1 M HCl both with and without various concentrations (200–1000 ppm) of M-CuO NPs/S-CuO NPs.

Corrosion test by weight loss assessment

Samples were first measured in an electronic balance for weight. At temperature range (20–60 °C), 1 M HCl with various concentrations was added to weighed samples. The samples were removed from solution, dried in desiccators, and reweighed using an accurate when the temperature was adjusted and the specified immersion time had passed. The weight difference in each circumstance was interpreted as the weight loss. According to Eq. (1), the rates of corrosion were computed (Abdel-karim et al. 2022).

$$C_{R } = \left( {\Delta W \times 534} \right)/Atd$$
(1)

where \({C}_{R }\) is the corrosion rate mils per year penetration (mpy), \(\Delta W\) (g), weighs differently before and after being submerged in fluid, \(A,\) is the MS specimens' area (cm2), \(t,\) is the exposure period (h) and \(d,\) is density of MS in g/cm3. Using Eq. (2), the surface coverage degree (θ) is computed.

$$\theta = \frac{{W_{o} - W_{i} }}{{W_{o} }}$$
(2)

where Wi and Wo, are the weight losses of MS in inhibited and uninhibited solutions, respectively. The Inhibitor Efficiency \(IE \%\) is computed based on Eq. (3):

$$IE\% = \theta \times 100$$
(3)

SEM and EDS were used to analyze the surface morphology of the corrosion product on MS after 150 h of immersion in 1 M HCl with varied concentrations of M-CuO NPs or/and S-CuO NPs inhibited and uninhibited. Energy-dispersive X-ray analysis (EDX) is a technique used for the measurement of nanoparticles by SEM. In this technique, the nanoparticles are analyzed by activation using an EDS X-ray spectrophotometer, which is generally present in modern SEM. The individual separated nanoparticles are deposited on a suitable substrate that does not interfere in the characterization of nanoparticles. This method has found some limitations about accurate dimensional and elemental characterization.

Results and discussion

Characterization of S-CuO NPs and M-CuO NPs

X-ray Diffraction instrument (XRD)

The crystallinity and phase components of samples were examined and used to identify the structure, composition and size of nanoparticle powdered materials. A powder XRD employing X'Pert-PRO diffractometer and fitted with monochromatic Cu-Kα1 radiation (λKα1 = 1.5406 Å) from 2θ = 4.01°–90°, V 40 kV, I 40 mA, power of 1.6 KW, and counting time of 0.6 s/step. The generated data were analyzed by Sigma Pro and the resultant peaks and two theta values were compared with the standard CuO NPs values from the Egyptian petroleum research institute. From Fig. 2 all peaks at 2θ = 33.45°, 38.7°, 44.62°, 52.8°, 68.8° and 75.18°were indexed according to the JCPDS card (00-001-1117 and 00-045-0937). The average size of the CuO NPs was calculated using Debye–Scherrer’s Eq. (4):

$$L_{\theta } = \frac{K\lambda }{{\beta {\text{Cos}} \theta }}$$
(4)

where β is full width at 0.5 maximum, K is shape factor, which is assigned 0.9 for polymers. λ is wavelength 0.154 nm, Lθ is diameter of the crystallite size, and θ is Bragg peak position (Mashrafi et al. 2022). The crystallite size was found as the following in Table 1 for S-CuO and M-CuO NPs indicating its good crystalline in nature.

Fig. 2
figure 2

XRD for copper oxide nanoparticle produced by a green and b chemical method

Table 1 The crystallite size for S-CuO and M-CuO NP

Scanning electron microscopy (SEM)

The calcined CuO NP morphology was exhibited in high-resolution SEM micrographs which are shown in Fig. 3. This image demonstrates that, aside from a small amount of aggregation, the M-CuO and S-CuO NPs have a form that is almost spherical. This study outperforms the literature result in which the monoclinic structure of CuO NPs was created via a chemical synthetic process in a green manner (Alaa El Din et al. 2021).

Fig. 3
figure 3

SEM images for copper oxide nanoparticle produced by a green and b chemical method

Transmission electron microscope (TEM)

Figure 4 shows the TEM micrograph of CuO NPs. The TEM imaging revealed that the size of the produced nanoparticles was not consistent; rather, it ranged between 10 and 100 nm for M-CuO and S-CuO NPs. The produced NPs showed approximate uniform spherical nanoparticles. The diffraction pattern of mixed oxide nanoparticles at various sizes is shown in Fig. 4c. The corresponding diffraction and bright spot indicate the formation of crystalline M-CuO and S-CuO NPs, which is also consistent with XRD results this result agreement with (Akintelu et al. 2020).

Fig. 4
figure 4

TEM micrograph of a M-CuO, b S-CuO NPs and c Several magnifications of the CuO NPs, which reveal monodisperse particles

Energy-dispersive X-ray analysis (EDX)

The EDX spectrum is shown in Fig. 5, which demonstrates Cu and O in the sample at high intensity, further supported the synthesis of M-CuO NPs. The EDX spectrum analysis is 62.61% Cu, 32.56% O, and 4.83% C. The carbon atom observed in the spectrum is from the various organic biomolecules present in the plant extract, which acted as reducing and capping agents during the reaction to form the M-CuO NPs.

Fig. 5
figure 5

EDX spectrum of biosynthesized CuO NPs

Weight reduction assessment

Effect of inhibitor concentration

Table 2 displays the gravimetric corrosion of MS in 1 M HCl containing various of M-CuO and S-CuO NPs. Inspection of the data reveals an ascending order in the IE % up to 95.06% and 92.10% at 1000 ppm M-CuO and S-CuO NPs, respectively. Over and beyond this concentration, there was no additional growth. The improved surface covering with increasing inhibitor concentration is indicated by the rising inhibition efficiency. This result is probably attributable to the CuO NPs components adhering to the MS surface and forming a physical barrier to thwart the acid attack (Nasser et al. 2016). Figure 6 represents the impact of extended immersion on weight loss of MS corrosion in 1 M HCl various of M-CuO and S-CuO NPs, as extracted from Table 2. The expansion of the film and the rearrangement of the inhibitor on the MS surface can be linked to changes in efficiency over time, whereas the desorption of extract components that had been adsorbed on the MS can be linked to changes in efficiency (Singh et al. 2012a, b). Surface coverage \(\theta\) and \(IE\%\) increased as inhibitor concentration was increased, with \(IE \%\) (95.06) occurring at 1000 ppm of M-CuO NPs. By increasing the concentration of tested materials in solution, improving the effectiveness of inhibition. As a result, a protective film that is more durable and sticky forms on the MS surface (Saraswat et al. 2022).

Impact of immersion period

Figure 6 illustrates the change in weight loss (mg/cm2) of MS in 1 M HCl over time with and without of M-CuO and S-CuO NPs. According to the graph, weight loss increased as immersion time increased, but that it was less in the presence of tested solutions than it was in blank solution. The linearity of weight loss with time showed that there was no surface coating that was insoluble during corrosion. Additionally, M-CuO and S-CuO NPs were initially adsorbed into the metal surface and obstruct corrosion (Abbas et al. 2022). The results showed good trend in IE % using aqueous extract of moringa oleifera leaves (M-CuO NPs).

Table 2 Corrosion parameters of MS in 1 M HCl various of M-CuO/S-CuO NPs
Fig. 6
figure 6

Variation in Wt reduction over time for MS at 25 °C with different concentrations of a M-CuO NPs b S-CuO NPs

Langmuir adsorption isotherm

Equation 5 describes adsorption of M-CuO and S-CuO NPs molecules on MS surfaces according to the Langmuir adsorption isotherm:

$${\raise0.7ex\hbox{$C$} \!\mathord{\left/ {\vphantom {C \theta }}\right.\kern-0pt} \!\lower0.7ex\hbox{$\theta $}} = {\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {K_{ads} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${K_{ads} }$}} + C$$
(5)

where θ is surface coverage in Table 2, C is extract (ppm), and \({K}_{ads}\) is adsorption constant. Figure 7 shows the linearity relation between C/θ and C, which with R2 nearly equivalent to 1. It supports the M-CuO and S-CuO NPs ability to adsorb to the MS surface, demonstrating that the components are occupying the MS/electrolyte interface's active spots (Oubaaqa et al. 2022). M-CuO and S-CuO NPs molecules are stated to be adsorbed on the surface in a single layer without interacting with other molecules (Kouache et al. 2022). The \(\Delta G_{{{\text{ads}}}}^{^\circ }\) can be calculated by Eq. (6):

$$\Delta G_{{{\text{ads}}}}^{^\circ } = - R \times T \ln \left( {C_{w} \times K_{{{\text{ads}}}} } \right)$$
(6)

where R is the gas constant, T is absolute temperature, \(\Delta G_{{{\text{ads}}}}^{^\circ }\) is the standard free energy of adsorption and \(C_{w}\) is the concentration of water in the solution. The reaction occurs when the free energy is negative Table 3, in accordance with thermodynamic relations. Additionally, compared to chemical absorption, less heat is generated during the physical absorption process. M-CuO and S-CuO NPs spontaneously adhered to the MS surface (Ayoola et al. 2022).

Fig. 7
figure 7

Langmuir adsorption isotherm for MS in 1 M HCl with and without M-CuO and S-CuO NPs at 25 °C

Table 3 Langmuir adsorption parameters of MS in FW without M-CuO and S-CuO NPs at 25 °C

Chemical kinetics of corrosion inhibition

After adjusting the corroding MS unit of concentration from mg/cm2 to g/L and then to molar concentrations, the system's kinetics may be suggested. Assuming that a (mol/L) represents the starting concentration of the MS and x (mol/L) represents the final concentration of MS after time (t) in hrs had passed and it had converted to corrosion products. The corrosion concentration of MS at time (t) is therefore (ax) mol/L. Using the following rate Eq. (7) (El Refay et al. 2022), the given result showed that a relation between log (ax) or log [MS] on the Y-axis against time on the X-axis yields straight line R2 values that are just about unit, demonstrating a first-order kinetics (Fig. 8).

$$- \log \left[ {{\text{corrodent}}} \right] = \frac{{K_{1} t}}{2.303}$$
(7)

where \({K}_{1}\) is rate constant. Equation 8 also shows a relationship between the K1 and t0.5 as:

$$t_{0.5} = \frac{0.693}{{K_{1} }}$$
(8)

Values of \({K}_{1}\) and \({t}_{0.5}\) were calculated from the slopes of the kinetic plots are documented in Table 4. The data showed that \({t}_{0.5}\) of MS with M-CuO and S-CuO NPs were longer than those obtained for 1 M HCl, implying that M-CuO and S-CuO NPs increased the \({t}_{0.5}\) of MS in 1 M HCl. K of MS in the presence of M-CuO and S-CuO NPs was also shorter than that of 1 M HCl.

Fig. 8
figure 8

First-order kinetics plot for MS with and without different concentrations of a M-CuO b S-CuO NPs

Table 4 First-order kinetics variables for MS with and without different concentrations of M-CuO and S-CuO NPs

Activation energy

The Arrhenius equation, which is expressed by Eq. (9), showed how corrosion rate depends on temperature:

$$\log C_{R} = A - \left( {E_{a}^{*} /2.303RT} \right)$$
(9)

where \(A\) is extrapolation factor, \({E}_{a}^{*}\) is activation energy, R is gas constant and \(T\) is absolute temperature. The Arrhenius equation is represented graphically in Fig. 9, and Table 5 summarizes the computed activation energies based on the slopes of the plots. The Eyring transition state (Eq. 10) as:

$$\log C_{R} /T = \log \left( {R/Nh} \right) + \left( {\Delta S^{*} /2.303R} \right) - \left( {\Delta H^{*} /2.303RT} \right)$$
(10)

where N is Avogadro’s No. and h is the Planck’s. Figure 10 shows the plots of \(\log C_{R} /T\) versus \(1/T\). Straight lines are obtained with a slope of \(\left( { - \Delta H^{*} /2.303R} \right)\) and intercept of \(\left[ {\log \left( {R/Nh} \right) + \left( {\Delta S^{*} /2.303R} \right)} \right]\) which \(\Delta H^{*} \,{\text{and}}\, \Delta S^{*}\) were calculated and given in Table 5.Figures 9 and 10 show that as the temperature rose, corrosion rates rose as well, resulting in a drop in protection efficiency. Table 5 shows that the values of \(E_{a}^{*}\) and \(\Delta H^{*}\) were higher when M-CuO and S-CuO NPs were present than when they were not, confirming higher IE %. This may be explained by raising the energy barrier for the reaction; in other words, the adsorption process increased the activation energy and enthalpy of the corrosion process (Nsude et al. 2022). The endothermic nature of the activation process was revealed by the positive values of \(\Delta H^{*}\), which showed that it would be difficult and sluggish to dissolve in the presence of the tested substances. \(\Delta S^{*}\) values were high and negative in both the presence and absence of M-CuO and S-CuO NPs. This reflects the development of a stable, organized inhibitor on MS surface (Muhammad et al. 2022).

Fig. 9
figure 9

Arrhenius plot for MS in 1 M HCl in absence and presence of 1000 ppm of M-CuO and S-CuO NPs

Fig. 10
figure 10

Eyring transition state plot for MS in 1 M HCl in absence and presence of 1000 ppm of M-CuO and S-CuO NPs

Table 5 Activation parameters of MS in 1 M HCl in absence and presence of 1000 ppm of M-CuO and S-CuO NPs

Surface examination on corrosion product of MS

Scanning electron microscope (SEM)

Figure 11 displays SEM images of MS surfaces immersed in 1 M HCl in both the absence and presence of biosynthesized CuO NPs. When compared to the corroded rough and coarse uneven surfaces of MS submerged in 1 M HCl alone, the specimens immersed in the inhibitor (M-CuO and S-CuO NPs) solutions are in better conditions with smooth surfaces, according to a close analysis of the SEM pictures. This finding showed that the presence of the inhibitors significantly lowers CR. This may be the result of inhibitor adhering to the surface to serve as a protective layer (Muthukrishnan et al. 2019).

Fig. 11
figure 11

SEM images of a MS surface, b 1 M HCl + M-CuO and c 1 M HCl + S-CuO NPs

Energy‑dispersive X‑ray spectrometer (EDX)

Figure 12 depicts the spectrum of the MS surface in the absence and presence of the inhibitor following immersion in a 1 M HCl. Figure 12a demonstrates the accumulation of corrosion products (oxides) on the MS surface. The intensity of oxygen molecules is higher than that of carbon atoms, indicating that there are more iron oxides present. The EDX spectrum analysis is 75.95% Fe, 19.21% O, 0.46% Mn, and 4.22% C. On the other hand, EDX spectrum of Fig. 12b and c reveals the presence of elements on composition of MS surface from the tested solutions, indicating that the solutions adsorbed on the surface of mild steel and created a corrosion-resistant layer. The elements found in the protective layer in the presence of (M-CuO or S-CuO NPs) inhibitor were C, O2 and Fe. The presence of C in the EDX profile indicates that (M-CuO or S-CuO NPs) molecules have adsorbed on the MS surface. The carbon atom observed in the spectrum is from the various organic biomolecules present in the plant extract, which acted as reducing and capping agents during the reaction to form the M-CuO NPs.

Fig. 12
figure 12

EDX spectra of a MS surface, b 1 M HCl + M-CuO and c 1 M HCl + S-CuO NPs

Conclusions

In this study, the comparative synthesis CuO NPs by two methods using aqueous extract of moringa oleifera leaves (M-CuO NPs) and synthetic method (S-CuO NPs). Nanoparticles produced were evaluated by scanning electron microscopy (SEM), energy-dispersive X-ray (EDX), transmission electron microscopy (TEM) and X-ray diffractometry (XRD). The average size 14.95 and 35.73 nm for S-CuO and M-CuO NPs respectively, having potentials for application as inhibitor in corrosion of MS. The comparative inhibitive properties of prepared M-CuO NPs/S-CuO NPs on MS in 1 M HCl were investigated using the Wt reduction assessment. The IE % increases with increasing concentration of prepared M-CuO NPs and S-CuO NPs, with the maximum IE being 95.06% and 92.10%, respectively, at 1000 ppm. M-CuO NPs, a promising inhibitor for MS corrosion, were successfully used as an acid corrosion inhibitor after being isolated from aqueous moringa oleifera leaves. The adsorption shifts to physisorption based on the trend of IE % with temperature change and thermodynamic factors. The adsorption of produced M-CuO NPs and S-CuO NPs on MS by protective coating is inferred from the well-fit Langmuir adsorption isotherms.