1 Introduction

Due to its excellent thermal conductivity, electrical conductivity, ductility, and good workability, copper is widely used in various fields, such as machinery manufacturing, power transmission, cooling and heating systems, military industry, and so on [1,2,3,4]. In order to obtain a shiny final copper surface, which is required in some applications, or to remove scale deposits that reduce the heating efficiency of some copper-based equipment, a sulphuric acid solution is frequently used to remove any undesirable products formed at the surface (oxidation films, incrustations, scale etc.) [3,4,5]. Therefore, corrosion of copper can be caused during this chemical treatment after the scale or oxides have been removed, which implies the dissolution of the metal and the consumption of the acid used. This also implies important economic losses for the industrialists [6, 7]. Corrosion phenomenon can be reduced by the use of inhibitors.

According to the literature, several studies have been carried out in this field for hundreds of years [8,9,10]. In 1860 Great Britain announced the discovery of the world's first corrosion inhibitor. Since this discovery, a lot of work has been done to find and develop different types of organic and inorganic inhibitors [11]. Previous studies have found that the presence of heteroatom's such as nitrogen, sulphur and phosphorus in the molecular structure of these inhibitors improves their inhibition effectiveness. Therefore, they can establish a coordination bonds between the free doublets of these heteroatom's and the empty d-orbital's of transition metals, which indicate the formation of an effective barrier film that isolates the metal substrate from the corrosive environment [12, 13]. However, some of these inhibitors have disadvantages: high cost, toxic to humans, risk of pollution to the environment [14]. In this context, corrosionists have always sought alternatives by focusing on biodegradable, economical, renewable plant products that do not present any risk to human health and the environment [15, 16].

According to Ajeigbe et al. [17] and Barakat et al. [18], plant extracts have been used for decades as effective corrosion inhibitors, their property due to their richness in complex organic compounds containing heteroatom’s, aromatic rings and multiple bonds (double and triple bonds) have also been identified as adsorption centers that interact with active sites on the surface of a metal. For this reason, multiple essential oils from different plants have also been studied to prevent metal corrosion. Among these plants, Rosmarinus officinals L [19], Nigella Sativa [20], Artemisia herba-alba's [21], Juniperusphoenicea [22] and Cinnamon [3]. All these oils have shown good inhibitory properties.

Garlic or Allium sativum, which belongs to the Liliaceaes family has been widely used since antiquity due to its therapeutic properties in the field of pharmacology [23, 24].

It has been evaluated as effective corrosion inhibitors in various media by several investigators. Table 1 shows some of the work of A. sativum used as corrosion inhibitors of different materials in different environments.

Table 1 List of A. sativum used as corrosion inhibitors

The essential oil of A. sativum is characterized by a high amount of organo-sulphur compounds such as trisulfide, methyl2-propenyl; trisulfide, di-2-propenyl and diallyl disulfide [30]. The last compound has been tested as a corrosion inhibitor of copper corrosion in 0.5M sulfuric acid medium by Tan et al. [4]. The existence of these products in our essential oil means that it may be an excellent inhibitor candidate for reducing copper corrosion in acidic media. Therefore, the aim of this work is to study the inhibition of copper corrosion in 0.5M sulphuric acid media in the absence and presence of A. sativum essential oil using electrochemical techniques such as potentiodynamic study, electrochemical impedance spectroscopy (EIS) and surface analysis by SEM/EDX.

2 Materials and methods

2.1 Extraction of the essential oil of A. sativum

The essential oil of garlic was extracted by hydrodistillation in a simple distillation unit, from fresh garlic bulbs of A. sativum (Meknes region, Morocco), prepared and distilled according to the following method: 500 g of garlic cloves were mixed with 500 ml of distilled water in a domestic blender for 1 min, and then placed in a 1L flask. The distillation was carried out for 4 h. The distillate (hydrolat + essential oil) was collected in a flask and separated with a separating funnel using diethyl ether as solvent. The organic phase, containing the essential oil, obtained was passed through a rotavapor to get rid of the solvent. The product obtained is kept in a dark brown glass container and stored in a refrigerator at 2 to 5 °C.

2.2 Preparation of the material

The metal samples used in this study are copper samples with the following chemical composition (in % by weight): 0.019 P, < 0.001 Fe, < 0.001 As, < 0.001 Mn, < 0.002 Sb, < 0.001 Al, 0.009 Sn, 0.003 Ni, 0.015 Pb, < 0.005 Ag, < 0.001 Bi, < 0.001 S, < 0.005 C and the rest is Cu. The copper samples were abraded with different grades of SiC abrasive papers(from 180 to 2000), followed by cleaned carefully according to ASTM G-81, and finally drying at room temperature. The aggressive solution were prepared by diluting analytical grade H2SO4 (98 wt.%) with distilled water. The concentration of the A. sativum oil used in the present study ranged from 0.5 to 2.0 g/L, and the blank solution was also prepared for comparison.

2.3 GC–MS analysis

The chromatographic analysis of the studied essential oil was carried out at the University Centre for Analysis, Expertise, Technology Transfer and Incubator CUA2TI of IBN TOFAIL University in Kenitra, using a 456-GC type gas chromatograph coupled to an EVOQ TQ type mass spectrometer. The fragmentation is performed by electronic impact at 70 eV. The column used is a Rxi-5Sil MS type capillary column (30 m × 0.25 mm ID × 0.25 µm df). The temperature of the column is initially programmed at 40 °C for 8 min at a rate of 2 °C/min up to 200 °C or 20 min remaining. The carrier gas is helium with a flow rate of 1.50 ml/min. The injection temperature is maintained at 250 °C and the injection volume is 1 µl. The apparatus is connected to a computer system managing a NIST MS Search2.0 mass spectrum library and driven by Ms Data review software allowing to follow the evolution of the chromatographic analyses. The identification of the constituents has been made on the basis of the comparison of their retention times with those of the standard compounds in the computerized database (NIST 2014).

2.4 Electrochemical measurements

The electrochemical measurements were carried out using a potentiostat/galvanostat/PGZ100 controlled by Volta Master 4 analysis software. The electrochemical experiments were carried out in the assembly of a three-electrode electrochemical cell which the size is 50 ml, using a copper plate as working electrode (with an exposed surface area of 1 cm2), a platinum rod as counter electrode and saturated calomel electrode (SCE) as reference electrode.

EIS measurement was performed in the frequency range of 100 kHz to 10 MHz at an open circuit potential (OCP) with 10 points per decade. The applied AC signal amplitude is 10 mV ms. All experiments were performed after 30 min immersion of the copper in a 0.5M H2SO4 solutions in the absence and presence of different concentrations of the studied oil.

The potentiodynamic polarization curves were obtained by sweeping the working electrode potential from − 1200 to 600 mV with a sweep rate of 1 mV/s. All electrochemical experiments were carried out at a temperature of 298 K and were repeated three times and presented values were obtained by averaging.

2.5 Analysis of surface morphology

In order to confirm the formation of a natural film on the cooper surface exposed to the 0.5M H2SO4 solutions for 6 h in the absence and presence of the A. sativum oil was carried out by analysis using Scanning Electron Microscope (Quantra 450) coupled with EDX analyses. These analyses were carried out at the MASCIR Foundation—Rabat.

3 Results and discussion

3.1 Analysis by GC–MS

GC–MS analysis identified 16 compounds representing 99.815% of the total constituents listed in Table 2.

Table 2 Composition of the essential oil of A. sativum Moroccan from the Meknes region

Allium sativum essential oil from the region of Meknes is composed essentially of organosulphurates and hydrocarbons, comparing these results with the literature [31,32,33], it was noticed that there is a great variation in the level of the elements identified, as well as in their percentages of existence in the oil studied, this variation may be due to the origin of the plant [34] as it may be due to the operating conditions of extraction [35].

Satyal [36] was able to identify 33 organosulfur compounds for Spanish garlic oil, the majority of which are Diallyltrisulfide (33.4%), Allyl methyl trisulfide (19.2%), and Diallyl disulfide with a percentage of (20.8%), whereas Egyptian garlic oil had diallyl disulfide (25.2%), allyl methyl trisulfide (23.8%), and diallyltrisulfide (21.1%) as major constituents [33]. The major constituents in this study are: Diallyl disulfide (26.623%), Trisulfide, methyl2-propenyl (16.459%) and Trisulfide, di-2-propenyl (34.104%) shown in Table 3.

Table 3 Main constituents of A. sativum essential oil

3.2 Polarization curve

The polarization curves of copper in the 0.5M H2SO4 solutions in the absence and presence of the essential oil of A. sativum at 298 K are shown in Fig. 1:

Fig. 1
figure 1

Polarization curves of copper in 0.5M H2SO4 solutions in the presence and absence of A. sativum essential oil (OE)

In the literature the behavior of copper in an aerated sulphuric acid solution has been studied by several researchers [37,38,39,40], the cathodic reaction was the summation of Eqs. (1) and (2):

Hydrogen reduction (1):

$$H^{ + } + 2e^{ - } \leftrightarrow H_{2}$$
(1)

Reduction of oxygen (2):

$$O_{2} + 4e^{ - } + 4H^{ + } \leftrightarrow 2H_{2} O$$
(2)

The cathodic reduction of oxygen can be expressed either by a direct transfer of \(4e^{ - }\) as described by Eq. (2) or by \(2e^{ - }\) in two consecutive steps involving reduction with hydrogen peroxide (H2O2) first [41, 42]:

$$O_{2} + 2e^{ - } + 2H^{ + } \leftrightarrow H_{2} O{}_{2}$$
(3)

followed by a further reduction:

$$H_{2} O{}_{2} + 2e^{ - } + 2H^{ + } \leftrightarrow 2H_{2} O$$
(4)

The anodic dissolution of copper takes place in two continuous stages.

$$Cu \leftrightarrow Cu(I) + e^{ - }$$
(5)
$$Cu(I) \leftrightarrow Cu(II) + e^{ - }$$
(6)

It has been concluded that the reaction rate of the first stage (reaction 5) is much faster than that of the second stage (reaction 6); therefore, the second stage is considered to be a key stage in the corrosion process [43].

The anodic and cathodic polarization curves shown in Fig. 1 show that the corrosion potential has been shifted to more negative values by increasing the concentration of the inhibitor.

On the other hand, the cathodic current density has been remarkably reduced compared to the anodic current density, implying that the rate of cathodic corrosion has been reduced. Also, it can be observed that the cathodic curves are not parallel to the white curve, which states that the inhibitor causes the modification of the cathodic corrosion mechanism of copper in an aerated 0.5M H2SO4 solutions by influencing the cathodic oxygen reduction reaction more than the anodic copper dissolution reaction [14].

The electrochemical parameters obtained from the extrapolation of the Tafel lines are listed in Table 4. These parameters included the corrosion potential (Ecorr), the cathodic Tafel slope(βc) and the corrosion current density (icorr). In addition, the corrosion inhibition efficiency (ηpp) was obtained using the following formula [43]:

$$\eta_{pp} \% = \left[ {{\raise0.7ex\hbox{${(i_{corr}^{^\circ } - i_{corr} )}$} \!\mathord{\left/ {\vphantom {{(i_{corr}^{^\circ } - i_{corr} )} {i_{corr}^{^\circ } }}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{${i_{corr}^{^\circ } }$}}} \right] \times 100$$
Table 4 Electrochemical parameters of the potentiodynamic curves for copper at 298 K in 0.5M H2SO4 solutions with and without different inhibitors concentrations

where icorr° and icorr are the corrosion current densities values in absence and presence of inhibitor, respectively.

The parameters presented in Table 4 show that all corrosion potentials are transferred to more negative potentials with a degree of offset of − 150 mV exceeding a value of − 85 mV. This observation reveals that the studied compound is cathodic in nature [4, 13, 44].

Moreover, the icorr values decrease towards lower current densities than the uninhibited solution with increasing concentration, which means the increase of the inhibition efficiency up to a value of 97.6% at a concentration 1 g/L. This phenomenon proves the formation of a barrier film on the surface of copper against corrosive attack [45].

The polarization resistance (Rp) values of copper in 0.5M H2SO4 increases from 397 Ω for the blank to 15182Ω for 1.0 g/L concentration of A. sativum (Table 4).

3.3 Electrochemical impedance spectroscopy

  1. 1

    In order to obtain information on the protection mechanism (charge transfer, diffusion, and adsorption) of copper by A. sativum essential oil in 0.5M H2SO4 solutions, electrochemical impedance measurements has been performed. Many works [46, 47], have shown that the electrochemical impedance measurements are likely to reveal the elementary steps involved in the global corrosion and/or protection processes. Cruz et al. [48] and Bentiss et al. [49] have studied the inhibition mechanism of some inhibitors using electrochemical impedance measurements, seems to prove that this technique is particularly well adapted to the determination of the mode of action of the inhibitors, to the evaluation of the dielectric characteristics of the formed film and makes it possible to follow their evolution according to many parameters.

The Nyquist diagrams of copper immersed in the 0.5M H2SO4 solutions obtained experimentally without and with the addition of different concentrations of A. sativum essential oil studied are recorded in Fig. 2. The observed experiments tested of triplicate measurements are highly reproducible giving standard deviations.

Fig. 2
figure 2

Nyquist and Bode diagrams copper/0.5M H2SO4 interface in the Nyquist plane in the absence (a) and presence of A. sativum (b) at different concentrations at 298 K

The impedance diagrams presented in the Nyquist plane are characterized by the presence of two badly separated capacitive loops, we can confirmed this result by the bode diagram, a two time-constants in bode plot appears in the inhibited sample as shown in Fig. 2b. The semicircle at the high frequency part is related to the resistance and capacitance of adsorbed inhibitor films present on the copper surface, the second time constant appearing at low frequencies corresponds to the charge transfer phenomenon at the copper/H2SO4 interface [3].

From the bode presentation, concerning the bode presentation of blank solution (Fig. 2a) we can observed the presence of one time-constant attributed to charge transfer process.

We also observe that the impedance display of copper in the solutions containing the inhibitor has considerably changed shape and size compared to the blank one. While the essential oil of A. sativum leads to changes in impedance behavior [3], the increase in the size (namely Rp = diameter)of these loops, with the concentration of inhibitor is justified, indicating an increase in the protective power by the formation of an inhibitor film that blocks the formation of the corrosion product [50]. This result reflects the influence of A. sativum on the process at the copper/acidic medium interface [51].

The Nyquist impedance spectra of copper in 0.5M H2SO4 were modelled by the equivalent circuit shown in Fig. 3a, and All impedance spectra obtained from the copper electrode exposed for 30 min in H2SO4 solutions containing A. sativum were analyzed by the equivalent circuit shown in Fig. 3b. The following are the components of the suggested equivalent circuit: Rs represents the solution resistance, Rct the charge transfer resistance, Rf the film resistance, and Qf and Qdl the constant phase elements [51, 52].

Fig. 3
figure 3

Equivalent circuits for the copper EIS used to model the copper/solution interface in the absence (a) and in the presence of the inhibitor (b)

As can be seen in Fig. 3, the capacitor has been replaced by a constant phase element, indicating the presence of a dissimilar frequency response. The EPC impedance is defined as follows [53]:

$$Z_{CPE} \left( \omega \right) = Q^{ - 1} \left( {j\omega } \right)^{ - n}$$

where Q is a constant in Ω/cm2 sn, ω is the angular frequency in rad/s, n is the exponent of CPE with − 1 < n < 1. CPE can represent an inductance (n = − 1), a Warburg impedance (n = 0.5), a pure capacitance (n = 1), or a resistance (n = 0). The smaller value of n, the higher the surface roughness [54].

The electrochemical parameters obtained from the impedance diagrams and the inhibiting efficiency (E%) are grouped in Table 4. The values of the polarization resistance Rp of all systems are calculated using the following equation:

$${\text{R}}_{{\text{p}}} = {\text{R}}_{{\text{f}}} + {\text{R}}_{{{\text{tc}}}}$$

Inhibition efficiency (ηimp%) is calculated by the following equation [45]:

$$\eta_{imp} \% = (R_{P} - R_{P}^{^\circ } /R_{P} ) \times 100$$

where RP° and RP are the charge transfer resistance in absence and presence of the inhibitor, respectively.

From the data in Table 5, it can be seen that, when the concentrations of A. sativum increase to a value of 1 g/L, the values of Rct increase, while the values of Qdl decrease, this is due to the formation of a protective film on the metal surface by the adsorption of Allium sativum, which slows down the corrosion process of copper in H2SO4 by the action of the inhibitor [50]. The decrease in Qdl value may be due to a decrease in the local dielectric constant and/or an increase in the thickness of the double layer [50]. As a consequence, it can be said that the inhibitor molecules act by adsorption at the solution-metal interface [51].

Table 5 Electrochemical impedance parameters in the absence and presence of A. sativum at different concentrations at 298 K

Similarly, when the concentration of the inhibitor increases to a value of 1 g/L, it can be seen that the Rf values increase, while the Qf values decrease to the optimal concentration (1 g/L of A. sativum essential oil). These evolutions indicate a thickening of the film formed and a decrease in permeability through it [55]. Consequently, the decrease in Qf values shows that the adsorption layer formed by Allium sativum on the metal surface is stable and thick [56]. In the presence of 1.0 g/L of Allium sativum we notice that the diameter of Rp has obviously increased from 350 Ω cm2 to 14,302 Ω cm2, which implies a better protection of the copper by our oil in an acidic environment.

Comparing the performance of our oil to other green inhibitors such as cinnamon essential oil and lotus zizyphus extract which have been tested for the same metal in an acidic medium we notice that the maximum efficiency that can be achieved with cinnamon essential oil is 89.62% [3] as well as obtaining a maximum value of 90.57% for the extract of lotus zizyphus [50], while with the oil of A. sativum the effectiveness has reached 97.5% Table 5, so we can see that our inhibitor admits a better inhibitory effect for copper in an acidic medium compared to these two green inhibitors.

3.4 Temperature effect

In order to evaluate the influence of temperature on the inhibition efficiency of the investigated essential oil, the polarization curves of copper were performed before and after addition of A. sativumin 0.5M H2SO4 solutions at a concentration of 1.0 g/L in the temperature range from 298 to 328 K after 30 min of immersion time.

Figure 4 shows the polarization curves of copper in the 0.5M H2SO4 solutions in the absence (a) and presence (b) of the inhibitor. The electrochemical parameters are summarized in Table 5. It can be seen from Table 5 that the cathodic and anodic current densities increase with increasing temperature. Thus, this compound still show superior inhibition performance to prevent copper from corrosion by forming a firm adsorption film onto copper substrate.

Fig. 4
figure 4

Potentiodynamic polarization curves for copper in 0.5M H2SO4 without (a) and with 1.0 g/L of A. sativum essential oil (OE) (b) at different temperatures

On the other hand, it can be seen that the curves in Fig. 4a are more or less parallel to each other, only for the anode region, whereas the cathode region admits a change in the shape of the cathode curve from T = 298 K to T = 308 K, which implies that temperature does not affect the anode reaction but only the cathode reaction and the speed of the latter.

Although in the presence of the inhibitor Fig. 4b, it can be seen that the curves are more or less parallel for the two cathodic and anodic regions, it can be said then that in the presence of the inhibitor the temperature does not affect the mechanism but only the corrosion rate.

Compared with that in blank solution, the icorr value decreases remarkably with the addition of 1.0 g/L d’E.O. at each temperature, implying that this essential oil considerably inhibit the corrosion reaction of MS.

Also by comparing the curves of Fig. 4 we can see a decrease in the current density icorr compared to the bank solution at different temperatures as well as a decrease in the inhibition efficiency with temperature which can be due to the weakening of the adsorbed film on the substrate surface, which suggests a physical adsorption of our inhibitor on the metal surface [57].

The effect of temperature on the inhibited acid-metal action is very complex, many changes may occur on the metal surface, such as rapid desorption of the inhibitor as well as the inhibitor itself, may undergo decomposition, rearrangement or both at the same time [3, 50].

Further, Table 6 indicates that corrosion efficiency decreases with increasing temperature, this decrease in efficiency is attributed to the increased dissolution of copper in acidic media, and/or partial desorption of the inhibitor from the metal surface [58,59,60]. These results indicate physisorption of the inhibitor on the metal surface of copper [50, 58].

Table 6 Electrochemical parameters of copper in 0.5M H2SO4solutions with and without 1 g/L E.H. of A. sativum at different temperatures

3.5 Parameters for activation of the corrosion process

The calculation of thermodynamic parameters such as activation energy, activation enthalpy and activation entropy allow the quantification of the corrosion inhibition efficiency in order to determine and interpret the adsorption type adopted by an inhibitor.

In order to estimate these parameters shown in Table 7, plots of the Arrhenius curves, the logarithm of the corrosion rate (ln(icorr)) vs (1000/T) are used (Fig. 5a). The activation energy of the corrosion process Ea can be calculated using the following equation [61, 62]:

$$ln\left( {i_{corr} } \right) = lnA - \frac{Ea}{{RT}}$$

where R is the perfect gas constant, A is the pre-exponential Arrhenius constant and T is the absolute temperature.

Table 7 Activation parameters Ea, ΔHa and ΔSa for copper in 0.5M H2SO4solutionswith and without 1 g/L of A. sativum essential oil
Fig. 5
figure 5

Arrhenius curves for copper in 0.5M H2SO4 solutions with and without 1 g/L of A. sativum essential oil

The activation entropy (ΔSa) and the activation enthalpy (ΔHa) were obtained on plotting (Ln (icorr/T)) vs (1000/T) (Fig. 5b), where (− ΔHa/R) is the slope and [Ln (R/Nh) + (ΔSa/R)] the intersection of the straight line with the y-axis according to the alternative formula of the Arrhenius equation [61,62,63]:

$$ln\left( {\frac{{i_{corr} }}{T}} \right) = \left( {ln\left( \frac{R}{Nh} \right) + \frac{{{{\Delta Sa}}}}{R}} \right) - \frac{{{{\Delta Ha}}}}{RT}$$

where h is the Planck's constant, N is the Avogadro number, T is the absolute temperature, ΔSa is the activation entropy and ΔHa is the activation enthalpy. The obtained results are grouped in Table 7.

The Arrhenius curves obtained in the presence of 1 g/L of A. sativum essential oil presented in Fig. 5 are compared to those of copper in a 0.5M H2SO4 solutions in the absence of inhibitor.

According to the literature, the variation of kinetic parameters adopts a specific type of adsorption. The presence of the studied inhibitor increased the energy barrier (Ea) of the inhibiting solution above that of the blank and hence the inhibition process, which promotes electrostatic interactions with the metal surface and the adsorption of the protective film is of physical nature [3, 63,64,65]. In contrast to an equivalent chemical adsorption of a decrease in Ea in the presence of an inhibitor, which is accompanied by an increase in the effectiveness of the inhibition with temperature [66, 67].

The results shown in Table 6 indicate an increase in Ea values in the presence of inhibitor compared to the blank solution, which suggests a physisorption at the metal surface, while the studied inhibitor blocks the cathodic sites by constructing a barrier that mainly inhibits the corrosion process [62]. Furthermore, the positive values of ΔHa indicate the endothermic character of the copper dissolution process and inform that the dissolution of copper is slow in the presence of inhibitor [61, 63]. Also, the negative values of the entropy (ΔSa) indicate a decrease in the degree of randomness which occurred when the reactants are transformed to activated complexes [61, 63].

3.6 Surface analysis

In order to confirm the results obtained by the electrochemical measurements. Qualitative microscopic SEM analyses coupled with quantitative EDX analyses were performed. Figure 6 shows the surface of recently abraded copper immersed in the 0.5M H2SO4 solutions without inhibitor, it can be found that the homogeneous corrosion of the entire copper surface is very dense and orderly in the blank solution. However, the corrosion degree of the Cu surface is very serious. However, the addition of the studied essential oil causes a decrease in the corrosion degree on the copper surface and a non-uniform protective film is formed on the surface of the copper (Fig. 7).

Fig. 6
figure 6

SEM image and corresponding EDX spectra at the surface of copper immersed for 6 h in 0.5M H2SO4 solutions at 298 K

Fig. 7
figure 7

SEM image and corresponding EDX spectra at the surface of copper immersed for 6 h in 0.5M H2SO4 solutions at 298 K with the addition of 1 g/L of the inhibitor

The EDX analysis (Fig. 6) shows the presence of oxygen, which is a corrosive element for copper and therefore justifies the corrosion of copper. These findings are confirmed by the SEM analysis. Figure 7 shows also the appearance of a sulphur peak which is the initial element of the chemical composition of A. sativum essential oil. These observations proves the formation of a protective barrier film created when the tested essential oil interact with the copper surface in acid solution.

3.7 The mechanism of inhibition

Generally, organic molecules presented in our essential oil are adsorbed on the metal surface and prevent further dissolution of metal by blocking either the cathodic or anodic reaction or both. Organic inhibitors, capable of forming insoluble complexes, or chelates, with metallic ions present on the surface of metal [68]. The inhibition efficiency of our corrosion inhibitor (major constituents)against the corrosion of copper in 0.5M H2SO4 can be explained on the basis of the number of adsorption sites, their charge density, molecular size, mode of interaction with the metal surface and the ability to form a metallic complex. The π electrons and free electrons on the S atoms form bonds with the metal surface (copper); see Fig. 8.

Fig. 8
figure 8

Proposed scheme for the adsorption of inhibitor on the copper surface in acid medium

According to the potential–pH diagram [69], the protective Cu2O and CuO oxide films can be easily dissolved at low pH values. As shown in Fig. 8, the dissolution of copper in acidic medium proceeded according to the following steps:

$$Cu - e^{ - } \to Cu(I)_{ads}^{{}} (fast)$$
$$Cu(I)_{ads} - e^{ - } \to Cu(II)^{{}} (slow)$$

where Cu(I)ads is an adsorbed species at the copper surface and does not diffuse into the bulk solution. The cathode reduction of oxygen can be expressed as follow:

$$O_{2} + 4H^{ + } + 4e^{ - } \to 2H_{2} O$$

According to the literatures [70] two mechanisms have been proposed to explain the high inhibiting efficiency recorded for the inhibitors designated as INH. One mechanism attributes the phenomenon to the formation of an adsorbed layer of INH i.e.,

$$Cu_{(S)} + INH \to Cu:INH_{(ads)}$$

where Cu: INH(ads) refers to INH adsorbed on the copper surface. The other mechanism postulates a protective Cu(I)IN film on the surface, which inhibits the anodic dissolution reaction, i.e.,

$$Cu_{{_{(aq)} }}^{ + } + INH_{{_{(aq)} }}^{{}} \to Cu(I)IN_{(S)} + H_{(aq)}^{ + }$$

The Cu(I)IN complex is favored at more anodic potentials in less acidic media; however, the adsorbed species is formed in more acidic media under cathodic potentials.

4 Conclusion

In the present study, the inhibition effect of A. sativum essential oil against the corrosion of copper in 0.5 H2SO4 was evaluated via electrochemical and surface studies. From the above results and discussion, we can conclude that:

  • The analysis of the oil by GPC-MS showed that the oily fraction of garlic contains highly reactive sulphur molecules of which three are the main compounds (diallyldisulphide, trisulphide, methyl-2-propenyl and trisulphide, di-2-propenyl).

  • The essential oil of A. sativum is endowed with a good inhibitory efficiency of up to 97.6% for a concentration of 1 g/L.

  • EIS results show that the Nyquist diagrams obtained show two capacitive loops, one at high frequency which can be associated with the adsorption of a film on the surface of the copper, and the other at low frequency which can be attributed to the phenomenon of charge transfer at the copper/H2SO4 interface.

  • The study of the temperature effect shows that our inhibitor has good inhibitory efficacy values in an ascending temperature range, which shows a good temperature resistance.

  • The thermodynamic parameters confirm the physisorption of the studied inhibitor on the copper surface in 0.5M sulphuric acid media.

  • SEM analysis coupled with EDX confirms the presence of a protective layer on the substrate surface.