1 Introduction

Corrosion is one of the essential research regions that have been attracting the attention of researchers for over 10 years. Long-term durability of commercial product applications such as pigments, heat exchangers, and boiler tubes mainly depends on the rate of corrosion of the materials [1, 2]. Corrosion is the retrogression of the metals due to their response to a corrosive element in their surroundings, including oxygen, carbon dioxide, chlorine, and fluorine [3,4,5]. Corrosion of metals has extreme fiscal effects and is an enormous problem all over the world. Various strategies have been used to protect metals from corrosion.

Zinc (Zn), magnesium (Mg), and their alloys have been known for a long time as light metals and an alternative for aluminum alloys for structural applications due to their light weight, high specific strength, and excellent castability [6, 7]. These unique properties make Zn and its alloys valuable for numerous applications including bone implantation, automobile, aerospace, sporting goods, handheld tools, household equipment, and portable electronic devices [8, 9]. However, zinc has moderate corrosion resistance in aqueous electrolytes. Hence, there is a need to reduce the corrosion rate of Zn-based alloys in various salt-based aqueous electrolyte systems. Therefore, the protection of slight metallic systems from corrosion is an important area of research. Magnesium (Mg) is lighter than aluminum because of high strength-to-weight proportion, energy-efficient nature, and environmentally agreeable properties. Mg-based combinations are attractive in the field of vehicle transportation, aviation stations, electrical industry, and biomedical applications [10,11,12]. Clinical examinations have confirmed that Mg-based implants have great biocompatibility. Fortunately, Mg and its chemically active alloys can degrade naturally in the physiological climate by corrosion and are potential candidates in biodegradable hard-tissue implants. The major downside of Mg alloys is their low corrosion resistance in the body. In this regard, Mg is undesirable as it is chemically very active. Consequently, the applicability of Mg alloys has been severely compromised with its huge number of utilizations. One broadly applied methodology in the industry to shield Mg-based materials from corrosion is to apply a surface coating and alloying with nanomaterials, as a barrier to isolate Mg from the outer environmental attacks [13, 14].

The usage of corrosion inhibitors is one of the most realistic strategies for the protection of metals from the opposition in acidic media [15]. Some transition metal oxides have been stated as powerful corrosion inhibitors in acid media [16]. In the metal nanocomposite coating studies, nickel has acquired a great deal of attention because of its ability to treat the host matrix for electroless nickel oxide nanoparticle coating. However, nickel coating has excellent corrosion and wear resistance in a number of commercial applications [17, 18]. Nickel coating acts as a barrier among special metals to prevent unfavorable elements from migrating and diffusing among alloys, which may predict the development of galvanic corrosion. Because of its prominent adhesive power and ductility, nickel layer also used as a protecting coating and ferrite cloth in airframe [19].

There are many methods for synthesis of NiO NPs, such as wet chemical, sol–gel, hydrothermal, sonication, chemical vapor deposition, spray pyrolysis, mechanical milling, and template synthesis [20,21,22,23,24,25,26]. But the green synthesis of nanoparticles using extracts of leaf, bark, and root has gained more attention compared to the aforesaid methods. The main reason behind the green approach for the preparing nanometal oxides is its cost-effectiveness, eco-friendliness, and simplicity compared to other methods [27]. The structural, morphological, optical, and physical properties of nanometal oxides can be easily enhanced with the use of other physical approaches, such as ultrasonic waves and microwaves [28, 29]. A limited studies are available on the ultrasonic waves-influenced green synthesis of NiO NPs using plant extracts as a capping and reducing agents in the context of corrosion inhibition.

Delonix elata belongs to the family of Fabaceae and subfamily Caesalpinioideae [30]. It contains many antioxidants that are mainly used in medicinal applications. Ayurveda and siddha practitioners in India use leaf and stem bark extracts for curing jaundice, hepatic disorders, bronchial and rheumatic problems, and for many other health issues. Leaf extract of D. elata has remarkable antinociceptive, antibacterial, and anti-inflammatory activities [31, 32]. D. elata leaf extract contains unique phenolic compounds mainly two flavanones namely Quercetin and Rutin. These biological components are effectively utilized to enhance the corrosion inhibition nature of the metal surfaces.

In this study, the authors report the most economical and easiest green synthesis protocol to prepare NiO NPs using D. elata leaf extract as a chelating and reducing agent. The ultrasonic waves were used to prepare NiO NPs. The motive for using D. elata leaf extract is the presence of biological antioxidants such as ascorbic acid, flavonoids, and phenolic compounds in it. Besides, it has an ability to conserve chemical precursors, that is, bulk production of nanoparticles can be achieved using a small amount of precursor. It can also play an important role in determining the particle size, purity, crystalline nature, morphology, and the specific surface area of nanomaterials [33]. Therefore, in this study, these antioxidants were successfully used to prepare NiO NPs for anticorrosive applications. The structural, morphological, thermal, and physical properties of the prepared NiO NPs were comprehensively studied. The enhancement in the corrosion inhibition behavior of zinc and mg metal plates using NiO NPs under NaCl, KOH, HCl, and H2SO4 electrolytes was discussed.

2 Materials and Methods

2.1 Material

The analytical reagent-grade nickel(II) nitrate hexahydrate (99.8% purity), polyvinylidene fluoride, N-methyl-2-pyrrolidone, and ethanol were purchased from Merck and used without any further purification. Sodium chloride, potassium hydroxide, sulfuric acid, and hydrochloric acid were used as electrolytes. All the electrolyte solutions were prepared using deionized (DI) water obtained from an ultrapure water purification system followed by the KMnO4 distillation method.

2.1.1 Preparation of the Plant Extract

The D. elata leaves were collected in and around KS Rangasamy College of Technology, Tiruchengode, Tamil Nadu, India (11.3628° N, 77.8279° E) and the collected leaves were washed with DI water to remove the moisture present on them. After washing, the leaves were allowed to dry at room temperature for 2 days. The dried leaves were powdered using a domestic mixer and then 10 g leaf powder was mixed in 100 mL double-distilled (DD) water and soaked in an Erlenmeyer flask. The solution was boiled at 70 °C for 30 min. The leaf extract was allowed to cool to room temperature and filtered with the help of Whatmann No. 1 filter paper. The final leaf extract was stored for further experimental use.

2.1.2 Synthesis of NiO NPs

The NiO NPs were synthesized by ultrasonic-wave-assisted green method using the D. elata leaf extract. First, 0.1827 g nickel nitrate (0.01 M) was mixed to 100 mL D. elata leaf extract and vigorously stirred for 24 h constantly. Afterwards, the solution was kept under a probe type sonicator (Advanced Sonicator; Lark, New Delhi, India) and 40 kHz ultrasonic waves were passed through it for 15 min. The resulting greenish solution was mixed with DD water and centrifuged at 7000 rpm for 30 min followed by washing with DD water and ethanol three times to remove the impurities. The greenish black gel was kept in a hot-air oven at 80 °C to remove the water content. To acquire nanocrystalline powder, this was calcinated at 400 °C for 3 h. A fine black powder was procured, which was carefully collected for further characterization purposes. The schematic representation of synthesis procedure is shown in Fig. 1.

Fig. 1
figure 1

Schematic representation of NiO NP synthesis

2.1.3 Sample Preparation for Corrosion Studies

A single-step coating process using aqueous solution without applying electrical current is the most ideal from the viewpoint of preparation cost and ecological burden. The Zn metal plate was used to study the anticorrosive behavior of the prepared NiO NPs. The Zn metal plate was subsequently polished with 9 mm, 3 mm, and 1 mm SiC grit papers and cleaned after each steps with acetone followed by deionized water, and then dried in the hot-air oven. Then, 15 mg prepared NiO NPs was mixed with polyvinylidene difluoride and N-methyl-2-pyrrolidone at 80:15:5 weight proportions to make slurry. The slurry was further coated over on 1 cm2 area of the Zn metal plate surface using the doctor’s blade technique. The coating was repeated for three times to obtain a uniform thickness of ~ 1 mm NiO NPs on to the metal surface. The coated plate was dried in the hot-air oven at 353 K for 1 h and then used for corrosion studies under four electrolytes atmospheres, namely 1 M H2SO4, 1 M HCl, 3.5% NaCl, and 6 M KOH. A similar technique was followed for Mg plate to coat NiO NPs on its metal surface. Hereafter, the coated sample is termed as Zn/NiO and Mg/NiO for Zn and Mg plates, respectively.

2.1.4 Characterization Techniques

The X-ray diffraction patterns of the prepared NiO NPs were obtained using a powder X-ray diffractometer (XRD; X’Pert PRO; PANalytical, Almelo, the Netherlands) operated with the CuKα at 40 kV and 30 mA. The Fourier transform infrared (FTIR) spectra of the NiO NPs were recorded using an FTIR spectrophotometer (Spectrum 100; PerkinElmer, Florida, USA) in the range of 4000–450 cm−1 using KBr as an active medium. A particle size analyzer (Nanophox; Sympatec, Germany) was used to study the common particle size distribution based on the dynamic light scattering method and a laser beam at a wavelength of 633 nm. The measurement was continuously repeated for five times to get average particle size. The specific surface area was calculated by the Brunauer–Emmett–Teller (BET) analysis using a BET surface area analyzer (Autosorb AS-1MP; Quantachrome, Boynton Beach, FL). The sample was degassed under vacuum at 363 K for 3 h to remove the physisorbed moisture. The mean pore size distributions and total pore volume were calculated using the Barrett–Joyner–Halenda (BJH) method. The thermal degradation properties of the prepared NiO NPs were evaluated using a thermogravimetric analyzer and a differential thermal analyzer (Exstar TG/DTA 6300; Hitachi, Tokyo, Japan) at a heating rate of 10 °C/min up to 1000 °C under nitrogen atmosphere. The high-resolution transmission electron microscopy (HRTEM) images were obtained using a Gatan Quantum ER 965 imaging filter installed on the instrument (JEOL, Tokyo, Japan). A field-emission scanning electron microscope (FESEM; JSM-6790 LS; JEOL) was used to analyze the surface morphology of the prepared NiO NPs.

To explore the corrosion inhibition properties of NiO NP coatings, the NiO NP-coated Zn/NiO and Mg/NiO plates were immersed in various electrolytes such as 1 M H2SO4, 1 M HCl, 3.5% NaCl, and 6 M KOH for 24 h. The electrochemical corrosion behavior of the Zn/NiO and Mg/NiO plates was studied employing a three-electrode arrangement using an electrochemical workstation (PGSTAT302N; Metrohm Autolab, the Netherlands) at room temperature. The surface-related properties, namely topographical properties, roughness, and hardness, of all the coated samples were characterized before electrolyte immersion and after linear sweep voltammetry (LSV) test using an in situ scanning probe microscope (SPM) equipped with a Berkovich nanoindenter to measure the hardness (H) of the nanostructured coating using quasistatic software. A maximum load of 600 μN was applied to the projected specimen (10 μm area) for 15 s with a loading and an unloading force rate of 100 μN/s including a dwell period. In addition, surface roughness of the coating was explored by microstructure analysis. The surface properties of the uncoated metal plates were measured for comparative assessments.

3 Result and Discussion

3.1 Structural and Functional Group Analyses of NiO NPs

The biosynthesized NiO NPs were analyzed through the XRD and a particle size analyzer to evaluate their structure and particle size. Figure 2a shows the XRD graphs of green-synthesized NiO NPs using D. elata leaf extract. The distinctions in peak broadening are associated with crystallite form, defects, the symmetry of crystals, in addition to crystallinity. The sharpened reflection peaks are observed in the XRD patterns of the calcined sample, which indicate the formation of NiO NP crystallites has occurred. The diffraction peaks at 37.64°, 43.72°, 63.64°, and 75.68° correspond to (111), (200), (220), and (311) crystal planes of NiO NPs, respectively. All the reflections can be indexed to the face-centered cubic (FCC) NiO phase, which match closely with standard records (JCPDS card no. 75-0197). The sharpness and the intensity of the peaks imply the crystalline nature of the sample [34, 35].

Fig. 2
figure 2

a XRD patterns, b FTIR spectra, c particle size analysis, d zeta potential analysis curve of NiO NPs

The lattice parameter a, unit cell volume V, and average crystallite size D of the synthesized FCC structures were calculated by the following relations [36]:

$$\frac{1}{{d}^{2}} = \frac{{h}^{2 }{+ k}^{2 }{+ l}^{2}}{{a}^{2}},$$
(1)

where d is the interplanar spacing; h, k, and l are the miller indices; and a is the lattice parameter.

$$V={a}^{3},$$
(2)

where V is the unit cell volume and a is the latticing constant.

$$D=\frac{k\lambda }{\beta {\rm{cos}}\theta },$$
(3)

where D is the average crystallite size, which was taken for three main predominant peaks; k is the shape factor, which corresponds to 0.9; λ is the wavelength of the X-ray source (1.5406 Å); β is the full-width at half maximum of diffraction peaks; and θ is the Bragg’s diffraction angle.

The crystallite size of NiO NPs was found to be 7.6 nm. The calculated structural parameters of the prepared NiO NPs are given in Table 1

Table 1 Structural parameters of NiO NPs obtained from XRD analysis

Figure 2b shows the FTIR spectra of the NiO NPs. A sharp band at 2351 cm−1 indicates the presence of OH molecules in the studied sample. The adsorption of water molecules by the nanoparticles indicates that the synthesized nanomaterial possesses high surface area [37]. The peak at 1751 cm−1 shows the presence of carboxylic acids with C=O stretch absorbing bands. The C=C stretching band located at 1637 cm−1. The combination of N–H deformation and C–N stretching vibrations is responsible for the peak at 1547 cm−1. The peaks at 1383 and 622 cm−1 are due to the stretching vibration of the aliphatic C–H stretching mode because the calcined powder tends to physically absorb water and carbonate ion [37]. Stretching ester vibration followed via bands at around 1104 cm−1 attributed to asymmetrical and symmetrical C–O–C stretching. Also, a particular vibration peak at 1048 cm−1 is related to glycogen [38].Thus, the results of FTIR spectrum coincide with the XRD data and in turn confirm the formation of highly pure single NiO NPs.

The average particle size distribution of NiO NPs is shown in Fig. 2c. It is in the range of around 17–18 nm. The mean particle size distribution (d50) of NiO NPs is 17.19 nm. The zeta potential is a parameter widely used to predict the colloidal suspension lucidity of synthesized NiO NPs (Fig. 2d). It shows the degree of repulsion among the dispersion medium. The high lucidity of the nanoparticles is analogous with their negative charge [39]. In this study, the zeta potential of green-synthesized NiO NPs was − 44 mV, which showed a high stability of the NPs due to influence of ultrasonic waves [34].

3.2 Morphological Analysis of NiO NPs

The surface morphology of the prepared NiO NPs was studied using FESEM (Fig. 3a), which shows a spherical structure. Spherical nanosizes were produced because of the influences of ultrasonic waves during the synthesis process and calcination temperature, which affect the nanoparticle size [40]. The NiO NPs with a mean diameter of approximately 23.8 nm were produced at 400 °C as the ultimate calcination temperature. To speculate the morphology and crystallinity of the biosynthesized NiO NPs, HRTEM images were recorded, as shown in Fig. 3b, c. It can be observed that the synthesized product consists of almost spherical-shaped particles with size approximately 10–20 nm, which is in proper agreement with average crystallite size evaluated from the XRD pattern. The SAED patterns of the NiO NPs are shown in Fig. 3d. The appearance of robust diffraction rings confirmed the formation of single crystalline cubical NiO NPs, which matched well with XRD diffraction patterns [40].

Fig. 3
figure 3

Morphological analysis of NiO NPs. a FESEM image, b, c different magnifications of HRTEM micrograph, and d SAED patterns of NiO NPs

3.3 Thermal and Textural Analyses of NiO NPs

Large surface area of nanomaterials offers a great possibility for diverse applications [19, 27]. Figure 4a shows the BET analysis of NiO NPs. The specific surface area of NiO NPs is 194.8 m2/g. The mean pore size distribution was evaluated as 3.9 nm using the BJH method. This indicates that NiO NPs are mesoporous with relatively uniform pore size distribution. The total pore volume in the sample is approximately 0.779 cc/g.

Fig. 4
figure 4

a BET analysis of NiO NPs (inset, pore size distributions), b TGA/DTA analysis of NiO NPs

The thermogravimetric analysis (TGA) was conducted at a heating rate of 10 °C/min up to 1000 °C under nitrogen atmosphere (Fig. 4b). Three weight losses were found from the TGA curve: at (a) 100 °C (I), 320 °C (II), and 640 °C (III). In the DTA analysis, the two endothermic peaks observed at 100 and 320 °C are likely due to water loss and nickel organic thermal decomposition, respectively [36, 41]. A minor weight loss (I) at 100 °C is because of the evaporation of water molecules. The weight loss between 300 and 700 °C is due to the thermal decomposition or dehydration of Ni (OH)2 to form NiO NPs and small amount of moistures and impurities present on the surface of the NiO NPs [11].

3.4 Electrochemical Corrosion Studies

3.4.1 Linear Sweep Voltammetry Analysis

Figure 5a–d shows the LSV analysis of Zn and Zn/NiO plates in four electrolytic solutions—3.5% NaCl, 1 M HCl, 1 M H2SO4 and 6 M KOH—at a range of 0 to − 1.8 V. The observed voltagram results indicate sharp electrolytic peaks near − 1.3 V and for Zn and Zn/NiO plates in 3.5% NaCl and 6 M KOH electrolytic media, which is negative. At − 1.4 V a broad electrolytic peak is observed in 6 M KOH electrolytic solution. In 1 M HCl and 1 M H2SO4 electrolytes, reduction peaks were observed at − 0.8 and − 0.9 V, respectively. The results of voltagrams indicate that the Zn/NiO plate shows better reduction peaks in 6 M KOH and 3.5% NaCl solution compared to 1 M HCl and 1 M H2SO4 due to high crystallization of NiO NPs, which influences the electrochemical catalytic and corrosive activities [37].

Fig. 5
figure 5

Linear sweep voltammetry of uncoated and NiO NP-coated Zn plates in aqueous electrolytes

The LSV analysis of Mg and Mg/NiO plates in different electrolytic solutions are shown in Fig. 6a–d. The electrolytic reduction peaks are observed near to − 1.4, − 1.5, − 0.6, and 0.7 V in 3.5% NaCl, 6 M KOH, 1 M HCl, and 1 M H2SO4 electrolytic solutions, respectively. Compared to Mg/NiO plates, Zn/NiO plates show more negative peaks in acidic electrolytic solutions.

Fig. 6
figure 6

Linear sweep voltammetry of uncoated and NiO NP-coated Mg plates in aqueous electrolytes

3.4.2 Potentiodynamic Polarization Study (Tafel Plot)

Figures 7 and 8a–d show the potentiodynamic polarization curves or Tafel plots of Zn, Zn/NiO, Mg, and Mg/NiO in 3.5% NaCl, 1 M HCl, 1 M H2SO4, and 6 M KOH electrolytic solutions, respectively. The electrochemical corrosion parameters such as corrosion rate (CR), corrosion potential (Ecorr), corrosion current (Icorr), and polarization resistance (Rpol) were calculated from the Tafel plot and shown in Table 2. For an easy understanding, electrochemical corrosion inhibition behaviors of Zn and Mg plates are discussed electrolyte wise.

Fig. 7
figure 7

Tafel plot for linear sweep voltammetry of uncoated and NiO NP-coated Zn plates in aqueous electrolytes

Fig. 8
figure 8

Tafel plot for linear sweep voltammetry of uncoated and NiO NP-coated Mg plates in aqueous electrolytes

Table 2 Tafel polarization parameters of uncoated and NiO NP-coated Zn and Mg plates in different electrolytes

For 3.5% NaCl electrolytic solution, the results of potentiodynamic polarization studies of Zn and Zn/NiO (Fig. 7a), and Mg and Mg/NiO (Fig. 8) revealed that the Zn/NiO metal plates were anodically polarized than Mg/NiO metal plates. Both the coated plates have corrosion inhibition tendency than pure Zn and Mg plates. The corrosion potential (Ecorr) of the Zn/NiO and Mg/NiO samples are more positive than the NiO NP-coated plates. This indicates that the Zn/NiO and Mg/NiO plates have lower corrosion rate (0.30871 and 0.08573 mm/year) than the pure plates (0.220491 mm/year and 0.978631 mm/year, respectively). Enhanced polarization resistance of the Zn/NiO and Mg/NiO plates was observed compared to the Zn and Mg samples due to the oxygen reduction of Ni2+ ions.

In the case of 1 M HCl electrolyte medium, the corrosion potential (Ecorr) of Zn/NiO and Mg/NiO was more positive compared to that of the pure Zn and Mg plates. In the presence of inhibitor NiO, the corrosion potential (Ecorr) of Zn (− 979.20 mV) and Mg (− 713.330 V) plates shifts to − 1.0219 V and − 680.130 mV, which lowers the corrosion current of the Zn/NiO and Mg/NiO plates. The corrosion rate is mainly influenced by the NiO NP coating, which reduces the corrosion current (Icorr) at a specific corrosion rate. The corrosion rate of the coated Zn and Mg plates was approximately 1.0341 and 0.07559, respectively, which is very high compared with that of the Zn/NiO and Mg/NiO plates. The polarization resistance of pure Zn (18.748 Ω) and Zn/NiO (179.04 Ω) plates (Fig. 7c) is higher in 1 M HCl medium compared to that of the Mg (1.0689 Ω) and Mg/NiO (1.2385 Ω) plates (Fig. 8c). This suggests better corrosion inhibition in Zn/NiO and Mg/NiO plates; similar results were also observed for Mg and Mg/NiO plates.

In the case of Mg and Mg/NiO plates in 1 M H2SO4, the corrosion rate of the coated plates decreased with an increase in the polarization resistance. These results showed that the corrosion rate was strongly affected by NiO NPs coating on Zn and Mg plates. The higher surface area and porous nature of the prepared NiO NPs can easily adsorb and repulse the hydrogen and sulfur ions in the H2SO4 electrolyte.

However, in the case of Zn, Zn/NiO, Mg, and Mg/NiO plates in 6 M KOH medium, the corrosion potential was approximately − 1.5270, − 1.5197, − 1.6013, and − 1.6609 V, respectively. The corrosion potential values of Zn/NiO and Mg/NiO significantly decreased compared to those of the pure Zn and Mg plates. But the corrosion potential of Zn/NiO plates shifted toward a more negative range than Mg/NiO.

In KOH electrolytic media, the uncoated Zn plate showed a high (8.0667 mm/year) corrosion rate with a high polarization resistance of 25.330 Ω and Zn/NiO showed low corrosion rate of 5.1028 mm/year with a low polarization resistance of 16.800 Ω. Similar results were obtained for Mg and Mg/NiO plates. The above results confirm that the low corrosion rate and high electrochemical corrosion resistance are attained through a thin layer coating of NiO NPs on the surface of Zn and Mg metal plates [35,36,37,38]. A comparative assessment of nanomaterial coating on different metal surfaces for improvement of corrosion inhibition behaviors is given in Table 3.

Table 3 A comparative assessment of nanomaterial coating on different metal surfaces for improvement of corrosion inhibition behaviors

3.4.3 Surface Analysis of Zn/NiO and Mg/NiO Plates

Surface roughness and hardness are important properties to avoid the occurrence of electrochemical corrosion. The surface topography and roughness properties of NiO NP-coated Zn and Mg plates were evaluated using atomic force microscopy (AFM). Figure 9 shows the two-dimensional (2D) and three-dimensional (3D) topographical images of Zn/NiO and Mg/NiO metal plates. It was observed that smaller Zn plates had a smaller grain size with smaller peaks. Their roughness (Ra) was calculated to be 1.045 nm using their root mean square (RMS) values. The images show that plates have regular grain size with irregular, heterogeneous peaks and their roughness is 9.893 nm. The surface roughness values of the NiO-coated metal plates were found to increase after the corrosion behavior analysis. The main reason for increase in surface roughness values of Zn/NiO and Mg/NiO is the interaction of Na, K, Cl, and S ions with the NiO coating. However, the NiO NP coating did not peel off from the surface of Zn and Mg metal plates [37, 39]. The above results indicate that surface roughness of the Zn and Mg plates sharply increases after the LSV analysis. Table 4 shows the surface roughness of Zn/NiO and Mg/NiO metal plates before and after LSV test, which were measured from AFM analysis.

Fig. 9
figure 9

Topographical micrographs of Zn/NiO (a i, ii) and Mg/NiO (b i, ii)

Table 4 Surface roughness and hardness parameters of uncoated and NiO-coated Mg and Zn plates before and after LSV test

The nanoindentation results of NiO-coated Zn and Mg plates before and after LSV measurements are shown in Fig. 6a–d. Under experimental condition, an indentation of each five-point result on load–displacement curve showed almost identical reproducibility of surface coatings. It was found that after LSV measurements, the hardness and roughness values of the coated plates slightly increased. During the LSV testing period, the NiO NP coating offered a strong protection to the surface of the Zn and Mg plates. The large surface area and highly stable NiO NPs easily diffused the ions from the corrosive medium in terms of electrolyte such as K, Na, and S ions. In Fig. 10a–d, inset shows the hardness values of uncoated and NiO-coated plates before and after LSV measurements. The values of for NiO NP-coated plates are higher compared with those of uncoated plates, which match with surface roughness results of the AFM studies.

Fig. 10
figure 10

Nanoindentation test images of uncoated and NiO NP-coated Zn and Mg plates before and after LSV tests

From the results of electrochemical corrosion analysis and surface roughness studies, it was found that the prepared NiO NPs highly enhance the corrosion inhibition behaviors of Zn and Mg metal plates due to their high surface area and highly stable capabilities in water medium, which were identified from zeta potential analysis. The increment in the surface roughness of Zn/NiO and Mg/NiO plates was unavoidable during the electrochemical reaction process.

4 Conclusion

The high surface area NiO NPs were synthesized by ultrasound-assisted green route using D. elata leaf extract as a reducing agent. Owing to the influence of ultrasonic waves, the prepared NiO NPs were having high crystallinity, high purity, and higher surface area (194.8 m2/g). Also, due to the effect of ultrasonic waves and D. elata leaf extract, particle sizes of the prepared NiO NPs were in nanoscale range with high potential stability (− 44 mV). The results obtained from optical microscopy, AFM, and nanoindentation techniques were in good agreement for stability of NiO coating on Zn and Mg metal plates. The prepared NiO NP-coated Zn metal plates showed excellent corrosion inhibition behaviors under H2SO4 medium compared with other three electrolyte mediums. It shows 88.6% enhanced corrosion resistance in 1 M H2SO4 whereas 68.4%, 75.7%, and 56.8% improved corrosion resistance in 3.5% NaCl, 1 M HCl, and 6 M KOH media, respectively. However, NiO NP-coated Mg metal plates showed excellent corrosion inhibition efficiency of 61.1%, 71.9%, 79.5%, and 55.9% in 3.5% NaCl, 1 M HCl, 1 M H2SO4, and 6 M KOH media. From the above-mentioned experimental assessment, it can be said that ultrasound-assisted green-synthesized NiO NPs is a one of the potential candidates for improving the corrosion inhibition behaviors of Zn and Mg metals. In addition, the comparative assessment of electrochemical studies using various electrolytes helped to understand the functional behaviors of green-synthesized NiO NPs and showed that they are a perfect corrosion inhibitor for Zn and Mg metal plates in HCl and H2SO4 media.