1 Introduction

Magnesium alloys possess distinct properties and are used in biomedical applications, aerospace and automobile industries. The main reasons for their applications are due to their lightweight, good flexibility, and good barrier properties [1,2,3,4,5]. The applications of magnesium alloys are limited in different industries due to the lower anticorrosion properties [6,7,8]. The degradation of magnesium alloy mainly takes place in the electrolyte containing chloride ions. It is because of the reaction of the chloride ions with magnesium forming chlorides of magnesium. Although magnesium alloys containing chromium, copper, manganese, and silicon show good anticorrosion and mechanical properties, the presence of chloride ions enhances the dissolution of magnesium in magnesium alloy [9,10,11]. The anticorrosion properties of magnesium alloy are severely affected by different factors such as environment, composition, etc. The deposition of the magnesium hydroxide layer on the magnesium alloy occurs when the alloy is exposed to an alkaline environment. The resultant magnesium hydroxide layer can in turn easily react with the electrolytes containing chloride ions forming soluble magnesium chloride.

In order to increase the corrosion protection performance of magnesium alloys, polymers were generally utilized to coat the surface [12, 13]. Organic coatings on the metal/alloy surface can generally protect them from being corroded. It is the physical barrier that actually prevents the metal/alloy surface being exposed to the corrosive electrolyte when the polymer coatings are used. The penetration of aggressive ions at the coating/alloy interface is the major problem faced by the use of normal organic coatings. To protect the metals and alloys against corrosion, various nanoparticles were added to the polymers to prepare nanocomposites [14,15,16,17,18]. The barrier properties of the coating were improved when the nanoparticles were added to the polymer coatings [19,20,21,22,23]. The inclusion of either nanoparticles or functionalized nanoparticles into the polymer coatings can reduce the formation of cracks and pores. It was very difficult for the aggressive corrosive ions to go through the defects of the nanocomposite coatings when the coatings contained nanoparticles or functionalized nanoparticles. As the cobalt (II) oxide nanoparticles show good chemical resistance and barrier properties, they can be used in the synthesis of nanocomposite coatings which enhance the barrier and mechanical properties. Although different organic and inorganic compounds are used to functionalize the nanoparticles, silanes are widely used to functionalize the nanoparticles due to their excellent adhesive and anticorrosive properties [24,25,26]. Moreover, silanes are environment friendly [27,28,29,30].

This article deals with the synthesis, electrochemical characterization, and surface morphological studies of polypyrrole/silanes/CoO nanocomposite coated magnesium alloy in 3.5% NaCl solution. Triethoxyphenylsilane (TES), 3-glycidoxypropyldiethoxyethylsilane (GES), and (3-mercaptopropyl) triethoxysilane (MES) were used for the surface modification of CoO nanoparticles. Electrochemical techniques were utilized to investigate the anticorrosion properties of the coated magnesium alloy. The SEM/EDX and XRD techniques were used to examine the corrosion products. The resultant nanocomposites are analysed for their mechanical properties. The corrosion protection mechanism of the polypyrrole(Ppy)/silane/CoO nanocomposite has been proposed.

2 Experimental

2.1 Materials

Pyrrole and ammonium persulphate (APS) were purchased from Sigma chemicals and used as received. All other chemicals were of analytical grade and used without further purification. Triethoxyphenylsilane (TES), 3-glycidoxypropyldiethoxyethylsilane (GES), and (3-mercaptopropyl) triethoxysilane (MES) were received from Sigma Aldrich. The composition (in wt%) of magnesium alloy (AZ91) was 9.5 Al; 1.2 Zn; 0.12Si; 0.11Mn, and balance Mg. The size of the sample for the investigation was 50 mm × 30 mm × 5 mm.

2.2 Preparation of Polypyrrole/Silane/CoO Coating

Polymerization of pyrrole monomer was carried out in the chemical oxidative environment. For the preparation of Ppy, 50 mL of 0.2 M aqueous pyrrole was added drop wise to 50 mL of a 0.2 M aqueous solution of APS under constant magnetic stirring for 2 h at 5–10 °C. The resulting black precipitates so obtained was then filtered and washed with distilled water, followed by ethanol until the filtrate became colourless. The Ppy so obtained then dried by keeping in the oven at 70 °C for overnight. The dry powdered sample was then made into pellets using a stainless steel die of 1.3 cm diameter in a hydraulic press under a pressure of 5 tons. The structure of the synthesized polymer has been successfully achieved and the FTIR analysis results have also confirmed the polymerization.

In order to prepare the polypyrrole/silane/CoO nanocomposite, CoO nanoparticles (0.5%) were mixed with silane in chloroform and were sonicated for 1 h. The silane functionalized CoO nanoparticles (0.30 g) were taken in deionized water (200 mL) in a three-neck round-bottomed flask fitted with a mechanical stirrer, followed by the ferric chloride (FeCl3·6H2O) (0.91 g). Pyrrole (0.10 mL) was added to the above mixture via a syringe, and the in situ polymerization was allowed to proceed for 24 h at room temperature. The pH of the reaction mixture was adjusted to be 7.0 to prevent aggregation of the particles. The resulting PPy-silane/CoO coating was purified by repeated centrifugation–dispersion cycles. Then, the sonication was done in order to homogenize polymeric components for 30 min. The magnesium alloy samples were coated with polypyrrole and the polypyrrole/silane/CoO nanocomposite using a spin coater. The resultant thickness of the coatings was 50 ± 1 μm. The functionalization of CoO nanoparticle was confirmed by SEM/EDX and XRD studies.

2.3 Electrochemical Measurements

Potentiodynamic polarisation studies (PDP) and EIS tests were performed with an IVIUMstat electrochemical instrument in a three-electrode cell consisting of 1 cm2 platinum foil (counter electrode), Ag/AgCl (reference electrode), and magnesium alloy (working electrode). EIS experiments were done at the open circuit potential (OCP) in the frequency range of 100 kHz–10 MHz. EIS spectra were analyzed using equivalent electric circuit models constructed using Zview software.

SECM technique was used to investigate the anticorrosive properties of the Ppy and Ppy/silane/CoO nanocomposite coated Mg alloy in 3.5% NaCl solution. A Pt microelectrode with 10 μm diameter was used as SECM tip. Video microscope was utilized to position the Pt microelectrode above the sample. To find the corrosion behavior of the coated sample, the imaging analysis was done at a height of 20 µm across the sample in the x direction. The scan rate was set as 20 μm/s. Measurements were performed in triplicate to ensure the reproducibility of the results.

2.4 Surface Morphology of the Nanocomposite Coated Mg Alloy

The cross-sectional surface properties of the resultant coatings were examined by scanning electron microscopy (SEM, JSM-6360LV, JEOL, Japan) with an EDX detector system. The 5.0 kV is applied as the acceleration voltage. The corrosion products of the nanocomposite coated Mg alloy surface in 3.5% NaCl solution were examined using X-ray diffractometer (XRD; Bruker model D8, Germany).

2.5 Mechanical Properties of the Coated Mg Alloy

Electronic Universal Material Testing Machine (Instron Corporation, USA) was utilized to calculate the adhesion strength of the studied coatings to the Mg alloy surface with and without immersion in 3.5% NaCl solution by pull-off measurements as per ASTM D3359 standard. The universal testing machine was used to test the tensile strength of the coated Magnesium alloy at a crosshead speed of 10 mm/min. The HM113 Vickers hardness tester was involved in measuring the micro hardness. The measurements were performed in accordance with ASTM standard E384 for micro-indentation hardness of materials. The indentation loads were varied between 98 and 980 mN and the indentation time was fixed at 20 s.

3 Results and Discussion

3.1 Characterization of Polypyrrole

The FTIR spectrum of polypyrrole is shown in Fig. 1. The peaks attributed to C–H wagging appear at 920 cm−1. It can be observed that here are some common absorption peaks at 3436 cm−1 that may be assigned to –OH stretching, at 2928 cm−1 wave number that may be assigned to aromatic C–H stretching. The FTIR spectra of polypyrrole show the peak at 1404 cm−1 corresponds to aromatic C–N vibration and the other peak at 1560 cm−1 is related to N–H stretching. The peak at 790 cm−1 proves that the pyrrole is being polymerized. The peak at 1176 cm−1 can be assigned to the C–H deformation of Ppy [31].

Fig. 1
figure 1

FTIR analysis of as synthesized polypyrrole (Ppy)

3.2 Characterization of the Functionalized CoO Nanoparticles

The XRD pattern of the cobalt oxide nanoparticle was compared and interpreted with standard data of the JCPDS file (JCPDS international center for diffraction data, 1991). The XRD pattern of cobalt oxide nanoparticles was represented in Fig. 2. The characteristic peaks at 2θ = 37.43°, 42.48°, 62.40°, 73.90°, and 77.91° for cobalt oxide nanoparticles, which are marked respectively by their indices (111), (200), (220), (311), and (222) in agreement with JCPDS card no 73-1701. The X-ray pattern confirmed the phase formation of cobalt oxide nanoparticles. The position of the peaks for the silane functionalized CoO nanoparticles remains the same. However, the intensities of the peaks for silane functionalized CoO nanoparticles have been reduced to some extent.

Fig. 2
figure 2

XRD analysis of CoO and silane modified TES-CoO, GES-CoO, and MES-CoO nanoparticles

The morphology of the CoO nanoparticles and the silane functionalized CoO nanoparticles was investigated using SEM/EDX analysis as shown in Fig. 3. SEM images of the nanoparticles demonstrated a spherical shape and the average particle size measured was 50 ± 5 nm. The presence of sulphur and Si is confirmed in MES-CoO nanoparticles.

Fig. 3
figure 3

SEM/EDX analysis of CoO nanoparticles (a) and silane modified TES-CoO (b), GES-CoO (c), and MES-CoO (d) nanoparticles

3.3 Electrochemical Impedance Spectroscopic Measurements

Figure 4 presents the Nyquist plot for the bare Mg alloy, polypyrrole (Ppy), various amounts of functionalized nanoparticles incorporated polypyrrole coatings in 3.5% NaCl solution. The addition of CoO nanoparticle up to 3 wt% to the Ppy coating increases the coating resistance. However, the addition of CoO nanoparticle beyond 3 wt% to the Ppy coating decreases the coating resistance. Therefore, the optimum concentration of CoO nanoparticles is found to be 3 wt%. This is may be due to the problems in the dispersibility of the nanoparticle homogeneously at higher concentration of CoO nanoparticles. Figure 5a–d show Nyquist plots for polypyrrole (Ppy), Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coatings in chloride media, respectively, for 1 day, 20 days, 40 days, and 80 days. It can be seen from the figures that the impedance starts decreasing with increase in the immersion times. The highest impedance is observed for the Ppy/MES/CoO nanocomposite coating. The equivalent electrical circuit can be used to fit the EIS data for the coated Mg alloy as shown in Fig. 6. The resistances of the solution, coating, and charge transfer are denoted as Rs, Rc, and Rct, respectively. The capacitances of coating and electrical double layer are denoted as CPEc and CPEdl, respectively. The fitted parameters obtained are presented in Table 1. It is evident that the Rct values for polypyrrole (Ppy), Ppy/TES/CoO, PT/GES/CoO, and Ppy/MES/CoO nanocomposite coatings in 3.5% NaCl solution are found to be 1004.29, 3175.90, 5128.05, and 7998.91 kΩ cm2 compared to the bare magnesium alloy (59.15 kΩ cm2) at 1 day immersion in 3.5% NaCl solution. However, the Rct values are slowly decreased to 2739.28, 4716.12, and 7516.67 kΩ cm2 for Ppy/TES/CoO, PT/GES/CoO, and Ppy/MES/CoO nanocomposite coatings, respectively, whereas a significant reduction in Rct values are observed for bare Mg alloy (16.95 kΩ cm2) and Ppy coated Mg alloy (545.88 kΩ cm2). It is clearly shown that the addition of silane-modified CoO nanoparticles in Ppy coatings could effectively block the passage of corrosive ions from the chloride media to the coating-Mg alloy interface. Moreover, Ppy/MES/CoO coated samples show the highest Rct value of 7998.91 kΩ cm2 compared to those Ppy/TES/CoO, and PT/GES/CoO coatings. The presence of a lone pair of electrons in mercapto(–SH) group of MES enhances the adsorption of Ppy/MES/CoO nanocomposite coating on the Mg alloy surface to form a protective film which prevents the penetration of corrosive ions and protects it against coating degradation.

Fig. 4
figure 4

Nyquist plots obtained for bare Mg alloy, and the alloy coated with Polypyrrole (Ppy), Ppy/silanes with various % of CoO nanoparticles in chloride media

Fig. 5
figure 5

Nyquist plots for Polypyrrole (Ppy), Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coated Mg alloy for different days in chloride media

Fig. 6
figure 6

Equivalent electrochemical circuit for Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coated Mg alloy in chloride media

Table 1 The fitted results of EIS using equivalent circuit

On the other hand, the observed coating resistance values of magnesium alloy coated with Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite as shown in Table 1 are 901.11, 2127.25, 3721.70 and 5424.22 kΩ cm2, respectively at 1 day in chloride environment. Moreover, the slow decrease in the coating resistance (Rc) values observed for Mg alloy coated with Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO are 1399.84, 2976.11, and 4825.32 kΩ cm2, respectively at 80 days immersion in 3.5% NaCl solution. However, a significant decrease in the coating resistance is observed for Ppy coated magnesium alloy (from 901.11 kΩ cm2 at 1 day to 9.86 kΩ cm2 at 80 days immersion) in chloride media. It is because of the presence of defects/pores which allow the aggressive ions to pass through the coating/Mg alloy interface, which results in the degradation and delamination of Ppy coated surface. The improved coating resistance was displayed for the Ppy/MES/CoO nanocomposite compared to other studied coatings and resulted in the highest protection against the bare Mg alloy corrosion. The lone pair of electrons in the mercapto group of the silane of the Ppy/MES/CoO nanocomposite provides enhanced adhesion of the coating to the Mg alloy surface compared to other studied coatings. Although Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coatings display improved resistance, it is the electron-donating nature of the –SH group which helps to improve the adhesion strength of Ppy/MES/CoO on the magnesium alloy surface. The coating and the charge transfer resistances of the investigated coatings are higher than those of the reported coatings [32, 33].

The increased Rc and Rct values are displayed in Ppy/MES/CoO coated sample followed by Ppy/GES/CoO and Ppy/TES/CoO. This is due to the fact that the presence of a mercapto group in MES and the epoxide group in GES helps to increase the chemical bonding between Mg alloy surface and nanocomposite. This results in the prevention of passage of corrosive ions into coating-Mg alloy interface. The presence of silane embedded CoO nanoparticles enhances the corrosion protection performance of the Ppy/MES/CoO, Ppy/GES/CoO, and Ppy/TES/CoO nanocomposite coated sample by filling the micropores/defects with the silane functionalized nanoparticles in polypyrrole in 3.5% NaCl solution. Therefore, the EIS experiments proved the effectiveness of the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coating in preventing the passage of corrosive ions through the coating, which resulted in the enhancement of anticorrosive properties.

3.4 Potentiodynamic Polarization Measurements

Figures 7a–d display the polarisation curves observed for Mg alloy coated with (a) polypyrrole (Ppy), (b) Ppy/TES/CoO, (c) Ppy/GES/CoO, and (d) Ppy/MES/CoO immersed in chloride media, respectively, for various days. The fitted potentiodynamic polarisation parameters are presented in Table 2. The reduced corrosion current (icorr) was displayed for the coated samples compared to uncoated Mg alloy as can be seen from Table 2. The Ppy coated Mg alloy increased the polarization resistance to 23,889 kΩ cm2 and the icorr was decreased to 49.98 µA/cm2. Moreover, a significant reduction in the icorr was observed for Ppy/silane/CoO coating. The incorporation of silane functionalized CoO nanoparticles in the Ppy to form the Ppy/silane/CoO nanocomposite coating resulted in more significant resistance to corrosion with a icorr value of 5.80 μA/cm2 and Rp of 34,501 kΩ cm2 for Ppy/TES/CoO, icorr of 2.71 μA/cm2 and Rp of 44,904 kΩ cm2 for Ppy/GES/CoO, and icorr of 1.20 μA/cm2 and Rp of 59,919 kΩ cm2 for Ppy/MES/CoO nanocomposite coatings in 1-day immersion. However, a slow increase in the icorr values was measured for Ppy/TES/CoO (70.80 μA/cm2), Ppy/GES/CoO (34.29 μA/cm2), and Ppy/MES/CoO (16.85 μA/cm2) nanocomposite coated magnesium alloy at 80 days in chloride medium. Correspondingly, the decrease in polarisation resistance was measured for Ppy/TES/CoO (27,598 kΩ cm2), Ppy/GES/CoO (40,097 kΩ cm2), and Ppy/MES/CoO (56,199 kΩ cm2) nanocomposite coated magnesium alloy. In the case of, there is a significant increase in values of The icorr values were significantly increased to 296.98 μA/cm2 and correspondingly, the Rp values were decreased to 14,796 kΩ cm2 at 80 days for the Ppy coated Mg alloy in chloride media. However, the significant decrease in icorr and the increase in Rp values for the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coating were due to the blockage of aggressive ions to the Mg alloy/coating interface. Moreover, the decrease in the corrosion rate was observed for the Ppy coating by the inclusion of silane-modified CoO nanoparticles (Ppy/TES/CoO: 0.0187 mm/year; Ppy/GES/CoO: 0.0114 mm/year; and Ppy/MES/CoO: 0.0061 mm/year at 80 d in chloride environment), which prevent the penetration of chloride ions at the Mg alloy/coating interface, hence blocking the corrosion processes. Whereas, there was a significant increase in the corrosion rate of Ppy (0.0509 mmpy) and Mg alloy (1.0952 mmpy). Hence, it was confirmed that the silane-modified CoO nanoparticles in the nanocomposite improved the protecting ability of the coating significantly.

Fig. 7
figure 7

Potentiodynamic polarisation curves of Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coated Mg alloy for various days in chloride media

Table 2 Results of potentiodynamic polarization measurements

3.5 Scanning Electrochemical Spectroscopic Measurements

Figure 8 shows the SECM measurements of Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated Mg alloy for 1 day and 80 days at − 1.65 V in 3.5% NaCl solution. The higher current at the defects confirms the dissolution of Mg alloy. The Ppy coated magnesium alloy shows 4.7 nA at 1 day whereas the current at 80 days is 13.6 nA. The increase in the dissolution of Mg with exposure time is due to the formation of Mg2+. The resultant current at the scratch of Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated Mg alloy at 1 day immersion are 1.9 nA, 1.7 nA, and 1.4 nA, respectively. Whereas the current at the scratch of Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated Mg alloy at 80 days immersion is found to be 3.9 nA, 3.1 nA, and 2.5 nA, respectively.

Fig. 8
figure 8

SECM images obtained at tip potential − 1.65 V for the scratched surface of Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coated Mg alloy for 1 day and 80 days in chloride media

It is seen that an enhanced tip current is noticed at − 1.65 V on the defect compared to the smooth surface, which results in the dissolution of Mg. Moreover, a lower tip current is displayed for the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated magnesium alloy. The formation of Mg alloy-silane/CoO complexes suppresses Mg degradation in the Ppy/silane/coated Mg alloy. Lower current at the scratch of Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated Al alloy results in the formation of passive layer. The passive layers formed at the scratch prevent the Mg alloy exposed to the chloride media and hence, minimizing the Mg alloy dissolution. Hence, the inclusion of silane-modified CoO nanoparticles in the Ppy coating improves the corrosion resistance of Mg alloy. Therefore, the SECM measurements proved that the addition of silane-modified CoO nanoparticles in the Ppy coating enhanced the protection performance of the Ppy. It is confirmed from the SECM analysis that the investigated coatings have superior corrosion protection performance that the reported coated specimens [13, 34].

3.6 SEM/EDX of the Investigated Coatings

Figure 9 shows the SEM analysis of a coated surface area of (a) Ppy, (b) Ppy/TES/CoO, (c) Ppy/GES/CoO, and (d) Ppy/MES/CoO coated Mg alloy. The SEM analyses of the scratched surface area of (a) Ppy, (b) Ppy/TES/CoO, (c) Ppy/GES/CoO, and (d) Ppy/MES/CoO nanocomposite coated Mg alloy after 80 days of immersion in chloride media are shown in Fig. 10. The SEM/EDX analyses of the coated Mg alloy with Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO at 80 days are depicted in Fig. 11. The cracks/defects in the corrosion products were observed in the Ppy coating. On the other hand, the cracks/pores are not significant for the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coated Mg alloy compared to Ppy coating. The passage of electrolytes to the Mg alloy/coating interface was hindered due to the presence of silane-modified CoO nanoparticles in the Ppy coating. This indicated the enhanced corrosion protection properties of the investigated coated Mg alloy. This result compliments the EIS and SECM techniques.

Fig. 9
figure 9

SEM analysis of the coated surface area of a Ppy, b Ppy/TES/CoO, c Ppy/GES/CoO, and d Ppy/MES/CoO coated Mg alloy

Fig. 10
figure 10

SEM analysis of the scratched surface area of a Ppy, b Ppy/TES/CoO, c Ppy/GES/CoO, and d Ppy/MES/CoO coated Mg alloy after 80 days in chloride media

Fig. 11
figure 11

The cross-sectional SEM/EDX analysis of Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coated Mg alloy after 80 days in chloride media

It is evident from the EDX that Co, Al, Si, Mn, Zn, and Mg are present in the degradation products. The formation of complex oxides and chlorides of Co, Al, Si, Mn, Zn, and Mg at scratch leads to the anticorrosion properties of Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coated Mg alloy. Hence, the formation of thin oxide layers at the coating/Mg alloy interface results in the enhanced corrosion protection properties of the studied nanocomposite coated Mg alloy. The presence of sulphur in the corrosion products of the Ppy/MES/CoO nanocomposite coated Mg alloy clearly explains the improved adhesion strength due to the lone pair of electrons in the mercapto group. Therefore, the order of affinity of functional nanoparticles to polypyrrole in this work is MES/CoO > GES-CoO > TES/CoO. Both MES/CoO and GES/CoO nanoparticles perform a very good dispersion in the polypyrrole coating.

3.7 X-ray Diffraction (XRD) Analysis of the Investigated Coatings

Figures 12a and b show the XRD pattern obtained for the Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coated Mg alloy for 1 day and 80 days, respectively. XRD analysis for 1 day and 80 days of Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposites showed the corrosion products at the coating-Mg alloy interface. All the characteristic peaks come from the Mg alloy. Mg alloy reveals the presence of Mg(OH)2, Mg, and Mg2(OH)3Cl·4H2O phases in the corrosion zone. The intensity of the peaks was higher for Ppy compared to those of Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposites. However, the intensity of the peaks has been reduced for 1 d immersion. Moreover, the same phases such as Mg(OH)2, Mg, and Mg2(OH)3Cl·4H2O are found in the corrosion products for 80 days of immersion. However, the intensities of these peaks have been reduced significantly. Therefore, the XRD analysis proved that the increased degradation products formed quickly the Ppy coated Mg alloy in comparison with the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposites coated Mg alloy.

Fig.12
figure 12

XRD pattern observed for the Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposites coated Mg alloy in chloride media for a 1 day and b 80 days

3.8 Oxygen and Water Permeability Test for the Coated Mg Alloy

Figure 13a presents the permeability of the oxygen graph for Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated AZ91 Mg alloy in chloride solution. The addition of silane/CoO in the Ppy coating results in the decreased oxygen permeability. It is confirmed that the resultant Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coatings obtained by the incorporation of silane/CoO with Ppy coating decrease the passage of O2 molecules. It is evident that the oxygen permeability was very less for the Ppy/MES/CoO nanocomposite because of the absence of significant micropores in the coating. In addition to this, the lone pair of electrons in the mercapto group of MES provided strong adhesive property to Ppy coating and consequently, thin films formed by silane-modified CoO nanoparticles on the Mg alloy surface prevent the movement of oxygen from reaching the nanocomposite coating/Mg alloy interface.

Fig. 13
figure 13

a Oxygen permeability and b water permeability curves for Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated Mg alloy at different days in chloride media. Average values of the samples (error bars = standard deviation), calculated on 10 different samples. *p-value < 0.01

Figure 13b depicts the permeability of the water graph for the Ppy and Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coated AZ91 magnesium alloy in chloride solution. It is shown that the incorporation of silane embedded CoO in Ppy results in the decreased water absorption in the coatings. The Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposites bar the passage of H2O reaching the Mg alloy/coating interface. This leads to the reduction in the corrosion initiation process and subsequently decreased the delamination of nanocomposite coatings. Hence, Ppy/MES/CoO nanocomposite coatings displayed much-reduced absorption of water molecules due to the presence of the lone pair of electrons on mercapto groups which increase the adhesion strength of the coatings and block the initiation of corrosion processes.

3.9 Mechanical Properties of the Coated Mg Alloy

The adhesion strength, hardness, and tensile strength test values of magnesium alloy (AZ91) coated with Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO in the absence and presence of 3.5% NaCl solution are depicted in Fig. 14. It can be seen from adhesion tests that the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coatings display good adhesion to the AZ91 Mg alloy surface. Before immersion, the adhesion strength values of the Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coating were 6.2, 9.3, 10.1 and 11.2 MPa, respectively. The Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated sample at 80 days in chloride solution showed the increased adhesion strength of 5.08 MPa, 6.04 MPa and 7.03 MPa, respectively in comparison with the Ppy coating having the adhesion strength of 2.71 MPa. Therefore, a significant reduction in the adhesion strength of Ppy coating was displayed in chloride media, whereas the improved adhesion strength was noticed for the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coatings, which resulted in the slow deterioration of the coatings. The formation of thin films of silane-modified CoO nanoparticles in the Ppy coating on the Mg alloy surface causes better adherence of Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coating to Mg alloy. The hardness values of Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated AZ91 Mg alloy were found to be 269, 651, 801, and 899 MPa respectively without the electrolytes. However, the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated Mg alloy at 80 days in chloride electrolyte displayed a higher coating hardness value of Ppy/TES/CoO: 423.9 MPa; Ppy/MES/CoO: 524.9 MPa; and Ppy/MES/CoO: 625.8 MPa compared to those of Ppy coating (80.1 MPa).

Fig. 14
figure 14

The results of adhesion strength, microhardness, and tensile strength test of Mg alloy coated with Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO before and after immersion in chloride media for different days. Average values of the samples (error bars = standard deviation), calculated on 10 different samples. *p-value < 0.05

Tensile strength values of Ppy, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated AZ91 Mg alloy were found to be 65.0, 115.5, 135.1 and 150.7 MPa respectively in the absence of the electrolyte. The Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coated sample at 80 d in chloride media showed the enhanced tensile strength value of Ppy/TES/CoO: 70.0 MPa; Ppy/GES/CoO: 85.5 MPa; and Ppy/MES/CoO: 100.9 MPa in comparison with the Ppy coating (40.1 MPa).

The formation of silane and CoO films at the interface of Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposite coating-AZ91 magnesium alloy prevents the absorption of electrolytes containing corrosive ions, and hence, coating degradation is reduced. The delamination of Ppy coating occurs through the gap of the coating. It is therefore confirmed that the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coating displayed improved adhesion strength, tensile strength and microhardness in comparison with the Ppy coatings in the 3.5% NaCl solution. The diffusion of ions to the interface of Ppy/Mg alloy and Ppy/silane/CoO-Mg alloy leads to delamination of the coating. Therefore, the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO coatings enhanced the adhesion strength, hardness, tensile strength and protected the Mg alloy from degradation.

3.10 Significance of the Present Study

The incorporation of silane functionalized CoO nanoparticles into the Ppy coatings enhances their barrier performance, by decreasing the porosity and increasing the dispersibility, and reducing the agglomeration of the nanoparticles. Thus, the Ppy coatings containing silane functionalized CoO nanoparticles are expected to have significant barrier properties for corrosion protection and reduce the trend for the coating to blister or delaminate. Moreover, enhanced mechanical properties are observed for the Ppy coating containing silane functionalized CoO nanoparticles.

4 Conclusion

Novel polypyrrole/silane/CoO nanocomposites namely, Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO were synthesized by embedding triethoxyphenylsilane (TES), 3-glycidoxypropyldiethoxyethylsilane (GES), and (3-mercaptopropyl) triethoxysilane (MES) functionalized CoO nanoparticles in polypyrrole and coated on AZ91 Mg alloy as the protective coatings in 3.5% NaCl solution. The synthesized nanocomposites were evaluated by EIS, potentiodynamic polarisation studies, and SECM techniques after exposure to the corrosive chloride medium. The newly synthesized nanocomposites displayed superior anti-corrosion properties. Implanting silane/CoO in the polypyrrole improved the protective properties of the polymer. Potentiodynamic polarization, EIS, and SECM data showed outstanding protection efficiency using the Ppy/TES/CoO, Ppy/GES/CoO, and Ppy/MES/CoO nanocomposites. The nanocomposite coatings behaved as the best physical barrier by effectively blocking the movement of corrosive ions to the coating-Mg alloy interface. This enhanced the resistance of Mg alloy and increased the corrosion protection performance of the coating. Evaluation of mechanical properties of nanocomposite coatings revealed that the resultant nanocomposite coatings possessed excellent adhesive strength, tensile strength and enhanced hardness property. Therefore, it is evident that the studied coatings can be utilized as the vital coatings in protecting the Mg alloy in various applications.