1 Introduction

Mild steel renowned as low carbon steel is a majorly used material in construction, chemical and industrial sectors. This is attributed to its promising properties such as high strength, more ductility, machinability and weldability as compared to other metals, in addition to its relative affordability [1]. However, MS can undergo electrochemical oxidation resulting in destruction of the metal as an effect of its interaction with the environment. This corrosion-induced material loss can cause unwanted defects and lead to adverse effects on the alloy properties, which in succession can diminish the effectiveness of the equipment. Society is facing many problems like collapse of buildings and bridges, cracks or breakages in the underground pipes that affect transport of chemicals and oils as a consequence of MS corrosion. Bhopal gas tragedy, Aloha incident and Gaylord chemicals explosion can be considered as examples for the severe problems attributed to corrosion. Moreover, corrosion is an unavoidable menace faced by many industrial sectors especially during acid cleaning in pickling process, oil well acidification and de-scaling processes wherein strong acids such as HCl, HNO3, H2SO4 and H3PO4 are used for surface cleaning. Though microbial influenced biocorrosion of MS (around 20%) is also observed [2], the destruction in acid environment is more crucial to be addressed as huge amount of material loss occurs due to acid wash every year worldwide. Hydrochloric acid (HCl) is the widely used acid in washing the metal surface owing to its trouble free and low-cost nature compared to various mineral acids [3]. But extreme care has to be taken in handling it even in small concentration as it is corrosive to many metals including MS [4]. HCl is commonly utilized in product manufacturing, acid pickling processes, etc., and forms a conducive environment for the corrosion of MS. Thus corrosion control of MS in HCl environment is of technical, academic, economic and aesthetic importance.

Though techniques such as selection of appropriate material and suitable design, surface treatment, anodic and cathodic protection, applied and reactive coatings, plating are employed to defend metals and their alloys from corrosion, the usage of corrosion inhibitors is the best among all. Organic small molecules which include more number of polar groups, heteroatoms, aromatic rings with π electrons and unsaturated bonds in their molecular structure are widely utilized as inhibitors in industrial sectors for various metals, especially MS because of their effectiveness in wide temperature ranges, material compatibility, good solubility, low costs and relatively low toxicity [5,6,7,8,9]. These inhibitors can easily adsorb onto the material physically or chemically through electronic interactions to form protective film, which displace water and protect it from deterioration [10,11,12,13,14,15]. To tackle tremendous material and economic losses due to MS corrosion, there is a need for developing inhibitors which have high anticorrosion efficiency.

There are only very few reports on the potential of carbazoles as inhibitors of corrosion that occurs in biological or chemical environments. Carbazoles are a distinctive category of nitrogen containing aromatic heterocyclic organic compounds that are present in nature [16]. Coal tar and certain alkaloids obtained from higher plants that belong to Glycosmis, Murraya and Clausena genus are few identified natural sources of carbazole derivatives [17]. Wang and co-workers [18] reported the corrosion inhibitive abilities of N-vinylcarbazole and carbazole against copper in 0.5 M Sodium chloride solution by electrochemical measurements, whereas Gopi et al. [19] studied the usage of poly(N-vinylcarbazole-co-glycidyl methacrylate) as a stainless steel (with low nickel content) coating material. Besides, Abdallah et al. [20] investigated the inhibition effects of tetrahydrocarbazole derivatives on zinc corrosion in HCl. In spite of several reports on synthesis of carbazole derivatives, very few investigations are available on their metal protection behavior, especially for MS [21, 22]. Nwankwo et al. reported 74% inhibition of MS corrosion in 1 M HCl solution with 500 ppm of carbazole entities [23]. With this encouraging background, we report the synthesis of a new azine wherein two molecules of 9-ethyl-3-carbazolecarbaldehyde molecules are linked through spacers carrying two nitrogen atoms and the exploration of its corrosion inhibition properties on MS in HCl environment. Azines or N–N diimines are a functional class of organic compounds prepared by the condensation of ketones or aldehydes with hydrazine. Azine bond (–CH=N–N=CH–) with strong reduction ability plays a significant part in corrosion inhibition in heating systems and metal surface treatment [24]. Thus in the present study, we postulate that the incorporation of two aromatic carbazole rings with already proven anticorrosion behavior, in combination with two nitrogen atoms and –C=N– linkages incorporated into a single chemical skeleton can reinforce the inhibition efficiency of the proposed carbazolecarbaldehyde azine against MS exposed to HCl environment.

2 Materials and Methods

9-Ethyl-3-carbazolecarboxaldehyde was obtained from Sigma-Aldrich and used without any subsequent purification for the synthesis of azine. All other chemicals and solvents used for the study were procured from Sigma and Finar Chemicals Pvt. Ltd.

2.1 Synthesis of 9-Ethyl-3-carbazolecarbaldehyde azine (CCA)

About 0.001 mol of 9-ethyl-3-carbazolecarboxaldehyde was refluxed with ethanolic solution of 0.0005 mol of hydrazine hydrate for 3 h. The obtained yellow precipitate was washed with ethanol after filtration and dried. Scheme 1 represents the synthetic pathway of CCA.

Scheme 1
scheme 1

Synthesis of 9-ethyl-3-carbazolecarbaldehyde azine

The synthetic reaction was monitored using thin layer chromatography on pre-coated aluminum sheets. The melting point of CCA was determined by open capillary method and is uncorrected. The chemical structure of CCA was confirmed by recording IR spectra using Shimadzu IR spirit spectrophotometer by ATR technique, 1H and 13C NMR using 400 MHz Bruker spectrometer with CDCl3/DMSO-d6 and TMS as solvents and internal standard, respectively. Mass spectra were obtained using Shimadzu LCMS-8030 with 0.1% formic acid and acetonitrile as mobile phase.

2.2 Material: Mild Steel

The metal coupon with percentage weight composition of Phosphorous (0.06), Silicon (0.15), Carbon (0.15), Manganese (0.49) and remaining Iron (Fe) was used for the corrosion study. The specimen was cut to form a cylindrical rod with 5 cm height, and entrenched in epoxy resin with one terminal having an open surface area of 0.95 cm2. Further, the specimen was abraded with emery papers of varying grades and polished on a disc polisher with levigated alumina. The well-polished end of metal coupon was further washed with double distilled water and acetone, and immersed into the conducting medium after drying.

2.3 Medium

A known volume of 37% AR grade HCl was diluted to prepare 0.5 M HCl, subsequently standardized using volumetric methods and was used as the medium for corrosion experiments. The inhibitor solutions (in 0.5 M HCl) having five different CCA concentrations were prepared from the stock solutions and were used for the study. All sets of trials were completed with and without CCA at three different temperatures: 303, 313 and 323 K.

2.4 Electrochemical Measurements

Two widely used electrochemical techniques such as EIS and PDP were performed using Potentiostat (CH Instrument USA Model 604D series with beta software) equipped with three electrodes. In all sets of experiments MS coupon, platinum foil and saturated calomel embedded in Pyrex glass were used as working, counter and reference electrodes correspondingly. The steady state open circuit potential (OCP) was accomplished by maintaining the electrochemical system in an unperturbed state for 30 min. Readings were taken by immersing MS coupon in 0.5 M HCl solution with and without CCA at the three above-mentioned temperatures. EIS studies were performed by disturbing OCP with the amplitude of 10 mV a.c. signal at the frequency range from 100 kHz to 10 MHz. Nyquist plots were obtained to evaluate the impedance data. The PDP data were collected by sweeping the potential between − 250 to + 250 mV with respect to OCP at a scan rate of 1 mV/s.

2.5 Ultraviolet–Visible (UV/Vis) Spectral Studies

UV/Visible spectra of 5 × 10–5 M CCA in 0.5 M HCl alone was recorded initially using 1800 shimadzu UV–Visible spectrophotometer. Later the absorption spectra of the test solution containing the same concentration of CCA in 0.5 M HCl obtained after immersing CS coupons for 3 h were recorded.

2.6 Fourier-Transform Infrared (IR) Spectral Analyses

IR spectra of CCA alone and the scraped out sample of the adsorbed protective layer formed on the surface of MS specimen exposed to 5 × 10–5 M CCA in 0.5 M HCl solution were recorded using Shimadzu IR spirit spectrophotometer.

2.7 Surface Morphology

Metal coupons of MS with pre-treated fresh surface were immersed in 0.05 M HCl solution in the absence and presence of 5 × 10–5 M CCA to probe surface morphological features using analytical scanning electron microscopic (SEM) and atomic force microscopic (AFM) techniques. The elemental analysis using EDX and SEM images were taken using JEOL JSM-6380L. The surface roughness measurements were analyzed using AFM with 1B342 Innova model.

2.8 Quantum Chemical Computational Studies

Density functional theory (DFT) simulations were performed using Schrodinger material science suite with 6-31G++ basic set and B3LYP function. 2D and 3D molecule builders were used to get optimized structure with definite HOMO and LUMO levels. Different parameters such as electrophilicity, nucleophilicity, ionization potential, global hardness and softness, electron transfer fraction and the electronegativity were calculated by means of various formulae.

3 Results and Discussion

3.1 Chemical Characterization of CCA

The spectral characterization data were in conformity with the structure of CCA.

Carbazolecarbaldehyde azine (CCA)-Yellow amorphous powder (41.87%); M.P: 214–216 °C; 1H NMR (DMSO-d6, 400 MHz): δ 1.346–1.382 (t, CH3, 6H, 7.2 Hz), 4.490–4.543 (q, CH2, 4H, 7.2 Hz), 7.271–7.308 (t, 2H, 7.6 Hz), 7.511–7.549 (t, 2H, 7.6 Hz), 7.679–7.699 (d, 2H, 8 Hz), 7.745–7.766 (d, 2H, 8.4 Hz), 8.057–8.081 (t, 2H, 8.4 Hz), 8.250–8.269 (d, 2H, 7.6 Hz), 8.673 (s, 2H), 8.925 (s, 2H) (Fig. S1); 13C NMR (CDCl3, 100 MHz): 13.87, 37.79, 108.75, 108.83, 119.63, 120.81, 121.42, 123.04, 123.35, 125.41, 126.21, 126.33, 140.48, 141.76, 162.26 (Fig. S2); FTIR [cm−1]: 3043 (Ar. C–H str.), 2977 (methyl C–H asym. str.), 2923 (methyl C-H sym. str.) 1614 (CH=N–N=CH str.), 1232 (C–N str.) (Fig. S3); MS C30H26N4: 443.2 (M + 1) (Fig. S4).

3.2 Electrochemical Studies

3.2.1 Open Circuit Potential

OCP for MS for different concentrations of CCA in 0.5 M HCl were recorded for the time period of 30 min at 303 K and the plot is presented in Fig. S5. The study revealed that the system attained stable OCP in 600 s. Hence, 30 min waiting period was adopted before electrochemical measurements for OCP stabilization [25].

3.2.2 Potentiodynamic Polarization Studies

PDP studies were performed to comprehend the mechanism of MS dissolution at the anode and hydrogen evolution process at the cathode in the absence as well as presence of varied CCA concentrations. Tafel plots relating current and potential for MS corrosion in 0.5 M HCl with and without CCA at 313 K are presented in Fig. 1. The corresponding values for corrosion current density (icorr), corrosion potential (Ecorr), anodic (βa) and cathodic (− βc) slopes assimilated from the graph are recorded in Table 1.

Fig. 1
figure 1

Tafel polarization curves for MS specimen in 0.5 M HCl at 313 K with different CCA concentrations

Table 1 Potentiodynamic polarization parameters for MS corrosion in 0.5 M HCl in the absence and presence of various concentrations of CCA

The relevant electrochemical properties such as percentage inhibition efficiency (% IE) and surface coverage (θ) are measured by means of following equations [26].

$${\text{IE}}(\% ) = \frac{{i_{{{\text{corr}}}} - i_{{\text{corr(inh)}}} }}{{i_{{{\text{corr}}}} }} \times 100$$
(1)
$$\theta \, = \frac{{{\text{IE}}\left( \% \right)}}{100}$$
(2)

where icorr and icorr(inh) represent the corrosion current densities in the absence and presence of CCA, respectively, whereas θ represents surface coverage of CCA on MS specimen.

From Table 1, it is concluded that icorr and CR declined with rise in CCA concentration, which in turn increased the IE (%). This rise in IE (%) was due to the adsorption of CCA to form a film, blocking the MS surface [27]. Moreover as mentioned in the literature [28], if the Ecorr of inhibitor solution is displaced by a value lower than 85 mV in comparison with uninhibited solution, the molecule can act as both anodic and cathodic inhibitor. The obtained Ecorr value in case of CCA being shifted toward the lower side of 85 mV, confirmed that CCA acts as a mixed inhibitor type and has control over not only anodic metal dissolution, but cathodic hydrogen evolution also [26, 29]. Besides, as observed from Table 1 the cathodic and anodic slope (βc and βa) values did not show much change, which indicated that CCA influences the anodic and cathodic reaction kinetics without affecting the reaction mechanism [30].

Though temperature affects corrosion of metals in several ways, generally CR enhances with increasing temperature, especially in acidic environment due to improved conductance of the medium. The MS specimen under study also exhibited similar behavior with escalating temperatures in the absence of the inhibitor. On adding CCA to the system, CR of MS was found to decrease to a greater extent (increased % IE) with increasing temperature. This response could be mainly owing to the strong bonding interactions between the metal and the high electron density on the heteroatoms and the π electron cloud of the aromatic rings of the inhibitor. The escalated % IE values with rising temperature suggested the adsorption of CCA on to MS surface through chemisorption.

Further, the temperature-dependent CR values were used to study the kinetic behavior of the corrosion process. The energy (Ea), entropy (ΔS#) and enthalpy (ΔH#) of activation parameters for the corrosion process in presence of CCA were evaluated. The energy of activation parameter was measured using Arrhenius Eq. (3) [31].

$$\ln \left( {CR} \right) = B - \frac{{E_{a} }}{RT}$$
(3)

where Ea, R, B and T denote energy of activation, universal gas constant, Arrhenius pre-exponential constant and temperature, respectively. Arrhenius plot of ln (CR) against 1/T (Fig. 2a) gave slope = Ea/R, from which the energy of activation of corrosion process was determined. From Table 2, it is inferred that the Ea values in the presence of CCA were lower compared to uninhibited blank specimen [32, 33]. Besides, a concentration-dependent decrease in Ea values indicated the strong adhesion of CCA via chemisorption on to the metal surface.

Fig. 2
figure 2

a Plot of ln (CR) versus 1/T and b Plot of ln (CR/T) versus 1/T for MS specimen in 0.5 M HCl at different concentrations of CCA

Table 2 Activation parameters for the corrosion of MS in 0.5 M HCl acid containing different concentrations of CCA

The energy of activation, Ea decreased with rise in CCA concentration due to their gradual adsorption on MS surface, resulting in a closer approach to equilibrium at higher temperatures during the experiment. Olen et al. reported that the reduction in Ea in the presence of inhibitor may arise from a shift of the net corrosion reaction from the uncovered area of the metal surface to the covered part [34]. Yet another report by Schmid and Huang shows that the organic molecules inhibit both anodic and cathodic partial reactions on the metal surface, and a parallel reaction occurs on the covered region, but the reaction rate on the covered part is significantly less than that on uncovered area, which is similar to the present study [35].

The transition state equation as given in Eq. (4) was used to determine entropy and enthalpy of activation for the corrosion process.

$$CR = \frac{RT}{{Nh}}\exp \left( {\frac{{\Delta S^{\# } }}{RT}} \right)\exp \left( {\frac{{ - \Delta H^{\# } }}{RT}} \right)$$
(4)

where N represents Avogadro’s number (6.023 × 1023), R denotes universal gas constant and h signifies Plank’s constant (6.626 × 10–34 m2 kg s−1). Figure 2b depicts the straight line plot of ln (CR/T) versus 1/T, having slope = \(- \frac{{\Delta H^{\# } }}{R}\) and y intercept = (ln(R/Nh) + \(- \frac{{\Delta S^{\# } }}{R}\)), from which \(\Delta {H}^{\#}\) and \(\Delta {S}^{\#}\) were obtained. The increasing negative values of entropy(\(\Delta\)S#) as recorded in Table 2 implied the reduction in the randomness of the system due to the conversion of reactants to activated complex [36]. Moreover, the activated complex formed during the rate determination step displayed an association rather than a dissociation process [37].

As the corrosion inhibition mechanism is majorly influenced by the adsorption phenomenon, it is imperative to identify the type of CCA adsorption on MS specimen under study. Various adsorption isotherms were tried to fit the data obtained from PDP analysis. Consequently, the plots of Cinh/θ vs Cinh as depicted in Fig. 3a showed a straight line indicating that the CCA adsorption on to the MS surface followed Langmuir’s isotherm model [38], represented by Eq. (5).

$$\frac{{C_{{{\text{inh}}}} }}{\theta } = \frac{1}{K} + C_{{{\text{inh}}}}$$
(5)

where K and Cinh represent the adsorption equilibrium constant and the inhibitor concentration, respectively. Large values of K (Table 3) clearly indicated the formation of a stable adherent layer of CCA on the MS surface resulting in higher inhibition efficiencies [39]. Increasing K values with rising temperature advocated a strong interaction between CCA and MS surface in acid medium.

Fig. 3
figure 3

a Langmuir’s adsorption isotherm of varying CCA concentrations for MS and b plot of \({\Delta G}_{ads}^{^\circ }\) versus T for CCA adsorption on MS in 0.5 M HCl at various temperatures

Table 3 Thermodynamic parameters for the adsorption of CCA on MS surface in 0.5 M HCl acid at different temperatures

The correlation between K and the standard free energy of adsorption (\({\Delta G}_{a{\text{ds}}}^{^\circ })\) is denoted using Eq. (6).

$$K = \frac{1}{55.5}\exp \left( {\frac{{ - \Delta G_{{{\text{ads}}}}^{^\circ } }}{RT}} \right)$$
(6)

where T, R, \(\Delta G_{{{\text{ads}}}}^{^\circ }\) and 55.5 represent the absolute temperature, the universal gas constant, free energy of adsorption and the water concentration in the solution in mol dm−3, respectively. The \(\Delta G_{{{\text{ads}}}}^{^\circ }\) values acquired in 0.5 M HCl are presented in Table 3. The plot of \(\Delta G_{{{\text{ads}}}}^{^\circ }\) versus T (Fig. 3b) generated a straight line with thermodynamic adsorption factors such as enthalpy of adsorption \(\left( {\Delta H_{{{\text{ads}}}}^{^\circ } } \right)\) as slope and entropy of adsorption \(\left( {\Delta S_{{{\text{ads}}}}^{^\circ } } \right)\) as y intercept. The relation between them is given by Eq. (7).

$$\Delta G_{{{\text{ads}}}}^{^\circ } = \Delta H_{{{\text{ads}}}}^{^\circ } - T\Delta S_{{{\text{ads}}}}^{^\circ }$$
(7)

Generally, \(\Delta G_{{{\text{ads}}}}^{^\circ }\) value of –20 kJ mol−1 or more positive directs toward a physisorption, while those around − 40 kJ mol−1 or more negative are consistent with chemisorption. From Table 3, it is observed that \(\Delta G_{{{\text{ads}}}}^{^\circ }\) values were negative as well as greater than 40 kJ mol−1, which indicated the CCA adsorption on the MS surface to be a spontaneous process that occurred predominantly through chemisorption [40]. Further, the positive value of \(\Delta H_{{{\text{ads}}}}^{^\circ }\) confirmed the CCA adsorption on MS surface to be an endothermic reaction owing to chemisorption mechanism, and hence the increase in % IE with rise in temperature. The \(\Delta S_{{{\text{ads}}}}^{^\circ }\) value being highly negative demonstrated the reduction in disorder from the metal to the inhibitor [41].

3.2.3 Electrochemical Impedance Spectroscopy (EIS)

EIS was employed to further interpret the CCA adsorption on MS surface. The effect of CCA concentration on the impedance behavior of MS specimen in 0.5 M HCl during the electrochemical corrosion reaction that occur at the metal/electrolyte interface was investigated. The corresponding results were then compared with those obtained from Tafel polarization experiments. The Nyquist plots for MS corrosion with and without CCA at 313 K are portrayed in Fig. 4a. The depressed behavior of the semicircles refers to the frequency dispersions such as heterogeneities, roughness, grain boundaries, impurities, adsorption–desorption mode, mass transport and surface active site distribution. Moreover, the depressed semicircles denoted that the corrosion involved a charge transfer process [42], and the diameter of the semicircle at high-frequency region increased with increasing CCA concentration. Impedance of inhibited metal was found to be higher than the uninhibited. The shape of the semicircle did not change in uninhibited and inhibited solutions, which stated that the addition of CCA in to the acid medium did not induce any change in the mechanism of corrosion process. The wider capacitive loop diameter in CCA incorporated medium and the increase in diameter with rising CCA concentration suggested that the studied inhibitor protected the MS surface from acid attack and % IE improved with higher CCA concentration.

Fig. 4
figure 4

a Nyquist plots for the MS specimen in different CCA concentrations and b Equivalent circuit to fit the experimental EIS data c Plot of phase angle (θ) vs log frequency d Plot of log impedance vs log frequency for inhibition of MS corrosion in 0.5 M HCl containing 1 × 10–5 M CCA at 313 K

ZsimpWin software of 3.21 version was used for circuit fitting and the best fit was found with five element circuit (R(QR(QR))) as presented in Fig. 4b. It consisted of solution resistance Rs, two constant phase elements Q1, Q2 and charge transfer resistance (R1), which was in parallel with film resistance R2. Both R1 and R2 were found to increase with rise in CCA concentration at all the studied temperatures and from these the polarization resistance Rp was calculated using Eq. (8), which was later employed to calculate the \(\text{IE (\%)}\) using Eq. (9).

$$R_{p} = \frac{1}{R}_{1} + \frac{1}{{R_{2} }}$$
(8)
$$\% {\text{IE}} = \frac{{R_{{p({\text{inh}})}} - R_{p} }}{{R_{{p({\text{inh}})}} }} \times 100$$
(9)

where Rp and Rp(inh) represent the resistance of polarization for the uninhibited and inhibited solutions, respectively. To provide more accurate fit for Nyquist plot, the constant phase element Q was introduced in the circuit instead of a pure double layer capacitor. The Q impedance (ZQ) was calculated using Eq. (10).

$$Z_{Q} = \, Q^{ - 1} \left( {iw_{{\max}} } \right)^{ - n}$$
(10)

where Q and wmax represent the proportionality coefficient and the angular frequency, respectively, i denotes an imaginary number and n signifies the exponent related to phase shift. The n values lies between 0 and 1 (0 ≤ n ≤ 1), which is linked to the deviation of Q from the ideal capacitive behavior. The capacitance correction to its real value (Cdl) was obtained [43] using Eq. (11),

$$C_{{{\text{dl}}}} = \frac{1}{{2\pi f_{{\max }} R_{{c{t} }} }}$$
(11)

where fmax is the frequency at which the imaginary component of impedance is maximum. The obtained EIS results are presented in Table 4.

Table 4 Impedance parameters for the corrosion of MS in 0.5 M HCl in the absence and presence of various concentrations of CCA

The Rp value quantifies the transfer of electrons across MS surface and is inversely proportional to CR. The Rp values in the absence of CCA were lower than those in its presence, as evident from Table 4. Besides, increase in the Rp values with rise in CCA concentration indicated the reduction in the metal dissolution and hence increased inhibition efficiency, which could be owing to the creation of adsorbed protective film at the metal–solution interface. The decline in the Cdl values as observed in Table 4 can be ascribed to the improved electrical double layer formation at the metal–solution interface, which also advocated the CCA adsorption on MS surface. Moreover, the diminution in the Cdl values was initiated by the gradual replacement of water molecules during the process of CCA adsorption on the MS surface, which in turn decreased the extent of corrosion [9, 26, 44].

From the bode plot of phase angle vs frequency Fig. 4c, it is observed that the phase angle increases with increase in CCA concentration indicating the increase in percentage inhibition efficiency. Also the plot impedance |Z| vs. frequency (Fig. 4d) showed two plateaus: one at high frequency and the other at low frequency. The plateaus observed at high frequency were related to the solution resistance of the system (Rs) and that of low frequency plateaus related to the charge transfer resistance [45].

3.3 Spectral Analysis of Inhibitor Adsorption

3.3.1 UV–Visible Absorption Studies

UV–Visible spectra can also be used as important tool in confirming the adsorption of inhibitor molecules on the surface of the metal. Absorption spectra of 5 × 10–5 M CCA in 0.5 M HCl solution recorded at room temperature displayed bands at 276 and 336 nm, which could be due to ππ* and nπ* transitions, respectively. Further, the MS specimen was immersed into 5 × 10–5 M CCA in 0.5 M HCl solution for 1 h and UV–Visible spectra of the solution was recorded. The electronic spectra presented in Fig. 5a for the test solution after MS immersion clearly showed reduction in the absorption intensity of the mentioned peaks compared to that of pure CCA solution, which could be owing to the CCA adsorption on to the MS surface.

Fig. 5
figure 5

a Absorption spectra of 5 × 10–5 M CCA solution a without and b with MS coupon immersed in 0.5 M HCl and b overlay of the IR spectra of a CCA and b adsorption product formed on MS in 5 × 10–5 M CCA in 0.5 M HCl

3.3.2 FTIR Spectral Studies

FTIR measurements enable identification of functional groups and provide a qualitative idea about the adsorption of inhibitor molecules on metal surface. The IR spectra depicted in Fig. 5b added to the evidence for the adsorption of CCA on MS specimen. It can be observed that the characteristic azine band for CH=N–N=CH at 1614 cm−1 and that for C–N stretch at 1232 cm−1 in CCA was displaced to 1662 cm−1 and 1254 cm−1, respectively, in the corrosion product. These shifts in the IR frequencies of the functional groups present in CCA before and after adsorption to MS might be due to the metal–inhibitor interactions through functional groups [46].

3.4 Surface Morphology Evaluation Studies

The variations in the surface morphology of the freshly polished metal sample and metal sample immersed in 0.5 M HCl with and without 5 × 10–5 M CCA for about 2 h were investigated using SEM and AFM and the respective images are portrayed in Fig. 6. The uncorroded smooth polished surface morphology of the MS specimen is visible in Fig. 6a. SEM images of the MS coupon exposed to 0.5 M HCl without CCA inhibitor showed rough and highly deteriorated surface (Fig. 6b) with more number of pits due to the attack of chloride ions. However, the inhibited sample exhibited decrease in the number of macro and micropits (Fig. 6c), confirming the formation of protective adhesive layer of CCA molecules on alloy surface, hindering its direct contact with the corrosive chloride ions.

Fig. 6
figure 6

SEM images of a freshly polished MS specimen, b grossly corroded metal coupon exposed to 0.5 M HCl for 1 h and c less corroded metal coupon exposed to 5 × 10–5 M CCA in 0.5 M HCl for 1 h. AFM images of d corroded metal coupon exposed to 0.5 M HCl and e inhibited metal coupon exposed to 5 × 10–5 M CCA in 0.5 M HCl for 1 h

The surface roughness of the uninhibited (Fig. 6d) and inhibited (Fig. 6e) MS specimens were observed from the AFM micrographs and roughness parameters such as the average surface roughness (Ra), root mean square (RMS) roughness (Rq), and peak-valley maximum (P–V) values are mentioned in Fig. 6. The roughness values of specimen with CCA inhibitor was appreciably lower than the corroded coupon surface which also demonstrated the CCA adsorption making the MS surface smoother.

Elemental composition was known with the help of EDX analysis, which was carried out for the corroded and inhibited MS specimens and the results are presented in Fig. 7. From the quantitative analysis it can be inferred that in corroded sample, the atomic percentage of Fe and O were 39 and 51.5, respectively, but after addition of 5 × 10–5 M CCA, the percentage of Fe increased to 58 and O reduced to 24 as seen in the table in Fig. 7. Moreover, the percentage of carbon increased from 8 to 15 and a new peak appeared for nitrogen accounting for 1.22% after adding CCA, which further supported the evidence for CCA adsorption on to the MS surface.

Fig. 7
figure 7

EDX spectra of MS exposed to a 0.5 M HCl, b 0.5 M HCl containing 5 × 10–5 M CCA and quantification of elements in MS exposed to c 0.5 M HCl, d 0.5 M HCl with 5 × 10–5 M CCA

3.5 Theoretical Studies

Computer-based theoretical studies find application as special tools in material science which can be extended to the corrosion systems to get deeper insights into various parameters such as charge distribution and frontier molecular orbital electron density, which are related to adsorption tendency and inhibition efficiency [47,48,49]. Metal has a high tendency to accept lone pair or π-electrons from an electron-donating inhibitor molecule into its LUMO. On the contrary, metal could donate its HOMO (occupied π-orbital) electrons to appropriate antibonding (π*) vacant orbitals (LUMO) of the inhibitor molecule for retro or back-bonding. This donor–acceptor association between the inhibitor and vacant d-orbitals of metal is majorly responsible for the adsorption of inhibitor on the metal surface. Hence DFT simulations were performed by optimizing CCA using B3LYP basic set in Schrodinger material science suit software to explore the distribution of electron density in energy levels and hence its interaction with MS.

The gas phase optimized geometry and electronic distribution in HOMO and LUMO surfaces of CCA designed using 3D model builder are presented in Fig. 8. As reported in earlier studies, a reasonable correlation between the corrosion inhibitive efficiency and energies of molecular orbitals were witnessed [50]. The quantum chemical parameters calculated for CCA are tabulated in Fig. 8. The corrosion inhibitive tendency of CCA for MS corrosion in HCl electrolyte is associated with ELUMO, EHOMO and their energy gap (ΔE). The HOMO and LUMO electron densities of CCA are dominated primarily by the π bonding orbitals that are delocalized entirely over the two carbazole units and the nitrogen atoms in the molecule. High EHOMO (− 4.99 eV) is a clear indication of electron donation tendency of CCA to the d-orbitals of Fe in MS and lower ELUMO (− 1.37 eV) is the representation of the greater tendency of CCA to accept electrons from the metal. Thus the molecular orbital electronic surfaces exposed the ability of carbazole rings to donate as well as accept electrons under favorable circumstances. This feature of CCA to engage in donor–acceptor interactions could account for its adsorption on MS surface [51]. Low ΔE value of 3.62 eV featured high chemical reactivity and kinetic stability of CCA to engage in stable interaction with metal surface to provide better inhibition efficiency.

Fig. 8
figure 8

a B3LYP/6-311G++ optimized structure, b HOMO and c LUMO of CCA. The table represents various parameters of CCA calculated using theoretical studies

As per Koopman’s theorem, both ionization potential and electron affinity are related to energies of molecular orbitals and are calculated by the below equations:

$$- E_{{\text{(HOMO)}}} = I$$
(12)
$$- E_{{\text{(LUMO)}}} = \, A$$
(13)

where I signify ionization potential and A denotes electron affinity.

Chemical hardness (η) and softness (σ) obtained from the I and A values using Eqs. (14) and (15) have also been used as quantum chemical molecular descriptors of selectivity and reactivity [52]. They are related to corrosion inhibition and is often centered on Lewis acids and bases theory and Pearson’s concept of hard and soft acids and bases [20].

$$\eta = \, {1 \mathord{\left/ {\vphantom {1 2}} \right. \kern-\nulldelimiterspace} 2}(I - A)$$
(14)
$$\sigma = \frac{1}{\eta }$$
(15)

CCA being a soft molecule as per this concept displayed a low ΔE value enabling its adsorption on MS specimen.

Electronegativity (χ) and electrophilicity index (ω) were calculated using Eqs. (16) and (17). The direction of a corrosion inhibitory process is often predicted using the global reactivity index (ω) [53]. A good electrophile is defined by its high electrophilicity value, whereas a good nucleophile has a small electrophilicity.

$$\chi = {\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 2}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{$2$}}\left( {I + A} \right)$$
(16)
$$\omega = \chi^{2} /4\eta = 1/\varepsilon$$
(17)

The fraction of electrons that are transferred (ΔN) can be given as

$$\Delta N = \frac{{\emptyset_{{{\text{Fe}}}} - \chi_{{{\text{inh}}}} }}{{2\eta_{{{\text{inh}}}} }}$$
(18)

where \({\varnothing }_{\text{Fe}}\) denotes the work function of the Fe (110) plane possessing 4.82 eV. The ΔN value of CCA being 0.45 (ΔN > 0), clearly suggested that the transfer of electrons occurs from the inhibitor on to the metal surface [54]. Elnga et al. proposed that if the ΔN value is less than 3.6, then the IE(%) rises with increasing electron-donating capability of the MS surface [55]. CCA can thus have stronger interactions with metal, thereby efficiently protecting the metal, which was experimentally proved, and the inhibition effect was due to the contribution of electrons to the vacant d-orbital of Fe. Moreover, it is important to identify the moiety that is responsible for binding to the metal forming a film and further leading to corrosion inhibition. It is known that atoms especially heteroatoms with negative Mullikan charges tend to donate electron to the metal enabling electrostatic interactions [56]. Mulliken charges possessing atoms of CCA are shown in table presented in Fig. 9. It can be inferred that heteroatoms with high negative charges and carbons of aromatic rings act as the dynamic spots for CCA adsorption on the MS surface, thereby forming a protective layer which can hinder corrosion.

Fig. 9
figure 9

Structure of CCA portraying Mullikan charges on atoms

3.6 Mechanism of Corrosion Inhibition

Nature and morphology of metal surface, type of electrolyte media (pH or electrode potential), temperature, chemical structure and surface charge distribution of inhibitor influence the binding of the inhibitor on the metal surface [38]. Physisorption relies on electrostatic interactions between the charged inhibitor and the charged metal surface, whereas chemisorption is centered on the donor–acceptor interactions, where the unbound lone pair or π electrons of the inhibitor are transferred to vacant d-orbital of the metal. Previous literature reports suggest carbazole derivatives to show mixed-type inhibition for MS in 1 M HCl with predominating cathodic inhibition effects.

The surface of MS specimen in HCl environment is generally occupied by Fe2+ ions that are electrostatically stabilized by a layer of Cl ions. In acid environment, the heteroatoms in CCA are protonated promoting its interactions with the metal surface. Moreover, relatively high electrophilicity index of CCA denotes its propensity to interact with the outer Cl ionic layer of MS. This phenomenon could theoretically describe the high binding ability of CCA on to metal surface, and hence its high corrosion inhibition efficiency. Moreover, the experimentally obtained thermodynamic parameters confirmed the chemisorption of the inhibitor molecule on MS surface. The electron density at the active site of the inhibitor molecule influences the inhibition efficiency. The π electrons of the aromatic carbazole rings of CCA and the non-bonding electrons available on the nitrogen atoms can be donated to the empty d-orbitals of Fe to form co-ordination bond leading to chemisorption [57] as depicted in Fig. 10. Molecular quantum chemical calculations also supplemented the above results by suggesting that the reactive sites in CCA are mainly the N-atoms and the π-electron centers.

Fig. 10
figure 10

Adsorption of CCA on MS through electron pair interaction (chemisorption)

4 Conclusion

A new carbazole derivative viz. 9-ethyl-3-carbazolecarbaldehyde azine was prepared by easy one-step synthetic protocol from 9-ethyl-3-carbazolecarbaldehyde and characterized using spectral techniques. The following conclusions are drawn from the various investigations performed to study the corrosion inhibition property of CCA.

  • PDP measurements demonstrated a mixed-type corrosion inhibitor of CCA, displaying both temperature and concentration-dependent increasing trend of inhibition efficiency.

  • The CCA molecules adsorbed on the MS surface to form a protective film that inhibits the metal corrosion in 1 M HCl, obeying Langmuir isotherm.

  • Chemisorption of the inhibitor on the MS surface was established by the activation energy and thermodynamic parameters.

  • SEM and AFM images supported by EDX analyses provided evidences for the formation of a protective film of CCA on MS surface which shield the metal surface from direct contact to the acidic environment.

  • Theoretical studies mainly indicated the high band gap of CCA showing higher adsorption on to the metal.

  • Quantum mechanical DFT calculations supplemented the above experimental results and showed that the N-atoms and the π-electron centers of the carbazole rings act as the main reactive sites in CCA enabling strong interactions with Fe and hence bind to the metal surface.

From the above studies, it can be concluded that the CCA is a promising candidate to combat MS corrosion in acidic environment.