1. Introduction

Cu2ZnSnS4 (CZTS) is among the most promising thin films for photovoltaic device applications because of its high absorption coefficient and low optical band gap (1.45–1.65 eV).1,2,3 The maximum measured efficiency of a CZTS solar cell is 12.7%, which is less than the theoretical Shockley–Queisser limit (32.4%) and the efficiency of a Cu(In, Ga)Se2 solar cell (22.8%).4 The main challenge of CZTS solar cells is the open-circuit voltage deficit, defined as (Eg/q – VOC), where Eg, q, and VOC are the absorber band gap, electron charge, and open-circuit voltage, respectively.5,6,7 The copper–zinc (CuZn) antisite defect is a main contributor to open-circuit voltage insufficiency induced by electrostatic potential fluctuations.8,9 Owing to their affinity for Cu and Zn cation sizes, antisite defects are simple to create. They are predicted to limit solar cell performance and have greatly reduced the initial rapid advancement of CZTS alloys. Several theories have suggested why this is a significant band-tail effect. One of the most common reasons for the suboptimal quality of the CZTS absorber layer is the non-ideal interface and the development of secondary phases between magnesium sulfide (MgS) and CZTS.

Recent research has suggested that substituting other elements for Cu or Zn could help reduce these problems. However, the most popular alternatives, silver (Ag) and cadmium, are either scarce or poisonous, thus negating the usefulness of CZTS. Other transition metal options (e.g., iron, manganese (Mn), nickel, and cobalt) are multivalent, resulting in dangerous deep-level flaws.10,11 Mg is a prospective candidate that avoids these issues due to its abundance, innocuous nature, and stability in the + 2-oxidation state. Mg has secondary phases based on Zn, such as zinc selenide (ZnSe) and ZnS, that reduce photovoltaic performance.12 Furthermore, Mg is naturally more abundant in the Earth’s crust than Zn.13,14

The substitution of Zn with Mg is preferred over other elements when tuning the band gap of CZTS. Because the ionic radii of Mg and Zn are comparable, Mg2+ may occupy the Zn2+ sites in the CZTS lattice rather than segregate at the grain boundaries and the CZTS layer surface. Moreover, the addition of Mg to the CZTS absorber layer provides specific advantages in terms of cost, reserve availability, and environmental friendliness. Finally, the presence of ZnS throughout the precursor solution synthesis of CZTS may eliminate or reduce certain impurity phases. In solution, the ZnS binary phase occurs in a stable form, whereas the MgS binary phase is unstable. Therefore, substituting in Mg for Zn is a cost-effective method for adjusting the CZTS band gap.15

Recently, Wang et al. investigated the effect of substituting Zn with varied Mg doping ratios on the characteristics of Cu2MgxZn1-xSn(S,Se)4 quaternary alloy deposited using the spin-coating method with the thickness ranging from 1.78 μm to 1.80 μm.16 The researchers concluded that the Mg content had no influence on the crystallization of the synthesized films, and that increasing the Mg content increased the energy gap and improved the electrical characteristics. Romero et al. investigated the partial and total substitution effects of Mg-substituted Zn on the structural and optical properties of the Cu2Zn1-xMgxSnS4 quaternary semiconductor alloy deposited using the hot injection method.17 Their structural analysis revealed the presence of secondary phases and no significant variation in the interplanar distances with increasing Mg concentration. The average size of the crystalline domains decreased at high Mg incorporation ratios, whereas the energy gap increased.

This study aims to synthesize Cu2Zn1-xMgxSnS4 thin films with various Mg contents using a low-cost and environmentally friendly co-precipitation method. The crystal structure and electro-optic performance of the Cu2(Zn1-xMgx)SnS4 films have been investigated. In addition, using current–voltage (I–V) characterization, we enhanced the electrical properties of Ag/Cu2(Zn1-xMgx)SnS4/Ag/n-Si films with varying Mg wt.% content for photosensitivity applications.

2. Experimental

2.1 Synthesis of Deposition Solutions

A low-cost and environmentally friendly co-precipitation method was used to synthesize the CZTS nanostructure alloy. Copper (II) chloride dihydrate (0.6 M), zinc acetate (0.8 M), tin (II) chloride dihydrate (0.8 M), and thiourea (0.8 M) were dissolved individually in 10 ml of distilled (DI) water using a magnetic stirrer to prepare quaternary alloy precursor solutions. The prepared solutions were mixed in a 300-ml Pyrex beaker and stirred for 30 min at 70°C. At room temperature (30°C), droplets of sodium hydroxide were added to the solution mixture to maintain the pH at 12 and stirred until a gel was formed. The Cu2(Zn1-xMgx)SnS4 alloy was synthesized by repeating the previous steps and adding 0.8 M magnesium chloride hexahydrate using stoichiometric ratios of each component, where x = 0 wt.%, 0.3 wt.%, 0.5 wt.%, 0.7wt.%, and 1 wt.%. The generated gel was washed with DI water and acetone to eliminate the sodium chloride and other traces found in the precipitate. A centrifugal separator was used to settle the precipitate, which was then filtered multiple times. Subsequently, the samples were dried for 40 h at 30°C before being annealed for 5 h at 800°C. All the chemicals and solvents were purchased from Sigma Aldrich (USA; 99.95%). The obtained powders were deposited on n-type silicon substrates using a sol–gel method, as reported by Ibraheam et al., 18 with a thickness of approximately 425 nm. Finally, Ag metal contacts were deposited on the thin-film samples using vacuum thermal evaporation (PVD-HANDY/2STE; USA) at 6 × 10–6 kPa. Zigzag-shaped contacts with a length of 5 mm and a thickness of 115 mm were employed to provide a surface contact area of approximately 3.14 × 102 cm2, as illustrated in Fig. 1.

Fig. 1
figure 1

Scheme of the p–n junction layer.

2.2 Analysis and Characterization

An x-ray diffractometer (XRD; Phillips, USA), with Cu Kα radiation with a wavelength of 1.54 Å, was used to investigate the structural properties of the Cu2(Zn1-xMgx)SnS4 quaternary alloy. Photoluminescence (PL) spectroscopy (Jobin Yvon, USA) was used to analyze the quality of the developed films and determine the role of defects in the quaternary alloy. The surface morphologies of the prepared films were examined using field-emission scanning electron microscopy (FE-SEM; NOVA NANO SEM, USA). The source meter (Keithley 2400, USA) was coupled in parallel to the fabricated device for the I–V characterization, and it measured between −6 and 6 V. For current–time (I–t) analysis, the sample and multimeter were connected in series, and the current was measured by turning the LED on and off (415 nm wavelength, and 1640 mW output power).

3. Results and Discussion

The XRD patterns of the Cu2(Zn1–xMgx)SnS4 films synthesized with various Mg wt.% (x) are illustrated in Fig. 2. At x = 0, the CZTS film exhibited the diffraction peaks (002), (101), and (200), assigned to the tetragonal kesterite phase (ICDD 01–075-4122), and (004), assigned to the stannite CuMnSnS4 phase (at Mg = 1 wt.%) (ICDD 00–029-0537).19 Additionally, the XRD profiles of the quaternary Cu2(Zn1-xMgx)SnS4 nanostructure alloy showed no peaks belonging to other secondary phases, including those of MgS, ZnS, Cu2S, and SnS, indicating that Mg was doped into the CZTS host lattice. The intensity of the (101) diffraction peak increased as the Mg content increased, demonstrating that the crystallinity of the quaternary alloy was enhanced. It would be interesting to investigate the degree of crystallinity (CD) achieved with respect to the relevant structural parameters and to reveal the effect of Mg content on the obtained results. The CD can be estimated using Eq. 1, which is the ratio of the integrated area of the crystalline peaks (Ac) to the total integrated area (Aa) under the XRD peaks.20 The CD as a function of the Mg content is displayed in Table I, based on the XRD measurements. One possible explanation for this finding is that the Mg content played an active role as a nucleation component in crystal growth.

$$ C_{D} = \frac{{A_{c} }}{{A_{c} + A_{a} }} \times 100\% $$
(1)
Fig. 2
figure 2

XRD patterns of the Cu2(Zn1-xMgx)SnS4 films synthesized with various Mg wt.% (x).

Table I Crystallinity of the Cu2(Zn1-xMgx)SnS4 alloy with various Mg wt.% content

The crystalline size (D) of the films was determined using Eq. 2 for the (101) peak using the Debye–Scherrer formula.21 The D of the deposited films increased from 31.65 to 53.73 nm when the Mg wt.% increased from 0 to 1 wt.%, as reported in Table II. With increasing Mg wt.%, the decrease in the full width at half maximum (FWHM) resulted in a narrower dominant peak with higher intensities, indicating improved crystalline growth followed by an increase in D.22 Hence, it can be concluded that the Mg content influences the crystallization size of CZTS.

$$ D = \frac{ k\lambda }{{\beta {\text{cos}}\theta }}, $$
(2)

where \(\lambda\) is the wavelength of the CuKα line, \(\beta\) is the FWHM of the characteristic peak, and \(\theta\) is the Bragg angle. The lattice parameters (a and c) of the (101) diffraction peak were calculated using23:

$$ \frac{1}{{d^{2} }} = \frac{{h^{2} + k^{2} }}{{a^{2} }} + \frac{{l^{2} }}{{c^{2} }} $$
(3)
Table II Structural parameters of Cu2(Zn1-xMgx)SnS4 nanostructured thin film with various Mg wt.%

As shown in Table II, when the Mg content increased, the (101) diffraction peak shifted to a lower diffraction angle, reflecting an increase in the lattice parameters of the Cu2(Zn1-xMgx)SnS4 films. The increase in the lattice parameters is attributed to the fact that the covalent radius of an Mg ion (1.36 Å) is larger than that of a Zn ion (1.25 Å). Consequently, this shows that the phase structure of the quaternary alloy did not change because the Zn ion sites were occupied by Mg in the host lattice of the quaternary alloy.9,15,24 Furthermore, the substitution of Mg for other metals in the crystal lattice of the Cu2(Zn1-xMgx)SnS4 alloy can also be explained using theoretical calculations of the local substitution energies of Mg with Cu, tin (Sn), and Zn. Because Mg–Zn has a lower substitution energy than Mg–Cu2 and Mg–Sn2, the Mg atoms substitute for the Zn atomic site, and this substitution does not affect the conduction type because Mg and Zn are isovalent.17,25

The quaternary Cu2(Zn1–xMgx)SnS4 nanostructured alloy was elementally analyzed at different Mg contents using energy dispersive x-ray spectroscopy (EDX), and Fig. 3a–c. shows their compositions. The presence of Cu, Zn, Mg, Sn, and sulfide was confirmed by EDX. Table III summarizes the atomic content of the prepared samples; as the Zn atomic content decreased, the Mg atomic content gradually increased, demonstrating that Mg was incorporated into the Cu2(Zn1-xMgx)SnS4 lattice, substituting Zn.26 This result matches the findings that Mg replaces the Zn site based on the XRD analysis result.

Fig. 3
figure 3

EDX analysis of synthesized Cu2(Zn1-xMgx)SnS4 quaternary alloy: (a) Mg wt.% = 0, (b) Mg wt.% = 0.7, and (c) Mg wt.% = 1.

Table III EDX composition analysis of Cu2(Zn1-xMgx)SnS4 quaternary alloy nanostructured thin films

FE-SEM images of the prepared Cu2(Zn1-xMgx)SnS4 quaternary films with various Mg wt.% are shown in Fig. 4b–d. When the Mg content reached the maximum value (1 wt.%), the surface morphology changed from granular to whiskers, resulting in more densely packed nanostructures of less porosity. The structural quality of the Cu2(Zn1-xMgx)SnS4 film morphology significantly improved, displaying the largest grain size with a dense and crack-free surface (Fig. 4e). The average grain size of the Cu2(Zn1-xMgx)SnS4 films (Fig. 4f.) was estimated using ImageJ software. The absorber layer grain size influences the performance of photovoltaic devices; therefore, so larger grains are required to fabricate high solar cell efficiency.9,19

Fig. 4
figure 4

FE-SEM images of Cu2(Zn1-xMgx)SnS4 quaternary films with various Mg wt. % content (a-e) and (f) the average grain size versus Mg wt.%.

PL spectra with varying Mg content at room temperature are shown in Fig. 5. The emission peak positions shifted to higher wavelengths with increased peak intensity when the Mg content increased. Because the PL intensity is proportional to the number of photons released, the increased peak intensity indicates that more photons were released with increasing Mg content. The PL peak shifting can be explained by substituting the Zn atom with Mg, resulting in a decreased energy gap.23 The shift in the position of the PL peaks can be explained by substituting the Zn atom with Mg, leading to an increase in the grain size and a subsequent reduction in the energy gap (\(E_{g} )\). The energy gap of the Cu2(Zn1-xMgx)SnS4 samples with various Mg contents are listed in Table IV. The energy gap is calculated using:

$$ E_{g} = \frac{1240 }{\lambda } $$
(4)

where \(\lambda\) is the wavelength in nm.

Fig. 5
figure 5

PL spectra of Cu2(Zn1-xMgx)SnS4 thin films with varying Mg wt.% (x) content.

Table IV Energy gap as a function of the Mg wt.% content

The I–V characteristics of the CZTS and Cu2(Zn1-xMgx)SnS4 thin films under LED illumination (ILight) and in the dark (IDark) are shown in Fig. 6a–c. Figure 6 depicts the Ohmic behavior for the photocurrent, revealing an increase in photocurrent with an increase in applied voltage, as shown in Table V. The ILight linear increase can be explained by an increase in forwarding bias voltage, which causes oxygen vacancies to move closer to the interface and increase the current.27 Additionally, the increase in ILight can be linked to the increase in the number of released photons induced by the Mg added content, as confirmed by the PL spectrum. In contrast, IDark decreased as Mg content increased. The decrease in IDark may be due to the enhanced crystalline characteristics, which reduce surface structural flaws, confirming the XRD findings and improving electrical attributes.9,28

Fig. 6
figure 6

I–V characteristics of (a) CZTS, (b) Cu2(Zn1-xMgx)SnS4 with Mg wt. % = 0.7, and (c) Cu2(Zn1-xMgx)SnS4 with Mg wt. % = 1. The samples were examined at 6 V bias under 490 nm LED light and in the dark.

Table V I–V characteristics of the CZTS and Cu2(Zn1-XMgx)SnS4 thin films: (a) Mg wt. % = 0, (b) Mg wt. % = 0.7, ©) Mg wt. % = 1

The photosensitivity (PhS%) of the tested samples was calculated at 6 V bias using Eq. 5 for the I–V characteristics,29 and the ILight, IDark, and PhS% results are included in Table VI. PhS% increased from 1888.24 to 5309.64% when the Mg contents increased to 0.7 wt.%, achieving maximum PhS% and supporting an improvement in absorber layer quality, whereas it decreased to 3520.25% when the Mg contents reached 1. The decrease in PhS% at 1 wt.% Mg may be attributed to an overall improvement in photovoltaic performance at 0.7 wt.% Mg content, which results in a reduction in ILight, IDark, and PhS% at content larger than 0.7 wt.%:9,28

$$ Ph_{S} = \frac{{I_{{{\text{Light}}}} - I_{{{\text{Dark}}}} }}{{I_{{{\text{Dark}}}} }} \times 100\% $$
(5)
Table VI ILight, IDark, ILight-IDark, and PhS% results of Cu2(Zn1-xMgx)SnS4 alloy with different Mg wt.%

The developed Cu2(Zn1-xMgx)SnS4 films were tested to demonstrate their photocurrent responsivity (PhR%) and reproducibility by periodically turning the LED light on and off using Eq. (6).18 Figure 7 displays the PhR% of the nanostructured quaternary alloy Cu2(Zn1-xMgx)SnS4 as a function of time intervals (I–t) for Mg contents of 0, 0.7, and 1 wt.%. A sharp increase in the photocurrent was observed until it reaches a maximum (Lon) when the LED light was turned on and then decreased to a minimum (Loff) when the light is turned off. Table VII shows the response time (Rest), decay time (Dect), and PhR% results:

$$ Ph_{R} = \frac{{L_{{{\text{on}}}} - L_{{{\text{off}}}} }}{{L_{{{\text{on}}}} }} \times 100\% $$
(6)
Fig. 7
figure 7

Photocurrent responsivity of the Cu2Zn1−xMgxSnS4 alloy under 490 nm LED light with various Mg wt.% (x) content.

Table VII Response time, decay time, and photocurrent responsivity of Cu2(Zn1-xMgx)SnS4 alloy with different Mg wt.%.

The PhR% findings revealed increased sensitivity when the Mg content was introduced. The sample with Mg content of 0.7 wt.% achieved the highest sensitivity (2319%) with a faster response/recovery time of approximately 0.9152 s/0.3021 s, as reported in Table VII.

4. Conclusions

Nanostructured Cu2(Zn1-xMgx)SnS4 quaternary alloy was successfully deposited on a silicon substrate using an environmentally friendly method. The current study showed that the Mg content improved the structural, morphological, and electrical properties of the deposited quaternary alloy thin film. Structural analysis of the Cu2(Zn1-xMgx)SnS4 films indicated that the Mg concentration affected D and improved the electrical characteristics. Furthermore, as the Mg content increased, the morphology significantly improved, resulting in a larger particle size. Finally, the Mg content of the Cu2(Zn1-xMgx)SnS4 alloy improved the ultraviolet light-absorbing layer. In general, the Mg content enhanced the sensitivity of the CZTS quaternary alloy to ultraviolet light, and the sample containing 0.7 wt.% Mg attained around 31% higher PhR% than the as-deposited CZTS quaternary alloy, indicating that the developed quaternary alloys are adequate for ultraviolet light detection.