1 Introduction

Metallic structures thermodynamically tend to decrease their energy and corrode in the presence of corroding agents including water and oxygen [1]. Corrosion phenomenon causes notable economic loss and it is a serious threat for industries [2]. In this regard, organic coatings can provide corrosion protection for metallic materials [3]. Among polymer protective coatings, epoxy coatings are extensively used due to their high adhesion onto various substrates, high chemical resistance, and versatility [4, 5]. However, epoxy coatings have some drawbacks such as high brittleness, notch sensitivity, developing micro-pores during solvent evaporation, hydrolytic degradation, and low barrier performance [6, 7].

In recent years, graphene derivatives have been widely employed as nanofiller to boost the corrosion resistance of epoxy coatings. Polymer coatings containing graphene based nanomaterials possess outstanding properties which can be assigned to inherent nature of graphene derivatives regarded as high surface area, low density, high aspect ratio, excellent mechanical strength, and advanced barrier effect against gases and corrosive agents [8,9,10]. Graphene [8, 9, 11, 12], functionalized graphene [13, 14], graphene oxide [15,16,17], graphene oxide nanosheets functionalized with various agents including silane [18], amine [19], and urea–formaldehyde [4], graphene oxide modified with nanoparticles such as silica [20], titania [21], and alumina [22] are regarded as different types of graphene based nanomaterials developed for providing highly corrosion resistant coatings.

Moreover, graphitic carbon nitride (g-C3N4) is a two dimensional nanomaterial with similar layered structure of graphene; indeed, strong C–N covalent bonding presents in the plane direction and the planes are packed together through van der Waals interactions. In recent years, g-C3N4 has attracted a great attention because of relative ease of synthesis, non-toxicity, and high chemical, physical, and thermal stability [23,24,25,26]. Compared to graphene based nanofillers, g-C3N4 possesses unique advantages as simple preparation procedure, low cost, and semiconductor behavior [3, 27]. In addition, the g-C3N4 with sheet-like morphology and high aspect ratio can increase the tortuosity of diffusion path of corrosive agents in polymer matrix and therefore, improve the corrosion protection efficiency of polymer based coatings. Accordingly, Zuo et al. [3] proved that polyaniline modified g-C3N4 is appropriate nanofiller for enhancing the corrosion resistance of epoxy coatings.

It should be mentioned that during our previous studies, we have prepared nanocomposite epoxy coatings containing graphene oxide [15], silane functionalized graphene oxide [7, 18], and silica decorated graphene oxide [20]; revealing that nanofillers with sheet-like morphology are appropriate candidate for developing highly corrosion resistant coatings. Our previous studies showed that the wt% of nanofiller in polymer matrice as well as the functional groups on the surface of nanofillers are key parameters for achieving nanocomposites with high corrosion resistance. In this research, melamine, which has honey-comb atomic arrangement close to g-C3N4, is used as a very cheap and abundant nitrogen containing precursor for synthesizing g-C3N4 [28]. The g-C3N4 is synthesized via melamine pyrolysis. This is a simple and economic approach for synthesizing corrosion resistant nanofiller with high surface-to-volume ratio and sheet-like morphology. However, g-C3N4 nanosheets poorly disperse in polymer matrix [29] due to the presence of strong van der Waals interactions and π–π stacking [30, 31]. Since, the distribution of nano-additives plays an important role in enhancing the properties of polymer composite, the dominant challenge of g-C3N4 application in epoxy coating is to develop methods for improving the dispersion quality of g-C3N4 in polymer matrix.

Here, we have employed the strategy of directly adding the amine functionalized g-C3N4 nanosheets to hardener in order to improve the distribution of g-C3N4 in epoxy coating. The developed strategy has three main reasons: First of all, it has been demonstrated that nanosheets have high tendency to disperse in lower-viscosity medium [15, 32, 33]. Accordingly, due to lower viscosity of hardener compared to epoxy resin, the dispersion of nanosheets in hardener is better than epoxy resin; therefore, the g-C3N4 nanosheets are directly added to hardener. Second, since the hardener used in this research has amine groups, the prepared g-C3N4 is chemically modified with amine in order to enhance the compatibility between nanofiller and the hardener. Third, the vapor of ethylenediamine is used for functionalizing the g-C3N4 nanosheets. This procedure involves reacting carboxylic acid moieties developed on g-C3N4 nanosheets via HNO3 vapor with vapors of ethylenediamine. The advantages of this procedure can be regarded as: g-C3N4 remains in a dry state; there is no need for separation, filtration, washing, and drying steps; the morphology and agglomeration degree of g-C3N4 nanosheets will not deteriorate [34, 35]. Further, the effect of amine functionalized g-C3N4 nanosheets on corrosion protection performance of solvent-based epoxy coating is investigated.

2 Experimental

2.1 Materials

All chemicals were analytical grade reagents without further purification. Melamine (C3H6N6) was purchased from Uroumiyeh Petrochemical Co. Iran. Ammonium carbonate ((NH4)2CO3), nitric acid (HNO3) and ethylenediamine (C2H4(NH2)2) were obtained from Sigma-Aldrich. For preparing epoxy coatings, Bisphenol F type epoxy resin and its polyamide hardener with the weight mixing ratio of 10: 1 (resin to hardener) were purchased from Kian Co. Iran. Mild carbon steel plates (ST-12, Foolad Mobarakeh Co., Iran) are used as metallic substrate. These panels were sandblasted, cleaned with acetone and blow-dried before applying coatings on them.

2.2 Synthesis of g-C3N4

The g-C3N4 is synthesized by three step condensation of melamine. 14 g melamine is added to 280 mL deionized water while stirring for 30 min. Then, it is transferred into 420 mL Teflon-lined autoclave and heat treated at 200 °C for 24 h. The precipitate is filtered and dried at 80 °C to obtain a white powder. The derived white powder is mixed and ground in agate mortar with equal amount of ammonium carbonate. Then, the mixture is added into DI water and stirred at 80 °C until dried completely. The dry mixture is put into alumina crucible with a cover and heated at 600 °C for 4 h in a muffle furnace with heating rate of 5 °C/min. The synthesized yellow powder is denoted as nano g-C3N4.

In the first step, melamine is condensed hydrothermally and ammonia is generated through condensation of melamine. Then, in the second step, as-condensed melamine gradually polymerized with increasing the temperature in the presence of ammonium carbonate; ammonium carbonate ((NH4)2CO3) decomposes into NH3, CO2, and H2O gases which act as dynamic gas template, preventing the aggregation of melamine and producing two-dimensional g-C3N4 [25].

2.3 Synthesis of amine functionalized g-C3N4

In the first step, the g-C3N4 is oxidized with HNO3 vapor. In this procedure, the synthesized g-C3N4 is loaded in the reactor heated at 125 °C. The concentrated HNO3 is loaded in the round bottom flask which is heated and stirred at 125 °C. After 24 h, the oil bath heating is turned off and the heater of reactor is turned off after 1 h in order to dry the functionalized g-C3N4. Then, the oxidized g-C3N4 is collected from the reactor. In the second step, ethylenediamine is used for amine functionalization of oxidized g-C3N4. The oxidized g-C3N4 is placed in the reactor heated at 165 °C. The bottom flask is loaded with ethylenediamine which is heated and stirred at 165 °C. The reaction is maintained for 8 h and then, the oil bath heating is turned off. After 1 h, the heater of reactor is turned off in order to obtain dry amine functionalized g-C3N4. The amine functionalized g-C3N4 is abbreviated as AF g-C3N4. In the proposed procedure, the g-C3N4 is only treated with vapor and it is not in contact with liquid, leading to achieve functionalized g-C3N4 without losing the material. The HNO3 and ethylenediamine vapors can continuously pass through the column; indeed, the vapors can circulate via refluxing in the two neck flask and return into round bottom flask by condensing in the attached condenser.

2.4 Preparation of nanocomposite coatings

To prepare epoxy composite coatings containing 0, 0.05, 0.1, 0.3, 0.5, and 0.7 wt% AF g-C3N4, the required amount of AF g-C3N4 is directly added to hardener and sonicated for 5 min. Then, the mixture is added to stoichiometric amount of epoxy resin and mechanically mixed to obtain a uniform dispersion. In the next step, they are diluted with thinner and spray coated on mild steel panels. Finally, the samples are kept for 24 h at room temperature and then, heated at 90 °C for 2 h to complete curing reactions.

2.5 Characterizations

The crystal structure of g-C3N4 is characterized by X-ray diffraction analysis (XRD, Philips PW 3710, 30 kV, 35 mA, Cu Kα). Carbon–Hydrogen–Nitrogen (CHN) elemental analysis is performed on the synthesized sample by using CHN elemental analyzer (FlashEN 1112, Thermo Finnigan). The morphology of g-C3N4 is observed by transmission electron microscopy (TEM, Philips, EM208S, 100 kV). The sample for TEM analysis is prepared by dispersing a small amount of g-C3N4 powder in ethanol by help of ultrasonic bath and then, dropping one drop of the prepared dispersion on grid and drying at room temperature before TEM test. Further, functionalization of g-C3N4 with HNO3 and ethylenediamine is studied by Fourier transform infrared spectroscopy (FTIR, Vector 33 Bruker spectrometer) over wavelength range of 400–4000 cm−1. The dispersion quality of amine functionalized g-C3N4 in coating matrix is considered by field emission scanning electron microscopy (FE-SEM, MIRA3 TESCAN).

2.6 Corrosion test

The electrochemical performance of samples is examined by electrochemical impedance spectroscopy (EIS) utilizing an Ivium electrochemical analyzer instrument (Compact Stat Ivium Software 2.775, Netherlands). Electrochemical behavior is measured by a three electrode cell consisting of coated substrate, platinum rod and saturated calomel electrode (SCE) as working, counter, and reference electrode, respectively. The NaCl solution with 3.5 wt% concentration is used as corrosive electrolyte. The EIS tests are carried out at OCP in frequency range of 10−2 to 105 Hz with AC amplitude of 10 mV after immersion in corrosive electrolyte for different times. The measurements are repeated 3 times to be ensure about the repeatability of data. The impedance spectra are analyzed by fitting the experimental data with the help of electrical equivalent circuit (EEC).

3 Results and discussion

3.1 Characterization of g-C3N4 nanosheets

The phase structure of g-C3N4 is examined by XRD (Fig. 1). The XRD pattern shows two distinct diffraction peaks at 12.8° and 27.8° which match with (100) and (002) crystal planes of g-C3N4, respectively. The low-intensity peak at 2θ = 12.8° with d-spacing of 0.68 nm is due to in-plane structural repeating motifs of the continuous heptazine network. The main peak observed at 2θ = 27.8° with d-spacing of 0.32 nm is attributed to the characteristic interlayer stacking peak of graphitic-like aromatic structure [26, 36, 37]. The XRD pattern presents that the graphitic carbon nitride is synthesized.

Fig. 1
figure 1

XRD Pattern of g-C3N4

Table 1 shows the results of elemental analysis. Accordingly, the C/N atomic ration for g-C3N4 sample is 0.659 which is lower than the theoretical value (0.75). The detection of H element in this sample can be attributed to formation of amine groups (C–NH2 and C–NH) in g-C3N4 sample during synthesis procedure [38].

Table 1 Elemental analysis of the synthesized g-C3N4

Figure 2 shows the TEM image of g-C3N4 which clearly indicates the layered plate-like morphology of g-C3N4 due to the graphitic structure of the sample. Further, TEM image shows the stacked layer structure.

Fig. 2
figure 2

TEM image of g-C3N4

The molecular structure of g-C3N4 before and after functionalization with HNO3 and ethylenediamine is characterized by FT-IR. Figure 3 shows the FT-IR spectra of samples, proving their C-N skeleton. The broad peaks located at 3250 and 3078 cm−1 are assigned to O–H and N–H bands, related to residual N–H groups and adsorbed H2O molecules [38]. The absorption peaks at 1200–1600 cm−1 are assigned to stretching vibration of CN heterocyclic [39]. The peak at 890 cm−1 is related to deformation mode of N–H components [39]. The peak at 802 cm−1 is due to vibration of s-triazine units, indicating complete skeleton g-structure of g-C3N4 for all three samples [25]. In the case of HNO3 treated sample, extra absorption peaks at 1540, 1280, 1132, and 735 cm−1 have appeared, attributed to N–H/C–N, C–O, C–O, and C–H vibrations, respectively. For AF g-C3N4, after functionalization with amine, the intensity of absorption peak at 3078 cm−1 enhances due to increase of amino groups on the surface of g-C3N4 sample.

Fig. 3
figure 3

FTIR spectra of g-C3N4, HNO3 vapor treated g-C3N4, and amine functionalized g-C3N4

3.2 Morphology of epoxy/AF g-C3N4 nanocomposites

Figure 4 shows the FE-SEM images from cross-section of pure epoxy and nanocomposite epoxy coatings containing different loadings of AF g-C3N4. The cross section image of pure epoxy coating (Fig. 4a) is smooth because it has brittle fracture behavior. Pure epoxy coating has brittle fracture and it contains no nanofiller; therefore, its fracture surface is smooth. Indeed, the cracks developed in the pure epoxy coating propagate freely in the matrix. However, the fracture surfaces of nanocomposite coatings are rough; indicating more ductile fracture mechanism due to presence of nanofillers which can prevent the crack propagation in polymer matrix [40]. In fact, by incorporating nanofillers in polymer matrice, the fracture mechanism changes from brittle to ductile. Further, the inhomogeneities seen in nanocomposite fracture surface are because of nanofillers dispersion in coating matrix which prevents the propagation of cracks. The dispersion quality of nanofillers within epoxy matrix is an important issue to achieve highly corrosion resistant coatings. As Fig. 4b presents, the fracture surface of epoxy coating containing 0.1 AF g-C3N4 is not uniform and some defects can be seen in the coating matrix; it can be attributed to insufficient amount of nanofiller in polymer matrix. According to Fig. 4b and c, when the amount of nanofiller is 0.1 and 0.3 wt%, the nanofillers could not disperse homogeneously inside polymer matrix. In the case of nanocomposite coating loaded with 0.5 wt% nanofiller (Fig. 4d), the nanofiller dispersion is more uniform compared to Fig. 4b, c and e. By increasing the loading of AF g-C3N4 to 0.3 and 0.5 wt%, the fracture surface becomes more uniform and in the case of epoxy/0.5 wt% AF g-C3N4, homogeneous dispersion of AF g-C3N4 in coating matrix with no defects in polymer matrix are observed, indicating good interface adhesion between nanofiller and matrix. As Fig. 4e presents, the agglomeration of nanosheets happens by increasing the wt% of AF g-C3N4 to 0.7% and the interfacial bonding between polymer and nanofiller becomes weak. Higher amounts of nanofiller (i.e. 0.7 wt%) leads to nonuniform dispersion of nanofiller in coating matrix and their agglomeration as well as cracks are clearly observed. Similar observations are previously reported by researches worked on polymer/graphene nanocomposite coatings [22, 40,41,42,43].

Fig. 4
figure 4

FE-SEM images from cross section of a pure epoxy, b epoxy/0.1 wt% AF g-C3N4, c epoxy/0.3 wt% AF g-C3N4, d epoxy/0.5 wt% AF g-C3N4, and e epoxy/0.7 wt% AF g-C3N4

3.3 Corrosion protection performance of epoxy/AF g-C3N4 nanocomposite coatings

The corrosion protection performance of coatings is evaluated by EIS to study the effect of g-C3N4 on barrier behavior of epoxy coating. The Bode plots show the Impedance Modulus as a function of frequency which is very applicable for understanding the overall resistance of coating system against corrosive media. The Bode plots, exhibit high frequency region due to the coating capacitance and low frequency region due to charge transfer processes occurring at solution/coating interface. Since presenting electrochemical impedance spectroscopy results by Nyquist and Bode plots are a common way for exploring the corrosion resistance of coating systems [44,45,46,47], these plots are presented and discussed in this research.

Figures 5, 6 and 7 show the Bode and Nyquist diagrams of mild steel substrate coated with pure epoxy and epoxy/AF g-C3N4 coatings after immersion in 3.5 wt% NaCl solution for 2 h, 24 h, and 48 h, respectively. According to Bode plots, nanocomposite coatings show higher impedance modulus (|Z|) at low frequencies (10−2 HZ), indicating higher corrosion inhibition of composite samples compared to pure epoxy. The |Z| value depends on the amount of AF g-C3N4 loading in polymer matrice. The |Z| value increases by increasing the wt% of AF g-C3N4 in composite coating, revealing the enhanced barrier performance of AF g-C3N4 nanosheets. Epoxy/0.5 wt% AF g-C3N4 nanocomposite coatings show the highest |Z| value and by adding extra amounts of AF g-C3N4 nanosheets, the |Z| value decreases. Moreover, the |Z| value decreases by increasing immersion time, due to diffusion of corrosive agents through coating and occurrence of degradation process.

Fig. 5
figure 5

a Bode and b Nyquist plots of epoxy coatings containing different wt% of AF g-C3N4 after 2 h immersion in 3.5 wt% NaCl solution

Fig. 6
figure 6

a Bode and b Nyquist plots of epoxy coatings containing different wt% of AF g-C3N4 after 24 h immersion in 3.5 wt% NaCl solution

Fig. 7
figure 7

a Bode and b Nyquist plots of epoxy coatings containing different wt% of AF g-C3N4 after 48 h immersion in 3.5 wt% NaCl Solution

It should be mentioned that g-C3N4 materials are organic semi-conductors [47]. Further, we have functionalized the g-C3N4 materials with amine groups to enhance the compatibility between g-C3N4 materials and polymer matrice. Therefore, the g-C3N4 nanosheets act as insulating nanomaterial inside epoxy coating. The EIS results are fitted by the electrical equivalent circuits shown in Fig. 8; where Rs is the resistance of solution, Rcoat is coating resistance, Qcoat is coating constant phase element, Rct is charge transfer resistance, and Qdl is the double layer constant phase element. Since the actual electrochemical processes are not a pure capacitor, constant phase elements are used instead of capacitors for modeling equivalent electrical circuits to obtain precise fitting results [48]. It should be mentioned that the EIS results are fitted by the help of Ivium software and the fitting quality of EIS data is evaluated by the Chi square (χ2) test; in this regard, the value of χ2 should decrease by tenfold if a new circuit element is introduced into the circuit model; indeed, if incorporation of a new circuit element does not substantially improve the goodness-of-fit via reducing the χ2 value and relative errors, the simpler circuit is accepted and/or the search for an improved circuit is done [15].

Fig. 8
figure 8

Equivalent electrical circuits used for fitting EIS results after immersion for a 2 h and b 24 h and 48 h

Table 2 presents the fitted electrochemical parameters derived from EIS tests. Rcoat and Rct are two main parameters for evaluating the corrosion protection performance of coatings on metallic substrates. Rcoat indicates the resistance of coating against diffusion of corrosive agents and Rct presents the resistance of electron transfer across the metal [4]. Also, impedance modulus (|Z|) at low frequencies 10−2 Hz is presented in Table 2, which indicates the total resistance of coating system against corrosive media. The nanocomposite coatings exhibit higher values of Rcoat and Rct. The enhancement of Rcoat and Rct via addition of AF g-C3N4 reflects the better protective properties of coating systems. Further, the decrease of Rcoat and Rct with the immersion time indicates the degradation of coating as a result of water permeation in the coating. The results of EIS are compatible with FE-SEM images (Fig. 4), indicating that well-distributed g-C3N4 nanosheets in polymer matrix can provide higher corrosion resistance coatings. The increase of Rct can be discussed from two aspects; the g-C3N4 nanosheets can provide more tortuous path ways for corrosive agents and further, these nanofiller decrease the coating porosity; therefore, the amount of corrosive agents at coating/metal interface decreases and Rct increases. Further, the amine functionalized g-C3N4 nanosheets can increase the coating adhesion to metallic substrate and decrease the failure at coating/metal interface which is another parameter for enhancing the Rct value. Indeed, nanocomposite coatings containing 0.5 wt% AF g-C3N4 nanosheets show the highest value of Rcoat and Rct which is because of well-distribution of nanosheets inside polymer matrice. However, by adding higher amounts of nanofiller (i.e. 0.7 wt%), the Rct and Rcoat values decrease which is attributed to agglomeration of nanosheets, developing pores within coatings and increasing the diffusion of corrosive agents within polymer matrice and failure at coating/metal interface.

Table 2 The electrochemical parameters extracted from EIS data

The values of |Z| modulus, Rcoat, and Rct for nanocomposite coatings are significantly higher than pure epoxy coating at different immersion times. However, due to diffusion of corrosive agents through coating by increasing immersion time, the values of |Z| modulus, Rcoat, and Rct values decrease. It should be mentioned that the base epoxy coating used in this study shows limited corrosion protection; i.e. the resistance is in the range of 103 O cm2. As a result, the improved resistance of prepared nanocomposite coatings is in the range of 104 O cm2. Therefore, the corrosion protection performance of samples is investigated in the first hours of immersion. Similar behavior was observed in below studies [41, 49,50,51]. Moreover, the |Z| modulus, Rcoat, and Rct for pure epoxy coating is very low (i.e. < 103 O cm2) and therefore, by increasing the immersion time, these parameters have not changed significantly. However, comparing the impedance parameters at every immersion time shows that the values of |Z| modulus, Rcoat, and Rct for nanocomposites are more than pure epoxy coating [52].

The value of coating capacitance (Ccoat) is calculated based on Eq. 1 from constant phase element of protective coatings [53, 54]:

$${\text{C}}_{\text{coat}} = \, \left( {{\text{Y}}_{0} } \right)^{{1/{\text{n}}}} \cdot \left( {{\text{R}}_{\text{coat}} } \right)^{{\left( {1 - {\text{n}}} \right)/{\text{n}}}}$$
(1)

The variation of Ccoat for samples during immersion is shown in Fig. 9 which indicates that the Ccoat decreases via incorporating AF g-C3N4 in epoxy matrix. The lowest Ccoat is observed for epoxy/0.5 AF g-C3N4 sample. Indeed, the presence of AF g-C3N4 nanosheets in coating can decrease the water uptake into the coating via decreasing the micro-pores and defects of polymer matrix. The fluctuation of Ccoat during immersion can be considered from two different aspects; one trend is increasing of Ccoat by increasing immersion time and water permeation in coating which is attributed to the higher dielectric constant of water compared to polymer matrix. The other trend is decreasing of Ccoat during immersion which is due to filling the micro-pores of coating with corrosion products [46]. Accordingly, the compatibility between AF g-C3N4 nanosheets and epoxy matrix has lead to higher degrees of cross-linking in the coating. Also, the micro-pores of coating have decreased by adding AF g-C3N4 in the coating, providing higher levels of compactness and improved barrier performance. However, the Ccoat increases when extra amounts of nanofiller (0.7 wt%) is added in the coating and the protection efficiency of coating decreases, which can be assigned to agglomeration and packing re-union of AF g-C3N4 nanosheets in the polymer coating and producing defects in the matrix according to FE-SEM images presented in Fig. 4. The corrosive electrolyte can diffuse through these defects and deteriorate the protection efficiency of coating [55].

Fig. 9
figure 9

The variation of Ccoat for epoxy/AF g-C3N4 samples during immersion in NaCl solution

The behavior of coating is discussed based on the calculated results for Ccoat according to Eq. 1 accompanied by FE-SEM images presented in Fig. 4. The results clearly show that the value of Ccoat decreases by adding g-C3N4 nanosheets within epoxy coatings, indicating decreasing the water absorption by nanocomposite coatings. The decrease of Ccoat in the case of nanocomposite coatings can be attributed to decrease of coating porosity and increase of interfacial interactions between polymer and nanofiller. Meanwhile epoxy coatings loaded with 0.5 wt% g-C3N4 nanosheets show the lowest values of Ccoat during immersion, which can be assigned to uniform dispersion of g-C3N4 within polymer matrice and decreasing the defects of coating [53,54,55].

3.4 Corrosion protection mechanism of epoxy/AF g-C3N4 nanocomposite coatings

As EIS results show, pure epoxy coatings show significantly low corrosion protection due to formation of defects and pores in the polymer coating during its application and curing process on mild steel substrate. Corrosive electrolyte easily diffuses in pure epoxy coating through the pores and cavities. The permeation of corrosive electrolyte can lead to hydrolytically destruction of epoxy coating and the hydrogen bonds between epoxy coating and the metal surface deteriorates [5, 9]. Therefore, the corrosive agents including H2O and O2 accumulate at coating/metal interface and the following corrosion reactions occur [8]:

$${\text{Anodic reaction}}:{\text{ Fe}} \to {\text{Fe}}^{2 + } + \, 2{\text{e}}^{ - }$$
(2)
$${\text{Cathodic reaction}}:{\text{ H}}_{2} {\text{O }} + \, \raise.5ex\hbox{$\scriptstyle 1$}\kern-.1em/ \kern-.15em\lower.25ex\hbox{$\scriptstyle 2$} {\text{ O}}_{2} + \, 2{\text{e}}^{ - } \to 2{\text{OH}}^{ - }$$
(3)

Therefore, in this research, g-C3N4 sheets are incorporated in epoxy coating in order to reduce the diffusion of corrosive agents into metal/coating interface. The g-C3N4 sheets are chemically modified with the vapors of ethylenediamine via a simple method. In the developed method, the AF g-C3N4 sheets can easily be dispersed in polyamide hardener without using long-lasting ultrasonic methods. The amine groups (NH2) improve the compatibility and interfacial bonding between g-C3N4 sheets and the polyamide hardener and enhance the dispersion quality of g-C3N4 sheets in epoxy coating. The well-dispersed AF g-C3N4 sheets in polymer matrix can increase the tortuosity of diffusion path for corrosive agents such as H2O and O2 [3]. From the other point of view, the cross-link density of epoxy coating enhances by adding AF g-C3N4 due to the presence of amine groups on g-C3N4 sheets and also, strong chemical bond creates between composite coating and metal surface. Therefore, the deterioration rate of composite coatings decreases. Figure 10 schematically shows the corrosion protection mechanism of epoxy/AF g-C3N4 nanocomposite coatings.

Fig. 10
figure 10

Schematic of corrosion protection mechanism for pure epoxy and epoxy/AF g-C3N4 nanocomposite coatings

Meanwhile, the amount of AF g-C3N4 in epoxy coating is an important parameter for achieving higher corrosion resistance. The corrosion resistance of epoxy coatings enhances by increasing the amount of AF g-C3N4 in polymer matrix. As AF g-C3N4 is added above the optimum value (which is 0.5 wt% in this study), the AF g-C3N4 nanosheets agglomerate in coating and the number of defects and cracks grows which facilitates the diffusion of corrosive medium [30].

4 Conclusion

We have successfully synthesized g-C3N4 from melamine via a simple two-step condensation process including hydrothermal treatment of melamine and then its polymerization in the presence of ammonium carbonate. The prepared g-C3N4 is further characterized with XRD and TEM. The corrosion inhibition performance of g-C3N4 as nanofiller in solvent based epoxy coatings is investigated. In order to enhance the dispersion quality of g-C3N4 in polymer matrix, it is functionalized with amine vapor which is a facile method without separation and drying steps. The functionalization of g-C3N4 is confirmed by FT-IR analysis. The corrosion resistance of epoxy coatings loaded with 0, 0.05, 0.1, 0.3, 0.5, and 0.7 wt% amine functionalized g-C3N4 is evaluated by EIS. In the initial of EIS studies, epoxy coating containing 0.5 wt% AF g-C3N4 shows the highest impedance modulus of 10,650 Ω.cm2 compared to pure epoxy sample (913 Ω cm2). By increasing the immersion time to 48 h, the impedance modulus of epoxy/0.5 AF g-C3N4 and pure epoxy coating decreases to 5060 and 744 Ω cm2, respectively; due to diffusion of aggressive agents into coating/metal interface. Accordingly, it turned out that AF g-C3N4 can significantly improve the barrier performance of epoxy coatings.