1 Introduction

With the rapid development of artificial intelligence and the explosive increase in the uses of electronics, electronic systems are inevitably used in diverse environments. Electrochemical migration (ECM) is one of the main failure modes of electronic materials, which significantly threats the reliability of electronic devices [1,2,3]. Theoretically, when there is an ionic path (e.g., a continuous electrolyte layer) which connects two electrodes and simultaneously a bias voltage is present between the both electrodes, the ECM can probably occur. Metal ions are produced through anodic dissolution process and then migrate toward the cathode direction under the electric field. When they arrive at cathode, they can be reduced to dendrites which then grow toward the anode direction [4,5,6,7,8]. Once one of the dendrite bridges the two electrodes, the short circuit occurs.

Electronic systems are usually built by combinations of multi-material, including Cu, Sn, Au, Al, and Sn solder alloys. Almost all of these materials are encountering the risk of ECM. In electronics, the contact/connector areas, component electrodes, and solder joints are usually directly exposed to the environment, suggesting that these parts encounter high risk of ECM. Nowadays, the lead-free tin-based solder is widely used for surface finish on printed circuit board assemblies or other electronic packages through a hot air-leveled method [9]. Therefore, large part of the exposed metallic areas is made of tin or tin solders. Especially, the most commonly used Pb-free solder alloys contains over 95% tin [2]. Consequently, ECM study of tin is significant for the reliability of electronic devices.

The ECM behaviors of tin and tin solder alloys are strongly dependent on the electric field and contaminants. As the driving force of ECM, electric field affects ECM mainly through its strength, and its types including steady-state electric field and unsteady-state electric field [2, 11,12,13], while the ECM of tin and tin solder alloys in the presence of different contaminants have also been extensively investigated in previous work where the contaminants such as chlorides [3, 8, 14, 15], sulfates [16,17,18,19], and flux residues [3, 8, 20,21,22] are mainly involved. The explosive increase in the uses of electronics results in that there are more opportunities for tin and tin solder alloys to be exposed to environment with diverse contaminants, even with some especial aggressive contaminants such as H2S.

H2S, which is highly corrosive and toxic, could usually exist in the microbial breakdown of organic matter, such as in swamps and sewers. H2S also exists in volcanic gases and in some sources of well water. As an associated gas, large amount of H2S sometimes can also be found in natural gas [23]. With the rapid development of artificial intelligence, electronics are inevitably used in such environments containing H2S. For example, the electronic sensors or detectors used in monitoring in locations related to swamps and sewers, and the electronic system used in the natural gas production and transportation.

It can be expected that H2S could change the ECM process because of its special properties. On the one hand, H2S is soluble in the water film and subsequently it can easily dissociate into different ionic species including H+, HS and S2−. These ions could obviously affect the ECM processes such as precipitates formation and the ion migration. On the other hand, even if the packaging device does not have fault, the presence of H2S in the environment could destroy the package of the device and then affect the ECM process since H2S could accelerate the degradation of the packaging materials. To the best of our knowledge, there is just one publication related to the ECM of Sn–Pb solder alloys, i.e., Zou et al. found that in the presence of trace amount of H2S (1 ppmv), PbS could be easily formed during the ECM process of tin–lead solder joints [24]. However, a comprehensive study on ECM of tin and tin solder alloys in the presence of H2S is still missing.

ECM of tin and tin solder alloys generally including the following steps: (i) electrolyte layer formation, (ii) dissolution of metal, (iii) ion transport, and (iv) dendrites’ growth [11]. In the presence of H2S, H2S would first dissolve into the electrolyte layer, then partially dissociate into H+, HS and S2−, resulting in a decrease in pH of electrolyte and an increase in ionic strength. Additionally, the presence of HS and S2− would also affect the precipitates formation during the ECM process. Therefore, it is expected that obvious differences in ECM behaviors between with and without H2S would be present. In this work, the ECM of tin in the presence of H2S was in situ investigated using thin electrolyte layer method [9]. The effects of H2S concentration and the electric field type on ECM of tin were discussed.

2 Experimental

2.1 Materials and electrodes

In the present work, tin electrodes with the dimensions of 2 mm × 5 mm × 10 mm were cut from a bulk pure tin (> 99.999 wt%). As schematically shown in Fig. 1a, there are two tin electrodes with the same dimensions were embedded into an epoxy resin cylinder matrix. The distance in parallel direction between both electrodes is 0.6 mm. During the experiment, one electrode will act as working electrode (WE), and the other one will act as counter electrode (CE). To guarantee the electrical contact, a copper wire was connected to one end of each electrode. In order to make an ionic path for reference electrode (RE), a hole with a diameter of 1 mm was drilled through the epoxy cylinder at the position of 1 mm apart from ends of the WE and CE [14]. Porous ceramics was employed as a salt bridge and placed into the hole to generate a ionic path. In this case, the solution resistance between WE and RE can be greatly decreased [14]. A saturated calomel electrode (SCE) was used as RE in this work; therefore, all the potential is with respect to SCE.

Fig. 1
figure 1

Schematic diagrams: a electrode system in which two tin electrodes are embedded in the epoxy resin matrix, b electrode system together with U-shape tube on a horizontal stage, and c the setup in a chamber for electrochemical migration test

2.2 Experimental setup

The experimental setup includes the electrode system, the home-made setup for the measurement of electrolyte layer thickness, and the environment controlling system.

The electrode system consists of a U-shape plexiglass tube, RE, and the epoxy resin cylinder in which WE and CE were embedded as described above. The assembly steps for electrode system include the followings: (i) put the bottom of the epoxy resin into lower end of the U-shape plexiglass tube, (ii) add saturated KCl solution into the tube from the higher end, and (iii) put RE into the higher end of the U-shape tube where the RE could be immersed into the solution. Previously, a two-electrode system consisting of WE and CE was usually used in the ECM test, trying to simulate the operating condition of electronics [9, 24,25,26]. However, the exact potential applied on the working electrode was missing. This setup allows us to control and record the exact potential that is applied on electrode during the ECM test. Therefore, it is more convenient to understand the electrochemical reaction occurred on the electrode during the ECM test.

Before each experiment, the exposed surface of the epoxy resin cylinder was ground up to 1200 grit with silicon carbide paper. The end surface of the two embedded tin electrodes was also exposed. Then, the whole surface was rinsed in turn with deionized water and ethanol, and dried in cool air. The exposed area of WE or CE is 0.1 cm2. The assembled electrode system was put on a horizontal stage, and then the stage together with the electrode system was placed into a chamber, as is shown in Fig. 1c. Finally, electrode system was leveled using a spirit level to keep the electrode surface horizontal. In this case, a homogenous electrolyte layer can be generated successfully.

In this work, a 200-μm-thick electrolyte layer was generated on the electrode surface. The following two steps are included: (i) put a certain amount of electrolyte on the electrode surface and (ii) measure and adjust the thickness of the electrolyte layer. This setup for the thickness measurement of electrolyte layer is also shown in Fig. 1c, which mainly consists of a sharp Pt needle (Ф = 50 μm) and a Z-stage equipped with a micrometer. The detailed information and method of thickness measurement were described elsewhere [14]. The same electrolyte was also added into the plexiglass chamber to minimize the evaporation.

2.3 ECM tests

Prior to the experiment, the gas (N2 + H2S) with a certain concentration of H2S was injected into the chamber. The flow rate of the H2S-containing gas is 60 mL/min. H2S will dissolve into the electrolyte layer and the electrolyte in the chamber. The support electrolyte was 0.1 mM NaCl solution (pH 6.9), which was prepared using deionized water (18.2 MΩ cm in resistivity) and analytical grade NaCl. After the gas injection was maintained for 1 h, the polarization potential began to applying on the electrodes. The gas injection did not stop until the end of ECM test. The H2S concentration in the gas was 0, 10, 100, 1000, 10,000, and 100,000 ppmv (ppmv: part per million (10–6), by volume.) in this work. In this work, the effect of H2S concentration on ECM of tin under DC electric field was firstly investigated, then the difference in ECM of tin under different electric fields is compared. 1.5 V vs. open circuit potential (OCP) of WE was applied on the working electrode surface to generate a DC bias across the WE and CE. The OCP of tin in H2S-containing solution was around 0.65 V vs. SCE in this work. The value changed little with H2S concentration. For comparison, an experiment was conducted under square wave electric field with a time period of 1 s. For each period, 1.5 V vs. OCP of working electrode was first applied for 0.5 s, and − 1.5 V vs. OCP of working electrode was applied on the working electrode during the remaining 0.5 s. The generator of the bias voltage across the two electrodes is an electrochemical working station, i.e., a CS350 electrochemical test system (Wuhan Corrtest, China). The current and the potential can also be recorded during the ECM process. The migration process can be in situ observed by a digital 3D microscope (VHX-1000E, Keyence, Japan). In order to check the reproducibility, all the ECM measurements were repeated at least five times. All ECM tests were performed at 20 °C and 90% RH in this work.

3 Results

Figure 2 shows the optical graphs of ECM of tin at different H2S concentrations. It is obvious that the ECM behaviors change with increasing H2S concentration, suggesting H2S may greatly affect the ECM mechanism of tin. Specifically, from 0 to 1000 ppmv of H2S, the dendrites growth together with precipitates formation can be observed clearly. The color of the precipitates is gray. As soon as one of the dendrites bridges the two electrodes (WE and CE), the short circuit will occur. However, at 10,000 and 100,000 ppmv H2S, the dendrites growth could not be seen even after 1200 s, and only large amount of precipitates are formed. Furthermore, the color of the precipitates has also changed. i.e., some yellow substances are incorporated into the gray precipitates. As the H2S concentration increases from 10,000 to 100,000 ppmv, the amount of the yellow precipitates increases remarkably (Fig. 2e, f).

Fig. 2
figure 2

Optical graphs of electrochemical migration of tin at different H2S concentrations for different time intervals: a 0 ppmv, 325 s, b 10 ppmv, 104 s, c 100 ppmv, 56 s, d 1000 ppmv, 48 s, e 10,000 ppmv, 1200 s, f 100,000 ppmv. 1200 s (Anode is on the right and cathode is on the left)

From the typical current vs. time curves for ECM of tin at different H2S concentrations (Fig. 3), it can be seen that the initial current increases with increasing H2S concentration. e.g., at 100,000 ppmv H2S, the initial current is 2.78 × 10–4 A which is over 40 times higher than that at 0 ppmv H2S. From 0 to 1000 ppmv H2S, there is a spike (a sudden increase in current) on each current vs. time curve when the dendrite bridges the two electrodes, meaning that the short circuit occurs. Moreover, the time to short circuit decreases with the increasing H2S concentration (Figs. 3 and 4). This suggests the presence of H2S could accelerate the ECM of tin at a certain H2S concentration range. When the H2S concentration further increases up to 10,000 or 100,000 ppmv, the change trend of the current vs. time curve is completely different from the lower H2S concentrations. The initial current for 10,000 or 100,000 ppmv is as high as 9.08 × 10–5 A and 2.78 × 10–4 A, respectively. At the very beginning of the ECM experiment, the current decreases quickly (Fig. 3), suggesting the ECM process is hindered. Another important difference is that there is no spike on the whole current vs. time curve at 10,000 or 100,000 ppmv H2S. Even after 1200 s, the sudden increase in current is not still present. This means that no short circuit happens across the two electrodes, which is in good agreement with the observations from the optical graphs.

Fig. 3
figure 3

Typical current vs. time curves for ECM of tin at different H2S concentrations

Fig. 4
figure 4

Time to short circuit for ECM of tin at different H2S concentrations

For comparison, the ECM of tin in the presence of H2S under unsteady-state electric field (i.e., square wave electric field) was also studied. Figure 5 shows the optical graphs of ECM of tin under different electric field in the presence of 100 ppmv H2S. Huge difference in ECM behavior between DC electric field and square wave electric field can be found. For DC electric field, dendrite growth can be seen, but only some precipitates are present under square wave electric field, even after 1200 s. Figure 6 presents the corresponding potential and current vs. time curves for ECM of tin under square wave electric field. There are obvious charging and discharging processes during the switch from one semi-cycle to another one. For example, from 0.5 to 1 s, the current sharply decreases from − 1.61 × 10–4 to − 8.97 × 10–5 A, then it keeps around a stable value until the beginning of next semi-cycle. The current at the later stage of experiment is much higher than that at the beginning stage, this could be attributed the increase in total concentration of ions; however, the short circuit does not occur. During the whole experiment, the square wave forms of potential do not change. These results suggest that square wave electric field may inhibit the dendrite growth during the ECM process.

Fig. 5
figure 5

Optical graphs of electrochemical migration of tin at 100 ppmv H2S under different electrical field: a taken at 56 s under DC field: 1.5 V vs. OCP of working electrode and b taken at 1200 s under square wave field with a time period of 1 s during which 1.5 V vs. OCP of working electrode was applied for 0.5 s and − 1.5 V vs. OCP working electrode was applied on the working electrode for the next 0.5 s

Fig. 6
figure 6

Current and potential vs. time curves for square wave with a time period of 1 s during which 1.5 V vs. OCP of working electrode was applied for 0.5 s and − 1.5 V vs. OCP working electrode was applied on the working electrode for the next 0.5 s

4 Discussion

4.1 Water chemistry in the presence of H 2 S

In order to analyze the ECM mechanism of tin in the presence of H2S, the water chemistry in the presence of H2S needs to be first clarified. In this work, 0.1 mM NaCl solution was used as the support electrolyte in which H2S is soluble, as described by Eq. (1):

$${\text{H}}_{{2}} {\text{S}}_{{({\text{g}})}} \leftrightarrow {\text{H}}_{{2}} {\text{S}}_{{({\text{aq}})}}$$
(1)

The concentration of H2S (\(c_{{{\text{H}}_{{2}} {\text{S}}}}\)) in the electrolyte can be calculated by Eq. (2):

$$c_{{{\text{H}}_{{2}} {\text{S}}}} = K_{{{\text{sol(H}}_{{2}} {\text{S)}}}} \times p_{{{\text{H}}_{{2}} {\text{S}}}}$$
(2)

where \(p_{{{\text{H}}_{{2}} {\text{S}}}}\) is partial pressure of H2S, and \(K_{{{\text{sol(H}}_{{2}} {\text{S)}}}}\) is Henry’s constant, which is given by Eq. (3) [27, 28]:

$$K_{{{\text{sol(H}}_{{2}} {\text{S)}}}} = 10^{{ - (634.27 + 0.2709T_{{\text{k}}} - 0.00011132T_{{\text{k}}}^{2} - 16719/T_{{\text{k}}} - 261.9{\log}_{10} T_{{\text{k}}} )}}$$
(3)

In which Tk is Kelvin temperature. Aqueous H2S is a weak acid which partly dissociates in the following two steps as described by Eqs. (4) and (5):

$${\text{H}}_{{2}} {\text{S}}_{{({\text{aq}})}} \leftrightarrow {\text{H}}^{ + } + {\text{ HS}}^{ - }$$
(4)
$${\text{HS}}^{ - } \leftrightarrow {\text{H}}^{ + } + {\text{ S}}^{{{2} - }}$$
(5)

The concentration of HS (\(c_{{{\text{HS}}^{ - } }}\)) can be calculated by Eq. (6):

$$K_{{{\text{hs}}}} = \frac{{c_{{{\text{HS}}^{ - } }} c_{{{\text{H}}^{ + } }} }}{{c_{{{\text{H}}_{{2}} {\text{S}}}} }}$$
(6)

where \(K_{{{\text{hs}}}}\) is the dissociation constant of H2S and can be calculated as Eq. (7) [27]:

$$K_{{{\text{hs}}}} = 10^{{(782.43945 + 0.36126T_{{\text{k}}} - 0.00016722T_{{\text{k}}}^{{2}} - 20565.7315T_{{\text{k}}} - 142.7417222{\text{Log}}_{10} T_{{\text{k}}} )}}$$
(7)

The concentration of S2− (\(c_{{{\text{S}}^{{{2} - }} }}\)) can be calculated by Eq. (8):

$$K_{{{\text{bs}}}} = \frac{{c_{{{\text{S}}^{{{2} - }} }} c_{{{\text{H}}^{ + } }} }}{{c_{{{\text{HS}}^{ - } }} }}$$
(8)

where \(K_{{{\text{bs}}}}\) is the dissociation constant of HS and can be calculated as Eq. (9) [29]:

$$K_{{{\text{bs}}}} = 10^{{( - 29.3868 - 0.030446T_{{\text{k}}} - 2.4831 \times 10^{ - 5} T_{{\text{k}}}^{2} )}}$$
(9)

The electrolyte (H2S-containing solution) is under the condition of electroneutrality, therefore, there is another equation, i.e., electroneutrality equation:

$$c_{{{\text{Na}}^{ + } }} + c_{{{\text{H}}^{ + } }} = c_{{{\text{Cl}}^{ - } }} + c_{{{\text{HS}}^{ - } }} + 2c_{{{\text{S}}^{{{2} - }} }} + c_{{{\text{OH}}^{ - } }}$$
(10)

In this work, the H2S concentration in the gas atmosphere during the experiment is maintained constantly, therefore, it can be considered that the partial pressure of H2S is constant. In this case, the concentrations of the species (H2S(aq), HS, S2−, H+ and OH) in the electrolyte can be therefore quantified by simultaneously solving Eqs. (2), (6), (8) and (10).

Figure 7 shows the species concentrations as a function of pH at 1000 ppmv H2S and 20 °C. It can be known that the concentration of H2S(aq) in the electrolyte layer is pH-independent since it is only determined by the H2S concentration in the gas atmosphere (H2S partial pressure). However, the concentrations of HS and S2− strongly depend on the pH, the higher pH demonstrates higher concentrations of HS and S2−. On the one hand, the presence of HS and S2− will increase the electrolyte conductivity which mainly determines the mechanism of ECM of tin [15]. On the other hand, the precipitates formation will be greatly affected during the ECM process since most of tin sulfides have a poor solubility.

Fig. 7
figure 7

Equilibrium concentrations of species as a function of pH in 0.1 mM NaCl at 1000 ppmv H2S and 20 °C

4.2 Reactions involved in the ECM of tin in the presence of H2S

The species in the electrolyte layer used for ECM test are as follows: Na+, H+, Cl, HS, S2−, OH, H2S, O2 and H2O. Once a polarization potential (1.5 V vs. OCP or − 1.5 V vs. OCP in this work) is applied on the tin electrode, the main reactions includes as follows:

Cathodic reactions:

$${\text{O}}_{{2}} + {\text{ 2H}}_{{2}} {\text{O }} + {\text{ 4e}}^{ - } \to {\text{ 4OH}}^{ - }$$
(11)
$${\text{2H}}^{ + } + {\text{ 2e}}^{ - } \to {\text{ H}}_{{2}}$$
(12)
$${\text{2H}}_{{2}} {\text{O }} + {\text{ 2e}}^{ - } \to {\text{ H}}_{{2}} + {\text{ 2OH}}^{ - }$$
(13)

Anodic reactions:

$${\text{Sn }} \to {\text{ Sn}}^{{{2} + }} + {\text{2e}}^{ - }$$
(14)
$${\text{Sn}}^{{{2} + }} \to {\text{ Sn}}^{{{4} + }} + {\text{2e}}^{ - }$$
(15)
$${\text{2H}}_{{2}} {\text{O }} \to {\text{ 4H}}^{ + } + {\text{ O}}_{{2}} + {\text{ 4e}}^{ - }$$
(16)
$${\text{2Cl}}^{ - } \to {\text{ Cl}}_{{2}} + {\text{2e}}^{ - }$$
(17)

It is obvious that the cations and anions will migrate under the electric field. That is, cations including Sn2+, Sn4+, H+, and Na+ will migrate toward the cathode, while anions including HS, S2−, Cl and OH will migrate toward the anode. As a result, the precipitates and/or dendrites will be formed, as shown in Fig. 2. It should be pointed out that once HS meets with OH, S2− could easily be formed.

In the presence of H2S, the precipitates consist of tin hydroxides and tin sulfides. Tin hydroxides could be formed mainly based on two types of possible reactions [13]. Firstly, precipitates Sn(OH)4 and Sn(OH)2 will be produced once OH meets with Sn4+ and Sn2+ during the migration processes, respectively. This can be attributed to the extremely low solubility product constants: Ksp (Sn(OH)4) = 10–56 and Ksp (Sn(OH)2) = 1.4 × 10–28 at 298.15 K [30, 31]. Secondly, the hydrolysis of Sn4+ as described in Eq. (18) and direct oxidation of tin to Sn(OH)4 as described in Eq. (9), could also generate some amount precipitates [3]:

$${\text{Sn}}^{{{4} + }} + {\text{ 4H}}_{{2}} {\text{O }} \to {\text{ Sn}}\left( {{\text{OH}}} \right)_{{4}} + {\text{ 4H}}^{ + }$$
(18)
$${\text{Sn }} + {\text{ 4H}}_{{2}} {\text{O }} \to {\text{ Sn}}\left( {{\text{OH}}} \right)_{{4}} + {\text{ 4H}}^{ + } + {\text{ 4e}}^{ - }$$
(19)

It can be observed from Fig. 2e, f that some yellow precipitates are present. Apparently, this precipitate is related to the tin sulfides. According to the report from Burton et al., SnS2 is yellow in color [32]. Liao et al. also proposed that SnS2 could be formed during the ECM of tin in the S2−-containing solution through the following reaction [33]:

$${\text{Sn}}^{{{4} + }} + {\text{ S}}^{{{2} - }} \to {\text{ SnS}}_{{2}}$$
(20)

in which Sn4+ is formed in the anodic reactions. The solubility product constant of SnS2 is as low as 6 × 10–57 [34], indicating that the formation of SnS2 is extremly easy.

While in this work, small amount of S2− is from the dissociation of HS (see Fig. 7), and large amount of them should derive from the recation between HS and OH during the migration process. It should be pointed out that other componds such as SnS (dark gray in color, with a solubility product constant of 10–26 [34]) or S element could also be formed during the ECM test; however, it may not be observed or distinguished using the optical microscope in this work.

Based on our previous work [14, 15], the dendrites growth (Fig. 2a–d) could mainly be attributed to the direct reduction of Sn4+ and S2−, as described by Eqs. (21) and (22):

$${\text{Sn}}^{{{4} + }} + {\text{ 4e}}^{ - } \to {\text{ Sn}}$$
(21)
$${\text{Sn}}^{{{2} + }} + {\text{ 2e}}^{ - } \to {\text{ Sn}}$$
(22)

4.3 Effect of H2S concentration on ECM of tin

According to the results of water chemistry calculation in the presence of H2S (Fig. 7), it can be known that the concentrations of the charged species (i.e., cations and anions) in the electrolyte increase with increasing H2S concentration, resulting in the increase in conductivity of electrolyte. To further confirm this, the ionic strength (I) of the electrolyte as a function of H2S concentration at pH 6.90 and 20 °C was calculated by Eq. (23):

$$I{ = }\frac{1}{2}{(}c_{{{\text{Na}}^{ + } }} + c_{{{\text{H}}^{ + } }} + c_{{{\text{Cl}}^{ - } }} + c_{{{\text{HS}}^{ - } }} { + }c_{{{\text{OH}}^{ - } }} + 4c_{{{\text{S}}^{{{2} - }} }} {)}$$
(23)

The results are shown in Fig. 8. It clearly shows that ionic strength increases with the increasing H2S concentration, hence increases the conductivity of electrolyte.

Fig. 8
figure 8

Ionic strength of the H2S-containing electrolyte as a function of H2S concentration at pH 6.90 and 20 °C

From the electrochemistry point of view, higher the conductivity means faster reaction rate if the other conditions are the same. This is why the time to short circuit decreases with increasing H2S concentration from 0 to 1000 ppmv (Fig. 4). In this concentration range, the dendrites co-exist with precipitates. It demonstrates that Sn4+/Sn2+ formed during the anodic dissolution could easily arrive at cathode where they can be reduced to metal tin. Generally speaking, the thin electrolyte layer will generate a high-solution resistance which will result in uneven distribution of electric field on the electrode surface [35]. The uneven distribution current and potential could cause the preferential nucleation at some locations on the side of cathode, hence the dendrite growth, as is shown in Fig. 2a–d. It is considred that the dendrites growth rate is determined by the electric and concentration fields around the tip of dendrite [2, 36,37,38,39]. As soon as the dendrite grwoth initiates at some locations, the distance between the tip of dendrite and the edge of anode is reduced. Therefore, a stronger electric field at the dendrite tip can be generated, making subsequent deposition of metal ions at the dendrite tip [40]. Higher H2S concentration leads to higher conductivity, resulting in higher electrochemical reaction rates including anodic dissolution and cathodic reduction rates. Consequently, the dendrites growth rate increases with increasing H2S concentration from 0 to 1000 ppmv.

However, why is there no dendrite growth when the H2S increases up to 10,000 ppmv or 100,000 ppmv (Fig. 2)? This is because of the presence of precipitates which hinder the arrival of Sn2+/Sn4+ to cathode [15, 33]. As mentioned above, Sn2+/Sn4+ migrates from anode to cathode direction, at the same time, OH, S2−, and HS migrate toward the anodic direction. As soon as Sn2+/Sn4+ meets with OH or S2− or HS during the migration, the precipitates including tin hydroxides and tin sulfides will be formed. This means that the precipitates formation step is prior to the dendrites growth step. At these H2S concentrations, large amount of precipitates could be produced quickly because of large amount of Sn2+/Sn4+, OH, S2−, and HS could be formed at the very beginning of the ECM test, as is shown in Fig. 2e, f. These precipitates will hinder the further migration process of ions. The direct evidence is that the current for 10,000 ppmv H2S or 100,000 ppmv H2S decreases sharply at the very beginning of ECM test (Fig. 3).

In the previous work, at high ions concentration, it was found that the precipitates acted as a wall-like barrier which hinders the further migration of ions; therefore, no dendrites were observed, but only precipitates could be found [14, 15, 33]. These findings are in good agreement with our results in this work. As the increase in H2S concentration from 10,000 to 100,000 ppmv, the amount of yellow precipitates (mainly SnS2) increases remarkably (Fig. 2). This can be ascribed to that amount of Sn2+/Sn4+, S2− and HS at 100,000 ppmv is much more than that at 10,000 ppmv.

In summary, the ECM behaviors of tin in the presence of H2S are determined by the electrolyte conductivity which alters at different H2S concentrations. From 0 to 1000 ppmv H2S dendrites co-exist with precipitates, and the time to short circuit decreases with increasing H2S concentration. While from 10,000 to 100,000 ppmv H2S, no dendrites growth can be observed, but large amount of precipitates which acted as barrier to hinder the further migration of ions.

4.4 Effect of electric field in the presence of H2S

Electronics may work under different electric fields including the steady electric field and unsteady electric field in the presence of H2S, therefore, it is necessary to discuss about the ECM behaviors in different electric fields. In this work, DC electric field and square wave electric field were employed.

As mentioned in the Sect. 3, huge differences in ECM behaviors of tin at 100 ppmv H2S between DC electric field and square wave electric field can be observed. That is, for DC electric field, dendrites growth together with precipitates can be seen; however, only some precipitates are present under square wave electric field, even after 1200 s, as is shown in Fig. 5. Under DC electric field with a polarization potential 1.5 V vs. OCP, the time to short circuit is around 58 s (Fig. 4). While no short circuit occurs under square wave electric field with a time period of 1 s and polarization potential ± 1.5 V vs. OCP. As discussed above, at 100 ppmv H2S, the amount of precipitates is too small to hinder the migration process of ions. Therefore, dendrites co-exist with precipitates under DC electric field.

Under square wave electric field, there is a switch between cathodic reduction and anodic dissolution in one period for each electrode. For example, from 0 to 0.5 s, a cathodic polarization is applied on the counter electrode, but from 0.5 to 1 s an anodic polarization is applied there. In this case, even if Sn2+/Sn4+ successfully arrives at counter electrode and some of them are reduced to metal tin during the first 0.5 s, it would be dissolved quickly during the following 0.5 s since a strong anodic polarization is applied on the counter electrode. Therefore, the short circuit phenomenon could not be observed, unless the time to short is shorter than 0.5 s. According to our previous work, it was found that whether the short circuit occurs or not under the bipolar square waver electric field depends on the length of semi-cycle.2 If the semi-cycle is longer than the time to short circuit required, the short circuit can be surely observed. The average time to short circuit under DC electric field at 100 ppmv is around 58 s (Fig. 4); therefore, it may be expected that the short circuit will occur once the semi-cycle is longer than 58 s under square wave electric field.

During the migration of ions, the precipitates including tin hydroxides and tin sulfides could be formed once Sn2+/Sn4+ meets with OH or S2− or HS. The switch between cathodic polarization and anodic polarization does not affect the formed precipitates. This can explain why only some precipitates can be observed under square wave electric field with a time period of 1 s.

Therefore, it can be concluded that the ECM of tin under square wave electric field can still occur, but short circuit may not happen. Whether the short circuit occurs or not depends on the length of the semi-cycle of the square wave electric field.

5 Conclusions

The ECM of tin in the presence of H2S under DC electric field and square wave electric field is in situ studied using optical and electrochemical techniques, the main conclusions have been drown as follows:

  1. (1)

    From 0 to 1000 ppmv H2S, dendrites co-exist with precipitates, demonstrating Sn2+/Sn4+ could successfully arrive at cathode where they can be reduced to dendrites. Furthermore, the time to short circuit decreases with increasing H2S concentration. This can be attributed to the increase in electrolyte conductivity due to more ionic species such as HS and S2− can be formed at higher H2S concentration. Higher conductivity of electrolyte means higher electrochemical reaction rate, resulting in higher growth rate of dendrites.

  2. (2)

    As the H2S concentration increases up to 10,000 ppmv or 100,000 ppmv, there is no dendrites growth, but only large amount of precipitates. At this concentration range, large amount of precipitates can be quickly produced at the very beginning of the ECM test due to large amount of Sn2+/Sn4+, OH, HS, and S2− are present, which could hinder the further migration of ions. Therefore, only precipitates but no dendrites growth can be observed.

  3. (3)

    At 100 ppmv H2S, no dendrites but some precipitates can be observed under the square wave electric field with a time period of 1 s. This is because there is a circulation between metal tin deposit during the first 0.5 s and its dissolution in the next 0.5 s. Therefore, the occurrence of the short circuit is semi-cycle dependent.