1 Introduction

Mg and its alloys have been attractive candidates for automotive, aerospace industry and 3C products owing to their excellent properties [1,2,3], such as lightweight, high specific strength and specific stiffness, electromagnetic shielding and recycling use [4,5,6]. However, applications for Mg alloys have been restricted seriously due to their lower potentials, being easily subjected to corrosion under acidic and neutral conditions [7,8,9]. And the oxide generated on the Mg surface in the natural environment is porous and cannot provide adequate and long-term protection [10]. Therefore, post-processing is essential for broadening the applications of Mg alloys. Currently, alloying and surface treatment are the primary strategies to prolong the service time of Mg based devices [11,12,13].

Plenty of techniques have been investigated on surface treatments of Mg alloys, such as physical coating [14, 15], chemical conversion [16, 17], micro-arc oxidation (MAO) or plasma electrolyte oxidation [18], ionic liquid [19], sol–gel [20] and layer-by-layer assembly [21]. Nevertheless, these coatings require multiple steps, special processing conditions and time-, energy- and cost-consuming [11]. Thus, the design of a simplest one-step coating is a preferable way to avoid the above-mentioned troubles.

Superhydrophobic surfaces are defined as the surface with a sliding angle (SA) below 10° and a contact angle (CA) beyond 150° [7]. They draw wide attention on account of outstanding advantages [22, 23], for instance, isolating water molecules and aggressive media from the metal surface [24, 25]. Consequently, fluidic drag reduction, self-cleaning and anti-bacterial functions can be achieved on Mg surface with excellent corrosion resistance by constructing superhydrophobic surfaces [26].

Generally, two conditions are required to attain superhydrophobic effect: rough surface structure and low surface energy [27]. This makes the establishment of superhydrophobic structures often demand two procedures: first is to build a rough surface structure and then modified with a low surface energy substance [28].

Dipping, hydrothermal method, chemical and electrochemical deposition, etc., could be applied for constructing the rough surface [10]. And chemicals, such as stearic acid, silanes or fluoroalkyl silane, containing a large number of C–H or C–F bonds, are commonly used for further surface modification [26]. However, the applications of fluorinated silanes are restricted due to their expensive price and adverse effects on the environment. Furthermore, the superhydrophobic coatings prepared by traditional two-step methods have some inevitable disadvantages such as poor durability, weak adhesion and complex multi-step processing [10, 29]. Different from the previously complicated preparation methods, a superhydrophobic coating with a micro/nano-sized rough structure on Mg substrates can be constructed via a facile one-step electrodeposition [30, 31]. As an easy-operated, efficient and low-cost method, one-step electrodeposition applied for the preparation of superhydrophobic coating could diminish coating defects, such as diverse cracks or pores on traditional coatings [32,33,34,35] and limitations of complex structures. However, the durability of one-step superhydrophobic coating has scarcely been reported [27, 36, 37], which has a significant influence on extended corrosion resistance.

This study aims to fabricate an integrated superhydrophobic calcium myristate (Ca[CH3(CH2)12COO]2, CM) coating on magnesium alloy AZ31, which could meet the requirements of low surface energy and rough structure via one-step electro-deposition, and to investigate its corrosion resistance, superhydrophobic performance as well as durability.

2 Experimental

2.1 Materials and Chemicals

The AZ31 Mg alloy ingots (Al 2.5–3.0, Zn 0.7–1.3, Mn > 0.20, balanced Mg) were purchased and extruded to plates from Shandong Yin Guang Yu Yuan Light Metal Precision Molding Co., Ltd., China, then cut into samples with a size of 20 mm × 20 mm × 5 mm. Before electrodeposition process, the AZ31 pieces were polished with SiC sand papers from 400 to 2500 grits, rinsed with deionized water and ethanol, and dried in warm air eventually. Myristic acid (MA, CH3(CH2)12COOH), calcium nitrate (Ca(NO3)2·4H2O) and ethanol with analytical grade were purchased from Qingdao Jingke Chemical Reagent Co., Ltd., China.

2.2 Preparation of Coatings

The calcium nitrate (0.1 M) and myristic acid (0.1 M) were added into 100 mL ethanol with continuous stirring. The AZ31 pieces were placed into the prepared solution as the cathode. And a graphite plate (30 mm × 20 mm × 5 mm) served as the anode, which was 2 cm away from the cathode in the double-electrode system. Direct current source (DC, MAISHENG, MS-305D, China) was employed under a voltage of 30 V for 15 min. Finally, the samples were taken out and rinsed by alcohol, followed by drying in hot air.

2.3 Surface Analyses

Coating composition and surface morphology were analyzed using a field-emission scanning electron microscope (FE-SEM, Nova NanoSEM 450, USA) and attached energy-dispersive spectroscope (EDS). X-ray photoelectron spectroscopy (XPS, ESCALAB 250, Thermo VG Corporation, MA, USA) with an Al X-ray source and C 1s peak (284.6 eV) as the reference, X-ray diffraction (XRD, Rigaku D/MAX 2500 PC, Japan; Cu target (λ = 0.154 nm), scanning rate = 8° min−1) and Fourier transform infrared spectrophotometer (FTIR, Nicolet 380, Thermo electron, USA; range of 4000–400 cm−1 at room temperature) were employed for the detection of composition, phase and chemical bond of the coating.

2.4 Super-Hydrophobicity, Surface Energy and Roughness Tests

SA and CA were measured to determine the hydrophobicity of the coating. Automatic surface and interface tension meter (Sigma700, Sweden) was utilized at least 3 different positions for each sample. The water droplets for measurement were about 20 μL in diameter. The surface energy (γ) was divided into Lifshitze–van der Waals component (γLW) and Lewis acid–base component (γAB) as follows [38]:

$$\gamma = \gamma^{{{\text{LW}}}} + \gamma^{{{\text{AB}}}} ;\;\gamma^{{{\text{AB}}}} = \gamma^{ + } + \gamma^{ - } ,$$
(1)

where the γAB consists of Lewis acid component (γ+) and Lewis basic component (γ).

Van Oss approach was introduced for calculating the surface energy as below [39].

$$\gamma_{{\text{L}}} (1 + \cos \theta ) = 2\left( {\left( {\gamma_{{\text{S}}}^{{{\text{LW}}}} \gamma_{{\text{L}}}^{{{\text{LW}}}} } \right)^{1/2} + \left( {\gamma_{{\text{S}}}^{ + } \gamma_{{\text{L}}}^{ - } } \right)^{1/2} + \left( {\gamma_{{\text{S}}}^{ - } \gamma_{{\text{L}}}^{ + } } \right)^{1/2} } \right),$$
(2)

where θ, \(\gamma_{{\text{L}}}\) and \(\gamma_{{\text{S}}}\) are the CA, liquid and solid surface energy, respectively.

By measuring the coating CA of three different solutions and introducing the corresponding surface energy parameters, the surface energy of the coating could be acquired. Table 1 lists the surface energy parameters of three liquid phases (diiodomethane, glycol and water).

Table 1 Surface energy parameters (γ) of three liquids phase (mJ m−2) [38]

Three-dimensional surface profiler (Zeta-20 type, USA) was applied for the roughness test of the coating with and without dipping. The CA and roughness tests were performed at least on three positions for the average value with error.

2.5 Scratch Tests

The adhesion of the coating was characterized by a Nano-test system (Micro Materials, Ltd.) using a Rockwell diamond probe (with a tip diameter of 25 μm) and experienced a total scratch length of 2 mm. The load linearly increased up to 10 N with the scan velocity of 2 mm min−1. An in situ optical microscope was employed for locating the initial failure of the coating and obtaining the scratch images.

2.6 Electrochemical Tests

Electrochemical tests of open-circuit potential (OCP), electrochemical impedance spectroscopy (EIS) and potentiodynamic polarization (PDP) were carried out by electrochemical analyzer (Versa STAT 4, Princeton, USA). A three-electrode cell setup was used during electrochemical tests. The reference and counter electrodes were saturated calomel electrode (SCE) and a platinum sheet, respectively. And the prepared samples with an exposed area of 1 cm2 acted as the working electrode in the prepared 3.5% NaCl solution under room temperature. Before the EIS test, OCP was conducted for an electrochemical stability. Then, EIS tests proceeded with the frequency from 10 kHz to 0.01 Hz and a disturbing potential of 10 mV versus SCE. ZSimpWin (version 3.50) software was applied for the appropriate equivalent circuit (EC) model based on the obtained EIS plot result. Finally, polarization curve was performed at a scan rate of 1 mV s−1 and a voltage range from − 2000 to − 1000 mV versus SCE. Acquired PDP data were fitted through the Tafel extrapolation for corrosion current density (icorr) and corrosion potential (Ecorr). The voltage range from the Ecorr to − 60 mV versus Ecorr was selected for PDP fitting. In the selected area, the tangent line of cathode area as well as the horizontal line of corrosion potential was made, and the abscissa of the corresponding intersection point was icorr value.

2.7 Hydrogen Evolution Tests

The actual corrosion resistance of the coating was further evaluated by hydrogen evolution tests through a self-made equipment in 3.5% NaCl solution in beaker at 25 °C. The detail parameters could be seen in previous work [40]. Prior to the HE, superficial area of each sample was measured and recorded. Hydrogen evolution volume (HRV) was written down and calculated as a function of time. The pH value was detected for verifying the changes in H+ and OH concentrations during the HE. The average hydrogen evolution rate (HERa, va, mL cm−2 h−1) was calculated as the following formula [8]:

$$v_{{\text{a}}} = V/(s \cdot t),$$
(3)

where V (mL) is the acquired HRV, t (h) is the immersion time, and s (cm2) is the surface area of every sample exposed to 3.5% NaCl solution. The instantaneous hydrogen evolution rate (HERi, vi, mL cm−2 h−1) as well was adopted to evaluate the change of hydrogen evolution rate in each hour and computed by the following formula:

$$v_{\text{i}} = V_{\text{i}} /s,$$
(4)

where Vi (mL) is the hydrogen evolution volume per hour and s is the surface area (cm2) as above. The bare AZ31 and coated samples after dipping process were expressed by I-AZ31 (immersed AZ31 alloy) and I-coating (immersed coating).

3 Results and Discussion

3.1 Surface and Wettability Analyses

From the SEM observation with different magnifications (Fig. 1a, b), the surfaces of the as-prepared coating were covered by some spherical clusters in micrometer scale which was piled up by some nano-soft flaky structures. The coating was quite compact and uniform, without the defects of traditional inorganic coatings such as cracks or pores [41, 42]. Elements C, O, Ca and Mg were the main components of the coating with the content of 82.84, 15.27, 1.58 and 0.04 at.%, respectively, suggesting the abundant existing calcium myristate (CM). A trace of Mg content in Fig. 1c, g implied that a little Mg was corroded during the preparation process. Moreover, it was the evidence of complete cover on the AZ31 surface by the coating. The integral dense coating structure could also be detected by cross-sectional morphology in Fig. 1d. Cooperating with the dense and thick coating of 45 μm, effective physical barrier function could be achieved, and thus inhibited the penetration of the aggressive medium and protected the substrate from corrosion. Element scanning patterns of cross section are shown in Fig. 1e–h, which were consistent with the results of EDS with abundant C, O, Ca and a trace of Mg.

Fig. 1
figure 1

a SEM image and b its magnified one of the prepared superhydrophobic coating; c EDS results of selected points in a; d cross-sectional morphology, eh corresponding elements mapping images

Wettability results of the AZ31 substrate and prepared coating are shown in Fig. 2. The CA for bare and coated samples was 85.9° ± 1.8° and 155.2° ± 1.5°, respectively, indicating that the coating could increase the hydrophobicity of AZ31 substrate. At the same time, the SA of coating was 6.0° ± 0.5° (Fig. 2c), lower than 10°, proving the superhydrophobic property of the coating. The super-hydrophobicity was attributed to the synergetic influence of globular rough microstructure (Fig. 1a, b) and low surface energy surface, which could be proved later.

Fig. 2
figure 2

Water contact angles of a AZ31 alloy and b coating surface; c sliding angles for coated samples

XPS examination was executed and is illustrated in Fig. 3a–c. Strong peaks of C 1s at 284.8 eV, O 1s at 531.6 eV and Ca 2p at 347.5 eV were discovered, proving the elemental composition of the coating. The atomic percentages of C, O and Ca were 86.3%, 10.96% and 2.74%, respectively, coinciding with the EDS results.

Fig. 3
figure 3

XPS results of a C 1s, b O 1s and c Ca 2p

For C 1s spectrum (Fig. 3a), –CH2, –CH3 and –COO groups were assigned at 284.7 eV, 285.4 eV and 288.4 eV, respectively, validating the existence of CH3(CH2)12COO in the coating [43]. Two main peaks of O 1s spectrum (Fig. 3b) were fitted at 531.5 eV and 532.7 eV, which could be assigned to the –C–O and –C=O bonds [25]. The peaks situated at 347.4 eV and 351.0 eV were Ca 2p3/2 and Ca 2p1/2 in Fig. 3c. Especially, the Ca 2p3/2 peak at 347.4 eV was the evidence of Ca[CH3(CH2)12COO]2.

FTIR spectra (Fig. 4a) and XRD patterns (Fig. 4b) were also conducted to further confirm the coating composition. The asymmetric and symmetric stretching vibrations of C-H were identified at approximately 2851 cm−1 and 2920 cm−1 for the coating with (I-coating) and without immersion [31]. And the C-H bending was also been detected around 1437 cm−1 [24], implied the existence of the long-chain aliphatic groups. The peak at 1582 cm−1 was the carboxylate [43]. Notably, the absence of carboxyl group in myristic acid at 1701 cm−1 indicated that all H+ in carboxyl groups were replaced by Ca2+ and the formation of calcium myristate (CM). The XRD patterns (Fig. 4b) further proved the abundant CM in the coating. Beside CM, the only remained crystal that could be detected was Mg, which was much weaker than bare AZ31 in terms of peak intensity, demonstrating the partial penetration of X-ray. The volume fractions of different phases were calculated though total area of each phase in XRD patterns [44, 45] and listed in Table 2. Although the coating was dense, weakened Mg peak with the volume fraction of 71.05% could be detected owing to the penetration of X-ray.

Fig. 4
figure 4

a FTIR spectra and b XRD results of the AZ31 substrate, myristic acid (MA) and coated samples as well as immersed AZ31 (I-AZ31) and coating (I-coating)

Table 2 Volume fractions (vol%) of each phase in XRD patterns

3.2 Electrochemical Tests

Corrosion resistance of bare AZ31 substrates and coated samples were characterized via EIS results shown in Fig. 5a–c and EC models in Fig. 5d, e. The fitting data were linked by curves, while the scattered points were the measured data points. The diameter of the capacitive loop for coated sample was about three orders of magnitude higher than AZ31 substrate (Fig. 5a), which confirmed the good protective effect of the coating. Generally, the higher |Z| values, the better corrosion resistance in Bode plot [46]. The |Z| value of the coating in Fig. 5b was more than 2 orders of magnitude higher than that of bare one, demonstrating that the coating possessed good capability for restraining corrosion.

Fig. 5
figure 5

Electrochemical results of a Nyquist, b Bode plots of Zmod, c Bode plots of phase angle and corresponding EC models of the d AZ31 substrate, e coated sample; f potentiodynamic polarization curves of the AZ31 substrate and coating in 3.5% NaCl

ECs of Nyquist plots (Fig. 5d, e) were conducted via ZSimpWin 3.5 to analyze the corrosion kinetic of the coating deeply. The solution resistance, coating resistance and charge transfer resistance were marked as Rs, Rf and Rct, respectively. The deviation effect of electric double-layer capacitor was expressed as constant phase element (CPE) signified by Q, which was used to replace pure capacitive and calculated through formula [8]:

$$Y_{{{\text{CPE}}}} \left( \omega \right) = 1/Z_{{{\text{CPE}}}} = Y_{0} \left( {j\omega } \right)^{n} ,$$
(5)

where n and Y0 are expressed as admittance and power index number. The Q could be pure resistance or pure capacitance, when n value was 0 or 1, respectively. Meanwhile, RL and L described the inductance parameters. The EC of AZ31 was characterized by a capacitive loop and an inductive loop at high and low frequency, respectively. The existence of inductance was ascribed to pitting of AZ31 sample during the electrochemical process in 3.5% NaCl solution. Coated sample with relatively dense structure could not block the penetration of water vapor and oxygen molecules completely with diameters of 0.4 nm and 0.3 nm [24], resulting in slight pitting corrosion of the substrate under the coating and the appearance of small inductive region at the low frequency.

Actually, the coated sample possessed two time constants, which seemed to conflict with the result of Bode phase angle and Nyquist diagram with only one capacitive arc. The reason could be explained as follows. The constant considered as physical impedance of coating (Rf) resembled the constant caused by the Faraday process (Rct), which coincided each other and could hardly be distinguished [24], being certificated by the similar Rct and Rf values listed in Table 3. The Rct value of coated sample was 1.49 × 105 Ω cm2, much higher than bare AZ31 of 1.75 × 102 Ω cm2, indicating that the coating possessed strong ability to protect the underlying substrate against corrosion.

Table 3 Equivalent circuit fitting results of the EIS date

PDP tests are conducted and shown in Fig. 5f. The Ecorr of AZ31 and coating were − 1.50 and − 1.47 V/SCE, respectively, indicating a slightly rise for the coated sample. The icorr of the coated sample was 5.60 × 10−9 A cm−2, about four orders of magnitude lower than AZ31 substrate (4.01 × 10−5 A cm−2), implying the markedly enhanced corrosion resistance.

3.3 Hydrogen Evolution Analyses

The actual corrosion resistance performance of the coating was tested by HE for 12 days as shown in Fig. 6. The pH value of AZ31 substrate increased sharply in the initial 12 h, and reached to maximum value of 10.05 after 24 h immersion, then decreased slowly and reached a relatively stable value of 9.40, finally. Different from the AZ31 substrate, the coating basically maintained a continuous upward trend and reached to 9.16, eventually. The overall pH value of the coated sample was lower than that of the bare one, revealing the inhibiting corrosion function of the coating. Thanks to the effective physical barrier function of the coating, penetration of solution and corrosive medium was prevented, resulting in sluggish corrosion of the substrate beneath the coating and slow growth of pH value. From the beginning to the end, the total HEV of the substrate was higher than coated one, with the finally value of 132.74 mL and 16.99 mL (Fig. 6b), respectively. The HERa of the AZ31 in Fig. 6c reached to the highest value of 0.2674 mL cm−2 h−1 after 2 h dipping, and then decreased continuously. However, the coated sample had a minuscule increase in the first 2 days, and then retained stable till the end. The HERa of AZ31 was 0.046 mL cm−2 h−1 about 8 times higher than that of the coated one (5.30 μL cm−2 h−1). The overall trend of HERi shown in Fig. 6d was similar to HERa, except for the final value. The HERi of the coating increased during the whole process equaled the HERi of the substrate ultimately, which was attributed to the reduced degradation rate of the AZ31 alloy caused by the accumulation of corrosion product and alkalization of the environment, as well as the increase of the coated substrate originated from solution penetration. A few jumping points appeared due to the accumulation of hydrogen on the inner wall of the funnel or the sudden overflow of large bubbles. All the hydrogen evolution outcomes, including pH, HEV and HER, demonstrated the excellent corrosion resistance of the coating.

Fig. 6
figure 6

Hydrogen evolution results of a pH value, b hydrogen evolution volume (HEV), c average hydrogen evolution rate (HERa), d instantaneous hydrogen evolution rate (HERi) in 3.5% NaCl solution

4 Discussion

4.1 Comparison Among Corrosion Resistant Coatings on the Mg Alloys

Superhydrophobic coatings fabricated by two-step methods with complex operational processes could meet the need of corrosion resistance in a short time. However, the upper low surface energy layers could only reduce icorr of the underlying rough layers for 1–2 orders of magnitude as listed in Table 4, which were worse than the coating we prepared by reducing icorr of the substrate for 4 orders of magnitude directly. Kuang et al. [37] successfully prepared superhydrophobic coating by modifying the myristic acid on Mg-Mn layered double hydroxide (LDH) though immersion method. The prepared coating showed good super-hydrophobicity with CA and SA of 162.1° and 3°, respectively. But the fatal drawback of this coating was that after a very short time of immersion (24 h), the CA dropped to 72.9°, suggesting that this coating was extremely unstable and insufficient to provide a long-term protection for the underlying substrate. Zhang et al. [38] fabricated Mg(OH)2/polypropylene composite superhydrophobic coating with the critical loads of 1323 mN, which was pretty smaller compared with 5004 mN of the coating in this work. Unsatisfactory corrosion resistance and stability of this coating were due to the falling off of the outer low surface energy layer during immersion, which was induced by the poor adhesion between the outer and inner layer as well as the bubble overflow during the soaking process (Table 5).

Table 4 Corrosion resistance of superhydrophobic coatings (icorr, A cm−2) prepared by two-step method (the best results among different parameters)

In addition, the superhydrophobic coating prepared by one-step electrodeposition method also confronted with many defects. Zheng et al. [30] fabricated corrosion-resistant superhydrophobic coating on AZ31 by the same one-step method using magnesium nitrate and stearic acid under different solution concentrations. The minimum icorr of the coating was 5.80 × 10−8 A cm−2 about one order of magnitude higher than that of we prepared. It was worth noting that the CA of the coated samples after dipped in 3.5 wt% NaCl for 7 days was lower than 150°, indicating inferior durability of the coating. Tang et al. [43] also prepared CM coating on AZ31 using electrodeposition. However, the CA and thickness of the coating were up to 114° and 30 μm, respectively. It was clear that this CM coating could not achieve good superhydrophobic effect. The main reason was that the concentration of myristic acid and calcium nitrate in the solution used for electrodeposition was relatively low, resulting in the smaller size of microspheres and more gaps in the stack. In addition, there are some cracks on the surface of the prepared microspheres, which also affected the corrosion resistance.

4.2 Mechanism of Coating Formation

Figure 7 shows the formation mechanism of the coating. First, myristic acid (CH3(CH2)12COOH) decomposes into CH3(CH2)12COO and H+ in ethanol solution (Eq. 6). And AZ31 alloys dissolve into Mg2+ and release e, as soon as the solution contacts with substrate (Eq. 7). The process of coating formation is mainly determined by the following two steps. Positive charge Ca2+ combines and drags CH3(CH2)12COO to move toward negative electrode (Mg) driven by the current (Eq. 8). Consequently, the Ca[CH3(CH2)12COO]2, which is the primary component of the coating, accumulates steadily on the AZ31 Mg surface. Simultaneously, the electrons in the solution will move to the cathode and combine with hydrogen ions to form H2 (Eq. 9). Similar reaction processes were found by Liu et al. [25]. With the accumulation of the coating, the conductivity of the substrate becomes smaller and smaller, resulting in a constant decreased current.

$${\text{CH}}_{3} ({\text{CH}}_{2} )_{12} {\text{COOH}} \to {\text{CH}}_{3} ({\text{CH}}_{2} )_{12} {\text{COO}}^{ - } + {\text{H}}^{ + },$$
(6)
$${\text{Mg}} \to {\text{Mg}}^{2 + } + 2{\text{e}}^{ - },$$
(7)
$$2{\text{CH}}_{3} ({\text{CH}}_{2} )_{12} {\text{COO}}^{ - } + {\text{Ca}}^{2 + } \to {\text{Ca}}[{\text{CH}}_{3} ({\text{CH}}_{{2{ }}} )_{12} {\text{COO}}]_{2} \downarrow ,$$
(8)
$$2{\text{H}}^{ + } + 2{\text{e}}^{ - } \to {\text{H}}_{2} \uparrow .$$
(9)
Fig. 7
figure 7

Schematic illustration of the coating forming process

4.3 Coating Properties

The stability of the as-prepared coating was appraised by nano-scratch and immersion tests. From the nano-scratch test result, the critical load for the coating was 5004 mN (Fig. 8a), designating the outstanding adhesion to the substrate, which was superior to other traditional superhydrophobic coatings [29, 38]. This organic surface coating that overcame the shortcoming of poor adhesion might expand the application of the coating.

Fig. 8
figure 8

a Nanoscratch test of the coating; b water static contact angles, cf mean values of surface roughness of superhydrophobic coating under different immersion time of 0 days, 1 days, 7 days and 13 days in 3.5% NaCl solution

In order to study the durability, coated samples were immersed in 3.5% NaCl aqueous solution for 13 days, and the CA and roughness results were recorded continuously. The CA (Fig. 8b) of the coated samples undergone 0 days, 1 days, 7 days and 13 days immersion was 156.7° ± 1.4°, 156.6° ± 2.8°, 155.3° ± 1.6° and 155.6° ± 0.9°, respectively. Due to a little dissolution of the coating, the CA values reduced slightly, but could preserve superhydrophobic properties, which certificated superior stability and durability of this coating. The surface roughness of coating after soaking for 0 days, 1 days, 7 days and 13 days was 2.31 ± 0.14 μm, 2.83 ± 0.35 μm, 3.01 ± 0.01 μm and 4.23 ± 0.19 μm, respectively, which increased with the prolonging of immersion time (Fig. 8c–f) as the damage of the original regular spherical structure and irregular distribution of the nano-soft flaky displayed in Fig. 9a. Under the collective effects of coating dissolution and roughness increase, the superhydrophobic nature of the coating could be well maintained.

Fig. 9
figure 9

a SEM morphology, b EDS composition of the coating after 13 days immersion in 3.5% NaCl solution

SEM morphology after dipping was displayed here to clarify the coating degradation process. Contrast the coating before (Fig. 1a, b) and after soaking (Fig. 9a), conclusion could be made that the globular clusters collapsed owing to the slight dissolution of coating. Fortunately, the nano-soft flaky structures maintained and the integrity of the coating had not been damaged. Considering the result of HERa which had not elevated after 12 days immersion, the coating with complete structure and a large amount of low surface energy substance could protect the substrate from corrosion for a longer time. The element content of the coating after immersion (Fig. 9b) was almost same as the original coating, indicating the completeness of coating. The FTIR result of the coating after immersion for 13 days is displayed in Fig. 4a (I-coating). Comparing with the coated sample, the immersed coating had the same characteristic peaks except for the additive small Mg(OH)2 peak at 3698 cm−1, testifying the formation of corrosion product. Same as the coated one which substituted the carboxyl (–COOH) at 1701 cm−1 by carboxylate (–COO) at 1582 cm−1, the FTIR revealed that this low surface energy substance was CH3(CH2)12COO rather than CH3(CH2)12COOH. XRD patterns and volume fractions of dipped samples were also acquired and are placed in Fig. 4b and Table 2, separately. Some Mg(OH)2 with the volume fraction of 72.28% was discovered on the soaked AZ31 surface, indicating that abundant corrosion product overlapped AZ31 alloy surface and inhibited the penetration of X-ray. Therefore, volume fraction of Mg dropped from 100 to 37.72%. The coverage of corrosion product also restrained the fast degradation of AZ31 alloy, being confirmed by the HERi in Fig. 6d. For the immersed coating, a little corrosion product Mg(OH)2 was detected (0.58%), which coincident with FTIR (Fig. 4a) results of a weak peak at 3698 cm−1. The volume fraction of Ca[CH3(CH2)12COO]2 for immersed coating was 26.05%, a little lower than 28.95% of the coating before soaking, inferring that there was a slight dissolution or the decrease of the coating density during the dipping process, which resulted in more X-ray penetration and increased Mg fraction of 73.37% (71.05% before immersion).

By analyzing the dipped results, conclusions could also be drawn that the immersion process mainly led to the collapse of the coating structure, rather than a large amount of coating dissolution. Less Mg(OH)2 was detected, which could reveal that slight corrosion occurred on the AZ31 substrate underlying the coating and a little corrosion product formed. Furthermore, the collapse of the globular clusters and the redistribution of nano-soft flaky structures overlapped the coating damage area originated from the electrochemical or immersion process, which was beneficial to durable corrosion resistance of the coating.

Moreover, long-term EIS tests were conducted for investigating the corrosion performance of coated samples after being soaked for a specified period of time. The EIS and fitted results are shown in Fig. 10 and Table 5. There were two obvious capacitive reactance loops for the immersed coating. The resistance of the coating (Rf) became smaller compared with the results of the coating without immersion (Fig. 5) due to the penetration of the solution and formation of the solution channel. With the prolongation of soaking time, coating resistance (Rf), charge transfer resistance (Rct) and |Z| decreased constantly, suggesting the continuous reduction of corrosion resistance. Compared with the coated sample in Fig. 5b, the |Z| value after soaking for 7 days reduced by an order of magnitude, which seemed to be in contradiction with the previous CA test results (Fig. 8b) of maintaining the hydrophobicity for 13 days. This was caused by the CA results in Fig. 8b that were obtained by measuring the dried samples after immersion, which indicated the still maintained low surface energy substance as well as the hydrophobic property. However, the electrochemistry tests in Fig. 10 were performed directly with the soggy surface. As a small amount of water penetrated into the coating after immersing in the solution, the contact area between the solution and the coating surface increased, resulting in the decrease of coating impedance. In addition, as time went on, more moisture would penetrate into the coating, further weaken the coating resistance. Although the corrosion resistance of the coating reduced a lot, it could still keep effective protection by comparing the electrochemical results of AZ31 substrate in Fig. 5. In addition, the inductive reactance of the coating disappeared after dipping for 5 days, which may be attributed to the inhibition of pitting corrosion by a small amount of corrosion products tested by XRD and FTIR in Fig. 4a, b.

Fig. 10
figure 10

Electrochemical results of a Nyquist, b Bode plots of Zmod, c Bode plots of phase angle of the coating after immersion in 3.5% NaCl solution for a few days

Table 5 Equivalent circuit fitting results of the EIS date after immersion

4.4 Mechanism of Corrosion Resistance

Figure 11 illustrates the corrosion resistance mechanism of the superhydrophobic surface. The super-hydrophobicity of the coating rose from the synergistic effects of rough structure and the low surface energy material (CM) [53]. The surface energy was calculated via Van Oss approach by measuring the CA of three liquid phases. The CA of water, glycol and diiodomethane shown in Fig. 12 was 155.2° ± 1.5°, 130.8° ± 7.9° and 108.4° ± 9.6°, respectively.

Fig. 11
figure 11

Schematic illustration of corrosion resistance of the superhydrophobic coating

Fig. 12
figure 12

Contact angles of the CM coating under different liquid phases: a water, b glycol, c diiodomethane

The \(\gamma_{{\text{S}}}^{{{\text{LW}}}}\), \(\gamma_{{\text{S}}}^{{{\text{AB}}}}\),\({ }\gamma_{{\text{S}}}^{ - }\) and \(\gamma_{{\text{S}}}^{ + }\) were acquired though substituting the data (Fig. 12 and Table 1) into Eq. 2.

$$\gamma_{{\text{S}}}^{{{\text{LW}}}} = 5.94\,{\text{mJ}}\,{\text{m}}^{ - 2} ,\gamma_{{\text{S}}}^{ + } = 0.23\,{\text{mJ}}\,{\text{m}}^{ - 2} ,\gamma_{{\text{S}}}^{ - } = 1.24\,{\text{mJ}}\,{\text{m}}^{ - 2} ,\gamma_{{\text{S}}}^{{{\text{AB}}}} = 1.06\,{\text{mJ}}\,{\text{m}}^{ - 2}$$
(10)

Then substituting these values in Eq. 10 to Eq. 1, the surface energy of superhydrophobic coating (\(\gamma_{{\text{S}}}\)) was obtained (\(\gamma_{{\text{S}}}\) = 7.01 mJ m−2).

Once immersed in 3.5 wt% NaCl solution, air adsorbed on the coating surface can continue to occupy the surface. Air layer between the solution and the coating is thus created and the contact between solution and the coating surface is greatly restricted, which have been reported by Wang et al. [54]. Most superhydrophobic coatings with heterogeneous surfaces conform to Cassie’s model, which can be interpreted as droplets suspend on the rough structure surface and form a solid–liquid–gas three-phase composite contact interface rather than completely fill the groove [34]. That air captures the coating surface is further understood by the Cassie–Baxter equation [55].

$$\cos \theta_{{\text{r}}} = f\cos \theta_{0} - \left( {1 - f} \right),$$
(11)

where θr and θ0 are the contact angle on a rough and flat CA surface, respectively. And the factor f is the fraction of solid/liquid interface. Based on the values of θr (155.2°) in Fig. 2 and θ0 (109°) from previous literature [56], the f is calculated to 0.1365, indicating that 13.65% of water directly contacted with the coating surface.

The water molecules penetrate the air layer and cannot spread on the coating completely due to the large CA caused by super-hydrophobicity of the rough surface. Simultaneously, with the dense structure, the coating can block the penetration of the corrosion medium though the coating. Briefly, the coordination of three parts including air layer, superhydrophobic surface layer and the compact coating layer can effectively restrain penetration of the solution layer by layer, inhibiting the corrosion of the underlying AZ31 substrate. Unfortunately, solution can still pass through the coating and reach the AZ31 surface, causing slight corrosion of magnesium alloy, which is expressed in formula (Eqs. 7 and 9), certificated by Nyquist plots in Fig. 5a and HERi results in Fig. 6d.

5 Conclusion

An integrated superhydrophobic coating was successfully prepared on AZ31 Mg alloy by one-step electro-deposition. Calcium myristate with the characteristic of low surface energy (7.01 mJ m−2) covered the substrate and constructed relatively rough structure, leading to the super-hydrophobicity of the coating. The static water contact angle and sliding angle were 155.2° ± 1.5° and 6.0° ± 0.5°, respectively, indicating a super-hydrophobicity for the coating. Moreover, the coating exhibited a compact morphology and strong adhesive force with its substrate. The icorr and the HERa of the coated sample were 5.60 × 10−9 A cm−2 and 5.30 μL cm−2 h−1, about four and one orders of magnitude lower than those of AZ31 substrate, respectively, implying effective protective performance of the substrate. Simultaneously, stability of the superhydrophobic coating was confirmed by persistent super-hydrophobicity (155.6° ± 0.9°) and remained rough structure composed of low surface energy material after immersion in 3.5% NaCl solution for 13 days. The superhydrophobic coating overwhelmed the disadvantages of traditional superhydrophobic coating, such as weak adhesion, poor durability and complex operation, and demonstrated great potential in engineering applications.