1 Introduction

In present scenario, Cadmium (Cd) based semiconductors (like CdTe, CdSe and CdS) are getting tremendous attention owing to their potential applications as different constituent layers in cost effective second generation solar cell devices [1,2,3]. Among these Cadmium chalcogenides, cadmium selenide (CdSe) thin films could be used as an alternative absorber layer to the prevalent CdTe material due to its cost effectiveness and expected power conversion efficiency. The CdSe is a fascinating absorber layer material due to exceptional traits viz. tailored crystal structures, unique morphology, compatibility of direct band gap (1.74 eV), higher absorption coefficient (105 cm−1), photosensitivity, electrical conductivity etc. [4,5,6,7]. The CdSe shows both the n- and p-type conductivities depending upon nature of vacancies formed during growth and post activation treatments and could provide great potential to fabricate Si-based tandems too by implicating its associated sub-cell as one constituent block [3, 6]. The CdSe thin films could be developed using numerous existing deposition techniques such as vacuum evaporation, molecular beam epitaxy, electro-deposition, chemical bath deposition, magnetron sputtering, electron beam (e-beam) evaporation and spray pyrolysis etc. [7, 8] wherein resistive heating based thermal evaporation is more appropriate due to cost effectiveness, simplicity, controlled deposition rate with effective use of source materials as well as formation of homogenous and stoichiometric films [9, 10]. Typically, CdSe is found in three crystalline structures including wurtzite (hexagonal), zinc blende (cubic) and mixture of both. Generally, pristine CdSe thin films comprise various native defects mainly, grain boundaries (GBs) which behave like recombination centers and trap states for the charge carriers and also act as barriers in their flow depending upon orientation of the GBs [11, 12]. The grain boundary model could be used to elaborate the charge carrier transportation and electrical conduction in polycrystalline material based devices. This model explains the flow of majority and minority charge carriers aligned normal or parallel to the GBs. The conventional chloride treatment performed employing CdCl2 could passivate these GBs, maximize carrier collection, decline structural defects, induce recrystallization which considerably enhance quality of Cd-based thin films and performance of the associated devices. During treatment, Chlorine atoms are accumulated at GBs which assisted in their inversion, support grain growth and recrystallization together with appropriate phase transformation [1,2,3, 6]. The CdCl2 treatment on thermally evaporated CdSe absorber layers revealed upgradation in crystallinity, optical absorbance, refractive index, electrical conductivity, surface roughness together with grain growth, phase transition (from cubic phase to thermally stable hexagonal phase) and variation in optical energy band gap with annealing [11]. The post deposition CdI2 activation on CdSe films demonstrated grain growth, improvement in crystallinity, electrical conductivity, decrement in electrical resistivity and altered the optical and surface topographical properties [12]. The post deposition CdCl2 treatment to the CdSe thin films significantly enhanced the grain growth, mobility of electrons and reduced the Urbach energies and mid-gap states for valence band tail states where post deposition selenizaton also enhanced both the light-to-dark conductivity and photoconductivity as a function of selenization time [1]. Recently, the effect of selenization on the electronic properties of CdTe affected with GBs has been modeled in a bilayer CdSexTe1-x/CdTe device using high resolution cathode-luminescence imaging by a scanning transmission electron microscope (STEM-CL) where incorporation of Selenium reduced adverse non-radiative recombination at GBs in Cd(Se,Te) layers, which led to superior carrier lifetime and performance of Selenium graded CdTe solar cells [13]. Selenium passivated the detrimental defects in the bulk CdTe, which led to enhancement in carrier lifetime and other performance parameters of the CdSeTe/CdTe thin film photovoltaic devices [14,15,16]. Although CdCl2 treatment provides promising results yet its highly toxic and carcinogenic chemical nature, requires strong safety procedures for usage and disposal which make CdCl2 treatment expensive process and therefore, alternative activation agents need to be investigated for long term deployment [17]. Environmental friendly and cost effective Magnesium halides such as MgF2, MgCl2 and MgI2 could be potential choice as Magnesium (Mg) belongs to same space group (P63/mmc) as that of Cadmium (Cd) [18]. Recrystallization, cubic to hexagonal phase transformation, grain growth, variation in surface roughness, improved homogeneity and diminution in optical energy band gap in e-beam evaporated CdSe films are observed after MgCl2 treatment [3]. As an alternative to CdCl2, the MgF2 was also performed over CdSe and CdS thin films to optimize these for absorber and window layer applications, respectively [19, 20]. The resistive heating thermally evaporated CdSe thin films were activated using non-toxic and environmental friendly MgI2 compound which revealed to grain growth, phase transition, enhancement in the intensity of photoluminescence peaks and alteration in optical and surface topographical properties with treatment temperature [21]. An impact of halide (F, Cl, I) ion size on recrystallization, grain growth, GBs inversion and the physical characteristics of CdSe thin films is reported earlier using different halide composites viz. CdCl2, CdI2, MgF2, MgCl2 and MgI2 [22]. For post-deposition activation treatment, the carcinogenic and expensive CdCl2 compound could be simply substituted directly with MgCl2 which leads to minimize the environmental hazard and sinking the cost of the associated devices [23]. Major et al. [17] reported that post deposition activation to the CdTe/CdS hetero-junction with MgCl2 is also competitive to CdCl2 supported activation treatment. A proportional report of hetero-junction activation in the CdTe/CdS solar cells using CdCl2 and MgCl2 as the Chlorine sources is undertaken where the device performance parameters like open circuit voltage,   shot circuit current, fill factor and power conversion efficiency have been found comparable or slightly higher for MgCl2 activated devices [24]. Enhancement in optical absorbance, photovoltaic quality, morphological, structural and electrical properties of CdSe thin films could be obtained by post-deposition thermal annealing. The assimilation of dopant in CdSe host lattice could also modify the morphology and may lead to introduction of more active sites which are beneficial for photovoltaic, catalytical and electrochemical relevances [25, 26]. Post deposition doping of Zinc substantially improved the crystalline nature of CdSe thin films [27]. Nguyen et al. [28] reported that incorporation of Copper to the CdSe nanostructures enhanced the current density, charge carrier collection and reduced the recombination centers by raising the level of the conduction band. As per available literature so far, it is rare to find study on thermal evolution to the MgCl2 treated CdSe layers which are grown employing resistive heating based thermal evaporation technique . The CdSe thin films are typically employed in opto-electronic devices so far where the Magnesium chloride activation treatment could also be employed for grain growth. Hence in the present communication, an evolution on ex-situ MgCl2 wet activation treatment to crystallographical, electrical, optical, photoluminescence and surface topographical characteristics of CdSe thin films is meticulously undertaken within temperature range of 200–400 °C followed by optimizing the associated properties for absorber layer applications to thin film solar cells where prior undertaking the complete device package, individual optimization to the other layers also need to be carried out separately.

2 Experimental details

2.1 Deposition of CdSe thin films

The CdSe thin films are fabricated on pre-cleaned soda-lime glass and Indium doped Tin oxide (ITO; Sigma Aldrich) coated glass substrates using resistive heating based thermal evaporation system developed by Hind High Vacuum Company (model: SMART COAT 3.0). To avoid any residual impurity due to earlier deposition and to ensure formation of high purity and stochiometric films, the chamber of evaporator and substrate holder are also cleaned with isopropyl alcohol (IPA) and acetone. The CdSe powder with purity of 99.999% procured from Sigma Aldrich (source material) is kept in Molybdenum (Mo) boat and prepared substrates are stacked on pre-cleaned Alumina made substrate holder which is rotated continuously with constant speed in order to get homogeneous deposition. During thin films deposition, no temperature is applied to the substrate holder. The source material contained in Mo boat and the substrate holder are kept ~ 21 cm far away in order to minimize the associated radiant heating to the substrates. The CdSe films are fabricated under higher working vacuum of ~ 5 × 10–6 mbar which is obtained by rotary and diffusion pumps to get impurity free and homogenously deposited thin CdSe layers. The CdSe thin films are fabricated at a deposition rate of 5–6 Å/sec and attained thickness is 600 nm which are controlled by an in-built quartz crystal based digital thickness monitor (DTM-101). The as grown or pristine CdSe thin films are found in shiny black color and showing good sticking to the associated substrates. The as grown CdSe thin films are subjected to MgCl2 activation treatment.

2.2 Post deposition MgCl2 activation

As grown or pristine films are subjected to ex-situ wet chloride activation treatment where 0.2 molar MgCl2 solution is used for post activation treatment. For preparation of activation solution, the required amount of MgCl2 is dissolved in methanol (CH3OH) using magnetic stirrer followed by stirring for 20 min at 45 °C with 180 rpm. To perform activation treatment, the entire surface of pristine CdSe thin films is covered with activation solution employing ex-situ drop cast recipe by medical syringe [14,15,16], thereafter, activated films are dried out over night. After MgCl2 treatment, annealing is undertaken in air atmosphere at temperatures of 200 °C, 300 °C and 400 °C in Muffle furnace (SONAR) for 60 min. Annealed CdSe films are sanitized by hot de-ionized (DI) water for 15 min at 50 °C to confiscate the residuals of MgCl2 and desiccated. After cleaning, all the CdSe films are subjected to different characterization tools for investigation of associated physical properties.

2.3 Characterization of prepared films

To undertake structural properties, Rigaku Ultima-IV modeled X-ray diffractometer (XRD) was employed in 2θ range of 20–80° with 0.02 scan intervals whereas I-V characteristics are undertaken from -3.5 V to + 3.5 V by Agilent B2901A source-meter where CdSe thin films, deposited on ITO coated glass substrates are used to obtain electrical measurements. Surface topographical properties are obtained using atomic force microscope (SOLVER-Next, NT-MDT) where two dimensional (2D) and three dimensional (3D) AFM images are fashioned by scanning the CdSe thin films in semi-contact mode over the surface area of 8 μm × 8 μm and associated topographical parameters are computed by an open access Gwyddion software. Optical properties are investigated by measuring the absorbance and transmittance spectra employing  UV–Vis. spectrophotometer (Shimadzu, UV-1780). The PL analysis is accomplished within wavelength range 570–725 nm employing Perkin-Elmer FL 8500 spectrometer at excitation wavelength 450 nm in order to identify the associated emission bands.

3 Results and discussion

3.1 Structural analysis

The XRD patterns (as depicted in Fig. 1(a)) are used to explore crystallographic properties of pristine and MgCl2 activated CdSe thin films where pristine films showed mixture of hexagonal and cubic phases with (111)C preferred orientation. Additional diffraction peaks viz. (103)H, (203)H, (422)C and (200)C are also observed which confirmed polycrystalline nature of deposited CdSe films as per JCPDS files: 19–0191 and 77–2307 [11, 12, 22]. Herein, JCPDS files 19–0191 and 77–2307 are used for validation of cubic (C) and hexagonal (H) crystal phases, respectively. Post deposition MgCl2 activation treatment gradually reduces intensity of (111)C peak upto 300 °C vis-à-vis the pristine films and then leads to increase at higher annealing temperature. Such type of variation in intensity of (111)C reflection is also reported previously for MgF2 [20] and MgI2 [21] activated CdSe films whereas continuous diminution is reported for CdCl2 [11] and CdI2 [12] activated CdSe films. For 200 °C and 300 °C activated films, preferred (111)C orientation is altered to hexagonal (103) plane possibly due to change in atomic configuration since, more crystallites might grow along particular (103) plane [29]. The XRD patterns of CdSe thin films demonstrated that the (111)C diffraction peak became more intense at 400 °C which suggests an enhanced interaction between CdSe and MgCl2 layers which leads to explicit improvement in crystallinity [30, 31]. The reappearance of (111)C orientation is attributed to recrystallization, randomization and reorientation at elevated treatment temperature [22]. Similar to the CdSe-MgCl2 system, reappearance of (111)C diffraction is also reported in CdSe-MgI2 system at 300 °C annealing temperature. The incorporation of Mg2+ and Cl at respective Cd2+ and Se2− sites might be accountable for aforementioned changes [12, 22]. Such type of phase transition from (111) cubic to (103) hexagonal phase is also reported formerly where thermally grown CdSe films treated with CdI2, CdCl2, MgF2 and MgI2 are crystallized in both the cubic and hexagonal crystal phases and mentioned phase transformation is occurred at temperature of 300 °C, 400 °C, 200 °C and 200 °C, respectively [11, 12, 20, 21]. The solid state crystal phase transition from the cubic to the hexagonal phase is usually occurred via nucleation and growth process where the interface between two adjacent cubic CdSe crystallites might provide the appropriate sites for possible nucleation to the hexagonal phase [12]. On annealing the films at 300 °C, a new diffraction peak corresponding to (200)C plane is also observed which could be endorsed to MgCl2 activation induced reorientation and recrystallization procedures [11].

Fig. 1
figure 1

XRD patterns of prepared CdSe thin films

During activation treatment, different chemical reactions could occur in CdSe-MgCl2-O2 system and consequently, obtained glassy mixture CdSe-MgCl2-CdSeO3 (flux), shrinks melting point and endorses recrystallization and grain growth in CdSe absorber layer [22]. The significance of MgCl2 annealing treatment is that it offers an effective path to produce high-quality CdSe layers with lower defects and higher grain growth in view of environmental aspects [32]. Throughout MgCl2 activation treatment at higher annealing temperature, the MgCl2 sintering flux could be disintegrated into the Magnesium (Mg) and Chlorine gas (Cl2) where integration of Chlorine instigates the reorientation and subsequent recrystallization of CdSe grains and the agglomeration of smaller grains into larger grains is started according to the following chemical reactions (15) [22].

$${{\mathrm{MgCl}}_{2}}_{(\mathrm{S})}\stackrel{Thermal\, annealing}{\iff }{\mathrm{Mg}}_{(\mathrm{S})}+{{\mathrm{Cl}}_{2}}_{(\mathrm{g})}$$
(1)
$${\mathrm{CdSe}}_{(\mathrm{s})}+{\mathrm{Cl}}_{2(\mathrm{g})}\to {\mathrm{CdCl}}_{2(\mathrm{g})} +{\mathrm{SeCl}}_{2(\mathrm{g})}$$
(2)
$${\mathrm{CdCl}}_{2(\mathrm{g})} +{\mathrm{SeCl}}_{2(\mathrm{g})}\to {\mathrm{CdSe}}_{(\mathrm{s})}+{\mathrm{Cl}}_{2(\mathrm{g})}$$
(3)
$${\mathrm{CdSe}}_{(\mathrm{S})}+{{\mathrm{MgCl}}_{2}}_{(\mathrm{S})}+{{\mathrm{O}}_{2}}_{(\mathrm{g})}\to {\mathrm{CdO}}_{(\mathrm{S})}+{\mathrm{MgO}}_{\mathrm{s}}+{{\mathrm{CdCl}}_{2}}_{(\mathrm{S})}+{{\mathrm{SeCl}}_{2}}_{(\mathrm{g})}$$
(4)
$$2\mathrm{CdSe}+3{\mathrm{O}}_{2}\to {2\mathrm{CdSeO}}_{3}$$
(5)

A variety of crystallographic parameters viz. inter-planar spacing (d), lattice constant (a), crystallite size (D), internal strain (ε), dislocation density (δ), and number of crystallites per unit area (N) are calculated by employing the associated relations  [22, 33, 34] to strengthen the structural analysis and summarized in Table 1.

Table 1 Crystallographic parameters for prepared CdSe thin films

The inter-planar spacing (d) is estimated using Bragg’s Eq. (6):

$${d}_{hkl}=\frac{\lambda }{{2\mathrm{sin}\theta }_{hkl}}$$
(6)

Herein, θhkl is Bragg’s angle and λ is X-ray wavelength (0.15406 nm). Based upon movement of dominant peaks concerned, inter-planar spacing (d) is varied from 2.03 Å to 3.42 Å due to change in respective 2θ of preferred orientations [3]

Lattice parameters or constants viz. ‘a’ for cubic and ‘a’ and ‘c’ for hexagonal phased CdSe thin films are calculated by using the given relations (78).

$$d=\frac{a}{\sqrt{{h}^{2}+{k}^{2}+{l}^{2}}}$$
(7)
$$\frac{1}{{d}^{2}}=\frac{4}{3}\left(\frac{{h}^{2}+{hk}^{2}+{l}^{2}}{{a}^{2}}\right)+\frac{{l}^{2}}{{c}^{2}}$$
(8)

Herein, (hkl) are Miller indices of the associated diffraction peaks.

The evaluated lattice constant ‘a’ for cubic and hexagonal and ‘c’ for hexagonal phases are ranged from 4.24 Å to 5.92 Å and from 6.92 Å to 6.95 Å, respectively, and varied with the temperature of the MgCl2 treatment might be due to shifting of 2θ position to the corresponding preferred orientation [21]. The present findings are also supported with the findings of MgF2 [20] and MgI2 [21] activated CdSe thin films.

The crystallite size (D) is calculated using the Scherer’s formula [33] as given by relation (9).

$$D= \frac{k\lambda }{\beta cos\theta }$$
(9)

Herein, β is full width at half maximum (FWHM) and calculated by fitting a single Gaussian curve and  k is the so-called Scherrer constant having typical value of 0.94 for spherical grains. The internal strain (ε), dislocation density (δ), and number of crystallites per unit area (N) are calculated by using the relations (1012) [33, 34].

$$\varepsilon = \frac{\beta }{4\mathrm{tan}\theta }$$
(10)
$$\delta = \frac{1}{{D}^{2}}$$
(11)
$$N= \frac{t}{{D}^{3}}$$
(12)

Herein, t is the thickness of the associated CdSe thin films. Estimated crystallite size is found to augment with annealing and obtained within 36–49 nm range due to reduction in density of defects and stronger inversion of detrimental GBs [2], and consequently, strain (ε), dislocation density (δ) and number of crystallites per unit area (N) are decreased as presented in Table 1. The maximum grain growth (in terms of higher crystallite size of 49 nm) is observed for 400 °C activated CdSe films due to coalescence of smaller CdSe grains into bigger ones which is caused by the MgCl2 sintering flux at higher annealing temperature [12]. Herein, MgCl2 activation has led to appropriate grain growth and effective decrement in defect density. The MgF2 [20], CdCl2 [11] and CdI2 [12] activated CdSe films exhibited higher grain growth at 200 °C, 400 °C and 400 °C, respectively which revealed that smaller size Fluorine (F) integrated effectively at lower temperature while higher temperature is needed for apt assimilation of bigger sized Chlorine (Cl) and Iodine (I). In present study (CdSe-MgCl2 system), slight higher grain size (49 nm) is observed vis-à-vis the CdSe-MgF2 [20] system (41 nm) which might be endorsed to the substitution of Se by lower sized Fluorine. Thus, each halide compound is accountable for dissimilar structural characteristics of CdSe films which clearly showed the influence of size of the halogen atoms segregated at the GBs during the activation.

3.2 Electrical analysis

An impact of MgCl2 treatment on I-V characteristics of CdSe films is depicted in Fig. 2 which expose Ohmic nature since, current is linearly reliant on voltage in both the halves, and such Ohmic nature is desirable for fabrication of efficient solar cell devices. With MgCl2 treatment, electrical conductivity is initially increased upto 200 °C vis-à-vis the pristine films due to GBs passivation and enhancement in concentration of charge carriers due to substitutional incorporation of Chlorine (\({\mathrm{Cl}}_{\mathrm{Se}}^{+}\)) at Se sites in CdSe crystal structure [11, 22]. On further annealing after 200 °C, electrical conductivity is decreased that might be ascribed to the presence of residual Chlorine which generates isoelectronic complexes with Cadmium vacancies (\({2\mathrm{Cl}}_{\mathrm{Se}}^{+}-{\mathrm{V}}_{\mathrm{Cd}}^{2-}\)) and Selenium interstitials (\({2\mathrm{Cl}}_{\mathrm{Se}}^{+}-{\mathrm{Se}}_{\mathrm{i}}^{2-}\)), consequently, concentration of charge carriers is decreased [20, 22].

Fig. 2
figure 2

I-V characteristics of prepared CdSe thin films

The electrical resistivity is calculated using standard relation (13) [10, 16].

$$\rho =\frac{V}{I}\times 2\pi s$$
(13)

Herein, \(\rho\), V, I and s represent resistivity, voltage, current and distance between the inner probes, respectively where s is taken 1 mm for the present employed experimental setup. The electrical resistivity is obtained as 1.39 × 102 Ωcm, 1.16 × 102 Ωcm, 3.61 × 102 Ωcm and 3.49 × 102 Ωcm for pristine and 200 °C, 300 °C, and 400 °C MgCl2 activated CdSe films, respectively. At lower annealing temperature, reduction in resistivity might be due to increased carrier concentration owing to substitutional insertion of Mg2+ and Cl ions in CdSe lattice structure [12]. For MgF2, CdCl2 and CdI2 treated CdSe films, previously reported works also supported that films annealed at lower temperature (200 °C) exhibited lower resistivity and with increasing annealing temperature, an enhancement in resistivity was observed [11,12,13,14,15,16,17,18,19,20, 20,21,22]. Present MgCl2 activated CdSe thin films show higher electical resistivity as compared to the previously reported MgF2 [20] activated films which might be endorded to higher ionic conductivity of lower sized Fluorine than that of larger sized Chlorine.

At higher annealing temperature, concentration of incorporated cationic and anionic impurities might be increased where cation (Mg2+) could also be incorporated at interstitials (Mgi) together with substitutional incorporation at Cd sites (MgCd) which act as recombination centers and do not work as donor and eventually resulted into increased resistivity due to decreased concentration of charge carriers [18]. Excess substitutional Chlorine augments the resistivity of CdSe films. At higher annealing temperature, MgCl2 treatment might leave residual Chlorine in huge amount in CdSe lattice, which generates a high concentration of the isoelectronic complexes VCd2ClSe and Sei2Clse which are accountable for decrement in electrical conductivity of these films [22, 35]. The incorporation of Chlorine and Magnesium (Mg) into the CdSe lattice and creation of VCd2ClSe complex could be enlightened well by the given chemical reactions which might be taken place in the CdSe-MgCl2 system [19, 22].

$${\mathrm{MgCl}}_{2}\leftrightarrow {\mathrm{Mg}}_{\mathrm{Cd}}+{{\mathrm{Mg}}_{\mathrm{i}}^{2-}+2\mathrm{Cl}}_{\mathrm{Se}}^{+ }+{\mathrm{V}}_{\mathrm{Se}}^{2-}+{\mathrm{V}}_{\mathrm{Cd}}^{2-}$$
(14)
$$\mathrm{nCdSe}+{\mathrm{xMgCl}}_{2}\to {\mathrm{Cd}}_{\mathrm{n}-\mathrm{x}}{\mathrm{Mg}}_{\mathrm{x}}{\mathrm{Se}}_{\mathrm{n}}{({\mathrm{V}}_{\mathrm{Cd}}2\mathrm{Cl}}_{\mathrm{Se}})$$
(15)

The above Eqs. (1415) reveal that the incorporation of Magnesium into the CdSe lattice could be occurred via two routes either at interstitials (Mgi) and occupy empty locations of Cadmium or replace it (MgCd) [19, 22]. On increasing activation temperature, insertion of Magnesium at interstitial sites might be started which led to enhance the resistivity probably due to reduction in concentration of charge carriers [18]. Such fluctuating behavior of resistivity was reported for CdCl2, CdI2, MgF2 and MgI2 activated CdSe films where resistivity was observed to be improved with increasing activation temperature but, all the treated films exhibited lower resistivity vis-à-vis the pristine CdSe films [11, 12, 20, 21]. Hence, the electrical properties of CdSe films are affected by MgCl2 activation temperature at a great extant.

3.3 Surface topographical analysis

The atomic force microscopy (AFM) technique is employed to capture the surface topographies of pristine and MgCl2 treated CdSe thin films where two and three dimensional surface topographical maps are shown in Fig. 3. Three dimensional (3D) AFM images indicate hill and valley like structures where hill heights and distribution tend to become uniform with annealing temperature which signify enhancement in surface topography of films with MgCl2 treatment. The two dimensional (2D) AFM images reveal that the surface topography is considerably observed to be varied with increasing activation temperature. The spherical shaped grains with different density are visible in 2D AFM images. The compactness of CdSe films are eventually varied with MgCl2 annealing temperature [11]. The topographical parameters such root mean square roughness (Sq), average surface roughness (Sa), grain size, skewness (Ssk) and kurtosis (Sku) are calculated employing an open access Gwyddion software and summerized in Table 2. The average (Sa) and root mean square (Sq) roughness of pristine and treated films are observed in range 32–126 nm and 58–155 nm, respectively and achieved maximum for 300 °C treated films. The formerly reported works for CdSe films revealed that the MgF2 [20] and MgI2 [21] activated films exhibited higher roughness at 200 °C while CdCl2 [11] and CdI2 [12] activated films demonstrated maximum roughness at activation temperature of 400 °C. Surface roughness of the CdSe films depends sturdily on the grain growth which is influenced by post deposition activation treatment and growth temperature [11]. Alteration in average surface roughness of CdSe thin films is also reported with incorporation of different amount of Sb dopant [36]. Evaluation of average grain size could be carried out by histograms concerned which showed that pristine and 200 °C, 300 °C and 400 °C treated films presented grain size of 39 nm, 47 nm, 60 nm and 46 nm, respectively where 300 °C treated films show higher grain growth vis-à-vis the others.

Fig. 3
figure 3

Three dimensional (3D) surface topographs and associated grain size histograms of prepared CdSe films where insets of histograms consist two dimensional (2D) surface topographs.

Appeared grain growth with MgCl2 treatment is possible due to coalescence of smaller nanograins into larger grains which further confirmed that films’ growth is thermally activated process [29]. The previously reported AFM analyses for CdSe films revealed that the CdCl2 [11] and CdI2 [12] activated films exhibited higher grain growth at 400 °C while MgF2 [20] and MgI2 [21] activated films demonstrated maximum grain growth at 200 °C. For 300 °C activated CdSe films, higher value of surface roughness and grain growth are also supported by optical findings as discussed in next sub-section 3.5. The higher surface roughness and optical absorbance are essential for better quality absorber layers to fabricate desired solar cell device. The Sku and Ssk are the statistical parameters those are employed to measure and understand the sharpness and distribution symmetry of the films, respectively [19]. The MgCl2 activated films have sharp hill-like peaks as compared to the pristine which ascribed to corresponding lower value of Sku (lesser than 3) [37, 38]. Skewness (Ssk) and kurtosis (Sku) for pristine and MgCl2 treated films are observed in range of 0.06–3.78 and 0.26–43.23, respectively as depicted in Table 2.

Table 2 Different topographical parameters together with grain size for prepared CdSe thin films

The lower value of skewness (close to zero) revealed that the MgCl2 activated films are more symmetrically distributed vis-à-vis the pristine films [37, 38]. In the present exploration, the surfaces of all the CdSe films have more peaks than valleys which are attributed to positive Ssk value where the height distribution is also asymmetrical and varied with treatment temperature [22]. In this way, the surface topography and statistical parameters of CdSe films are deeply influenced by activation temperature of MgCl2 treatment.

3.4 Photoluminescence analysis

The photoluminescence (PL) spectra of CdSe films are depicted in Fig. 4 where spectral emission region extends from 570 to 725 nm. The films showed stronger PL emission peak centered at ~ 675 nm which is related to near band edge (NBE) luminescence of CdSe system [11, 20]. Intensity of characteristic NBE emission peak is found maximum for films annealed at 300 °C which might be owing to the effective insertion of Cl and Mg into CdSe lattice attributed to shrinking of participation of trap states in PL emission and creation of additional DAPs (donor acceptor pairs or electron–hole pairs) [11, 39]. The enhancement in intensity of NBE peak with increasing activation temperature upto 300 °C could be accredited to augmentation in crystallinity and good topograhical quality of the films which is also supported by optical findings.

Fig. 4
figure 4

Photoluminescence spectra of prepared CdSe films

At higher activation temperature i.e. at 400 °C, the diminish in intensity of  the PL peak could be apparently caused by the phase transition of CdSe thin films from hexagonal to cubic structure [29] as well as might be due to incorporation of Mg as interstitials which effectively acted as detrimental recombination centrersor trap states. Also on increasing the activation temperature, the position of NBE emission peak is not changed but, intensity is observed to be varied. On increasing annealing temperature, the chemical composition and stoichiometry of CdSe films might be changed which led to modification in density of defects and surface traps and consequently, intensity of PL peaks is varied with activation temperature. For treated films, a green emission peak is apeared at ~ 625 nm which is associated to deep level defects and arose due to MgCl2 treatment [39]. The observed green emission peak at ~ 625 nm and the NBE emission peak at ~ 685 nm are well supported by earlier published works where post-deposition treatment is performed using 0.2 molar solutions of CdCl2, CdI2, MgF2 and MgI2 on thermally grown CdSe thin films having thickness of 600 nm [11,12,13,14,15,16,17,18,19,20,21,22]. Hence, the deliberated inclusion of Mg and Cl in CdSe thin films remarkably influences the photoluminescence properties of the associated films.

3.5 Optical analysis

The absorbance and transmittance spectra of developed films are shown in Figs. 5 (a and b) where absorbance is found higher in visible region and lower in the near infra-red (NIR) region. Enrichment in absorbance is found with increasing annealing temperature upto 300 °C and thereafter on further annealing at 400 °C, slight reduction in absorbance is observed which well supported by topographical findings. Similarly, in the visible region of spectra, on enhancement in activation temperature upto 400 °C, augmentation in optical absorbance has also been reported for CdCl2 activated CdSe thin films [11] while, MgF2 [20] and CdI2 [12] activations enhanced the absorbance upto 200 °C after that, decrement in absorbance was reported. The CdSe thin films activated with MgI2 at temperature of 200 °C, 300 °C and 400 °C showed lower absorbance vis-à-vis the pristine films in the visible region of the spectra while improvement in absorbance was reported in NIR region [21]. Hence, absorbance of films is affected by nature of halide treatment and activation temperature as well. The absorption edge of MgCl2 treated films is blue shifted which endorsed to enhancement in crystallinity and phase transformation due to the applied treatment [3]. With post-deposition activation, shifting in the absorption edge of CdSe thin films towards the lower wavelength side was also reported with CdCl2, CdI2 and MgI2 activations [11, 12, 21] whereas no particular trend was observed with MgF2 activation [20].

Fig. 5
figure 5

a Absorbance, and b transmittance spectra with wavelength, c Tauc’s plots and d refractive index for prepared CdSe films

The transmittance spectra of these films showed precisely opposite behavior to that of absorbance spectra where occurrence of interference fringes indicated development of nearly homogeneous films. Emerged fringe patterns are also reported previously for CdCl2 [11], CdI2 [12], MgF2 [20] and MgI2 [21] activated CdSe thin films. At higher annealing temperature of 400 °C, the MgCl2 and MgF2 activated films showed better homogeneity vis-à-vis the CdCl2, CdI2 and MgI2 activated films. In the visible region, lower transmittance is observed and improved with rising wavelength of incident radiation. The higher absorbance and lower transmittance obtained for 300 °C treated films make these appropriate as potential absorber layers for thin film solar cell devices.

The optical energy band gap (Eg) is calculated using Tauc’s relation (16) [40] and corresponding Tauc’s plot curves between hυ and (αhυ)2 for pristine and MgCl2 activated CdSe are shown in Fig. 5 (c).

$$\alpha h\upsilon =K{(h\upsilon -{E}_{g})}^{n}$$
(16)

Herein, α, and K are absorption coefficient, photon energy and optical constant, respectively and the exponential ‘n’ has numeral values as 1/2, 3/2, 2 and 3 for direct allowed, direct forbidden, indirect allowed and indirect forbidden transitions, respectively [20]. The optical energy band gap is estimated from Tauc’s plots by extrapolating a peripheral line to hυ axis. The Eg is found to be 1.60 eV, 1.62 eV, 1.70 eV and 1.69 eV for pristine and MgCl2 treated films annealed at 200 °C, 300 °C and 400 °C, respectively which is well supported with the previously reported works [20, 21]. The Eg is increased with treatment upto 300 °C which attributed to enhancement in crystallinity and phase transition due to post treatment together with stoichiometric fluctuations [3, 41]. Blue shift in Eg for treated films vis-à-vis the pristine films might due to incorporation of Mg2+ (0.72 Å) ions which have lower size than Cd2+ (0.97 Å) ions. Similar enhancement in Eg of CdSe thin films was reported with Zn doping [41]. After MgCl2 activation, the chemical composition of the CdSe films might be changed which eventually altered the optical energy band gap of the CdSe films. Bagheri et al. observed Eg of 1.72 eV for CdCl2 treated CdSe films annealed at 400 °C [1].

Kumari et al. also reported the optical energy band gap of 1.61 eV, 1.69 eV, 1.68 eV, 1.67 eV, 1.70 eV and 1.59 eV for pristine, CdCl2, CdI2, MgF2, MgCl2 and MgI2 activated CdSe films, respectively where CdSe films were activated at 300 °C [22]. The Swanepoel’s envelope method is applied to find out the spectral behavior of refractive index (n) of pristine and MgCl2 activated CdSe films considering the transmittance data in the interference zone beyond the 700 nm. The spectral dispersion of refractive index with wavelength is depicted in Fig. 5(d) where the ‘n’ is observed to be declined continuously with escalating wavelength up to 900 nm. On enhancement in activation temperature, the refractive index is continuously improved upto 400 °C where all the MgCl2 activated films demonstrated higher value of ‘n’ vis-à-vis the pristine CdSe films. Similar behavior of refractive index was also observed for CdI2 and CdCl2 activated CdSe films [11, 12]. The improvement in refractive index with MgCl2 activation might be attributed to enhancement in the packing density of treated films due to incorporation of smaller sized Magnesium ions at the interstitials of pristine CdSe lattice [12, 22]. On increasing annealing temperature, the internal strain and voids in the CdSe films are diminished as supported by XRD findings which resulted into enrichment in refractive index of CdSe films.

4 Conclusion

A scrupulous optimization of physical properties of MgCl2 treated CdSe films is undertaken in the present study for absorber layers roles to solar cells wherein films are thermally evaporated and treated by environmental friendly MgCl2 compound followed by annealing at different temperatures. The pristine films have (111) dominant reflection of cubic phase and phase transformation from (111)C to (103)H is observed with MgCl2 treatment for 200 °C and 300 °C treated films and later at 400 °C, further phase transformation from (103)H  to (111)C is occurred. The crystallite size is boosted from 36 nm to 49 nm with MgCl2 annealing treatment and I-V characteristics showed Ohmic nature. The electrical conductivity is improved at 200 °C whereas resistivity is increased at 300 °C and 400 °C possibly due to incorporation of interstitial Mg and subsequent creation of recombination centres. The Eg is found to be 1.60 eV, 1.62 eV, 1.70 eV and 1.69 eV for pristine and MgCl2 activated CdSe films at 200 °C, 300 °C and 400 °C, respectively. Optical absorbance is improved with MgCl2 treatment and PL spectra exhibited two peaks with stronger one at ~ 675 nm related to NBE luminescence whose intensity is affected by temperature of MgCl2 activation. The root mean square roughness of pristine and 200 °C, 300 °C and 400 °C treated films is observed as 76 nm, 78 nm, 155 nm and 58 nm, respectively. The 3D AFM images revealed hill-like surface topographies which achieved uniformity with treatment temperature. Obtained appropriate experimental findings like near optimum band gap, higher roughness and absorbance and lower transmittance, crystallographic defects as well as appropriate grain size of 300 °C treated CdSe films demand their suitability as effective absorber layer in the development of apposite solar cells where either p-type NiOx or ZnTe could be employed as window layer which need separate optimization in accordance with the device architecture.