1 Introduction

ZnO is currently undergoing extensive research for various technological applications, including solar cells, transparent conducting electrodes, UV photodetectors, sensors, and thin-film transistors [1,2,3,4]. This interest stems from its wide band gap (3.37 eV), stable chemical structure, high reactivity at the nanoscale, strong luminescence properties at room temperature, high optical transmittance in the visible region, and cost-effectiveness combined with its ease of production [2]. The electrical conductivity, semiconductor type, band gap, and especially the optical properties of n-type ZnO can vary depending on the type and quantity of the dopant material such as nickel (Ni), cobalt (Co), B, Al, magnesium (Mg), and Fe [5, 6]. Various methods, including chemical vapor deposition [7], thermal evaporation [8], RF magnetron sputtering [9], molecular beam epitaxy [10], and the sol–gel method [11] are employed for the production of both pure and doped ZnO. It stands out because of its low cost and ease of production, as well as its ability to achieve structures with different properties by adjusting production parameters and facilitating large-scale film coating. Especially when ZnO is doped with III-group elements, it is widely used as transparent conductive oxide (TCO) layers in solar cells [12, 13]. Even at doping levels as low as 1% with Indium (In) from the III-group elements, successful results were achieved in this field [14]. In a study conducted by G. R. Neupane et al. in 2019, Fe-doped ZnO nanoparticles were deposited on silicon solar cells as anti-reflective coating. It was found that the 15% Fe-doped ZnO, produced using the microwave method, significantly improved the performance of the Si solar cell [15]. In another study conducted by M. Salem and colleagues in 2023, Fe-doped ZnO produced by chemical deposition method was deposited on Si solar cell by spin coating method. At the end of this study, it was observed that the reflection of the incident light decreased from 32% to 6%, thereby increasing the efficiency of the solar cell as the reflection decreased [16]. S. Base et al. applied a coating of B-doped ZnO material on a-Si solar cell, resulting in an increase in the solar cell efficiency to 8.14% [17]. In addition to solar cells, doped ZnO materials are used as intermediate layers in Schottky structures to form the MIS (metal–insulator-semiconductor) configuration [18, 19]. These structures prepared with doping elements such as B, Al, Mg, Co, and Cu have been investigated in terms of barrier height, ideality factor, and serial resistance [4, 5, 20,21,22]. Al-doped ZnO/p-Si heterojunction diode was fabricated by M. J. Jiang et al., using laser molecular beam epitaxy [4, 21]. It was found that the ideality factor of this Schottky diode was around 9.5 at low voltage values, while it was around 19 at high voltage values. In a study conducted by Yakuphanoğulları et al., B-doped ZnO prepared via the sol–gel method was coated on p-type Si substrates. It was observed that the ideality factors of those Schottky diodes were in the range of 2–2.5, and the ideality factor of pristine ZnO decreased with boron doping. However, it was understood that the barrier height of the prepared Schottky diodes did not change with boron doping [4]. In the study conducted by R. Padma et al. in this field with Fe, it was seen that the Au/Fe-ZnO NS/n-InP MIS Schottky structure exhibited a good rectifying ratio with low leakage current compared to the Au/n-InP MS structure [23]. As a result of all these studies, it has been concluded that the doping of ZnO material has led to improvements in its electrical properties. However, the studies in this regard are insufficient, and there is a need for further research to be conducted.

In this study, pristine ZnO, only 6% Fe-doped ZnO (Zn0.94Fe0.06O), and 4% B-6% Fe co-doped ZnO (Zn0.90Fe0.06B0.04O) nanostructures were produced in the thin films form using sol–gel dip coating and spraying methods for optoelectronic applications such as solar cell and photodetector. A total of 4 samples were prepared for each sample group, including 4, 6, 8, and 10 layers of coating. During this study, production was carried out at various mole ratios of Fe and B elements, and their physical properties were tested (for example, 15% Fe, 1% B, 10% Fe, 7% B, etc.). However, the best results were obtained for doping ratios of 6% Fe and 4% B. The Fe element is a transition metal and typically takes on the Fe+2 and Fe+3 oxidation states in its compounds. While the ionic radii of Fe2+ is 78 pm, that of Fe3+ is 64 pm. On the other hand, the ionic diameter of Zn is 74 pm. Boron is one of the elements in Group 3A and typically has + 3 valence electrons (B3+). The ionic radius of boron is 23 pm, which is considerably smaller than that of Zn. Since the ionic radius of Fe is nearly similar to that of Zn ion and Fe enhances the optical and electrical properties of ZnO, iron was preferred in this study. The exceedingly small ionic radius of boron and its capacity to alter the semiconductor type based on the type and quantity of defects it induces within the structure arouse curiosity regarding the potential changes it can instigate in Fe-doped ZnO material. Therefore, ZnO thin films doped with both Fe and B were produced, and there was no need for the production of B-doped ZnO in line with our objectives.

In this study, after the production of thin films, the structural characterizations of all samples were performed using X-ray diffraction (XRD), energy-dispersive spectroscopy (EDS), and scanning electron microscopy (SEM) methods. The optical properties of the all samples were determined through optical transmittance and photoluminescence (PL) analyses. As a result of optical analyses, information regarding the band gap energies and defects formed within the structure of the samples was obtained. A detailed electrical analysis of the thin films was performed with I–V measurements which were taken under dark and light (100 mW/cm2) conditions in the range of − 3 to 3 V. After investigating whether the samples showed diode characteristics, ideality factor, barrier height, and serial resistance values of each film were determined as interlayer in the form of Au/ZnO/p-Si, Au/Zn0.94Fe0.06O/p-Si, and Au/ Zn0.90Fe0.06B0.04O/p-Si, depending on film thickness. Under light intensity of 100 mW/cm2, the performance of all samples as solar cells and photodiodes was investigated. Based on the obtained results, electrical and optoelectronic measurements were repeated with Al instead of Au as the contact material for the sample that exhibited the best performance with Au contacts. This study represents a first, as Fe and B co-doped ZnO has not been previously synthesized, and neither the physical properties of this material nor its performances in devices such as solar cells and photodiodes have been investigated before. Moreover, Fe-doped ZnO has not been previously produced as a solar cell in the p–n form. In previous studies, it served as an anti-reflective coating. Therefore, we believe that this present study will make significant contributions to the literature.

2 Experimental

Zinc acetate dihydrate (Zn(CH3CO2)2·2H2O), iron (II) sulfate heptahydrate (FeSO4·7H2O), and trimethyl borate (C3H9BO3) are the sources of zinc, iron, and boron materials, respectively, for pure ZnO, 6% Fe-doped ZnO, and 6% Fe-4% co-doped ZnO solutions prepared via the sol–gel method. The molarity of the solutions was determined as 0.3 and the total volume was 50 ml. After calculating the amounts of source materials according to their mole ratio in the solutions, they were weighed on a precision balance. Then, these source materials were dissolved in C3H8O2 (ethylene glycol monomethyl ether, EGME), which was used as a solvent, with a magnetic stirrer at 800 rpm. The temperature of solutions was set at 70 °C during the mixing process. After stirring the prepared solutions for 30 min, ethanolamine (C2H7NO) was added to the solutions as a catalyst to obtain a homogeneous and transparent solutions. In this study, as in other studies conducted using the sol–gel method, the molar ratio of ethanolamine to Zn was considered as “1” [24, 25]. Various factors contribute to determining this value. Ethanolamine serves not only as a catalyst for the sol–gel process but also as one of the essential reactants in the synthesis of ZnO, as depicted in the formula \(\text{Zn}{({\text{CH}}_{3}\text{COO})}_{2}\stackrel{\text{EGME}}{\to }\left[{\text{CH}}_{3}\text{COOZn}\right]\stackrel{\text{ethanolamine}}{\to }\text{Zn}-\text{O}-{\text{CH}}_{2}-{\text{CH}}_{2}-{\text{NH}}_{2}\stackrel{\text{Dry in air}}{\to }\text{ZnO}\)[26]. As seen from this formula, ethanolamine acts as a complexing agent, coordinating with zinc ions from zinc acetate. In the hydrolysis and condensation mechanisms involved in the sol–gel reaction, each zinc ion corresponds to one ethanolamine molecule. Therefore, when the amount of ethanolamine in the solution increases, there will not be sufficient number of zinc ions available for matching, leading to precipitations in the solution. The residual ethanolamine formed will negatively affect the structure of the resulting sample. If the ratio is less than 1, the hydrolysis and condensation mechanisms may not fully proceed, leading to difficulties in zinc oxide formation. This, in turn, could hinder the achievement of a pure and homogeneous solution. Additionally, ethanolamine can act as a buffer by maintaining the pH of the solution within an optimal range for the formation of ZnO. Generally, a stable ZnO structure forms when the pH is around 10 because the solubility of ZnO in the solvent increases at this pH value [27]. This is achieved best when the molar ratio of Zn to ethanolamine is 1, whereas lower values result in an unstable structure. The 1:1 molar ratio of ethanolamine and zinc acetate provides suitable Gibbs free energy values for complex formation and subsequent formation of the ZnO product [28]. Additionally, it helps regulate the reaction kinetics, ensuring that the conversion of precursors to ZnO proceeds at an optimal rate. This prevents issues such as incomplete conversion or undesired side reactions. The presence of ethanolamine at a specific concentration can promote nucleation and growth of ZnO particles by providing suitable reaction conditions, leading to the formation of well-defined and uniform nanostructures. So, the presence of ethanolamine at this molar ratio can lead to the formation of homogenous and smooth nanostructures. It is observed that when the molar ratio of ethanolamine exceeds 1, there is a significant increase in particle size, resulting in the formation of structures in the micron range [28]. Additionally, it is understood that this ratio forms a stoichiometric structure, reducing potential defects and enhancing crystal quality. All these contribute to improving the physical properties of the produced samples, thereby enhancing their performance as devices. In conclusion, the 1:1 molar ratio might have been chosen to ensure an effective reaction equilibrium, controlled kinetics, formation of smooth and densely products with homogeneous nucleation and growth, and chemical stability. After stirring the solutions for approximately two hours following the addition of the catalyst, the process of preparing the solutions was completed. Before coating these solutions on the glass and Si substrates in the thin film form, these substrates underwent a series of cleaning processes. The glass and Si substrates were separately immersed in acetone and boiled for approximately 15 min. Then the glass substrates were kept in ethyl alcohol and a mixture of 3 units HCl with 1 unit HNO3 solution, respectively, for a certain time [29]. The Si substrates were boiled at 150 °C for 15 minutes in a solution composed of 1 unit NH3, 1 unit H2O2, and 4 units distilled water [29]. Afterward, they were etched in hydrofluoric acid (HF) for approximately 10 s to remove the oxide layer. Between and at the end of all these cleaning processes, all the substrates were washed with deionized water. After completing the substrate cleaning process, the solutions were applied to these substrates using dip coating and spraying methods. The change in coating method is entirely related to our objective. While dip coating is employed to coat both sides of the substrates, single-sided coating is achieved using the spraying method. Since more homogeneous coating is achieved with dip coating, glass substrates were coated with this method for optical and structural analyses. Since single-sided coating is required for optoelectronic and electrical analyses, solutions were sprayed on Si substrates. To investigate the effect of film thickness on optical, electrical, and optoelectronic properties, each type of solution was coated on glass and Si substrates 4, 6, 8, and 10 times. The fabricated samples were heat treated at 320 °C for 2 minutes after each layer deposition to provide proper penetration of the solution into the substrates. Finally, all the produced samples were annealed in a box furnace at 400 °C for 30 min to ensure that their crystal structures were fully formed and to eliminate any unwanted elements introduced by the solutions during the coating process of the pristine ZnO, Zn0.94Fe0.06O, and Zn0.90Fe0.06 B0.04O samples with 4, 6, 8, and 10 layers. For convenience in this study, these samples were labeled as follows: “Z4, Z6, Z8, Z10” for pristine ZnO, “F1-4, F1-6, F1-8, F1-10” for Zn0.94Fe0.06O, and “F1B4, F1B6, F1B8, F1B10″ for Zn0.90Fe0.06 B0.04O material.

For optoelectronic and electrical measurements, Au contacts were deposited on both the bottom and top of the samples using the thermal evaporation method via NANOVAK NVTH-350 apparatus. The upper contacts are 200 nm thick with diameters of 1 mm and 1.5 mm, depending on the used mask. Thus, Au/ZnO–Zn0.94Fe0.06O–Zn0.90Fe0.06 B0.04O/p-Si/Au diodes were created. In order to determine the effect of the contact element on the electrical and optoelectronic properties of ZnO, the sample that gave the best results for Au contacts was re-examined by applying Al contacts. The picture of the produced diode and the schematic representation of the experimental setup for electrical measurement are given in Fig.1a and b, respectively.

Fig. 1
figure 1

a Picture of produced diode, and b schematic representation of experimental setup

The crystal type, lattice parameters, interplanar distances, grain size, and stresses occurring in the lattice structure of all produced thin films were obtained with XRD analysis using the Malvern PANalytical Empyrean MultiCore device. XRD analysis was performed using CuKα radiation (0.154 nm) in the range of 25°–80°. The surface morphologies and chemical compositions, including the atomic ratios of elements in the compound, of all samples were determined using SEM and EDS analyses, respectively, utilizing the Zeiss-EVO LS 10 instrument.

Optical transmittance analysis is one of the methods used in the study, in which the optical properties of pure ZnO, 6% Fe-doped ZnO, and 4% B-6% Fe-doped ZnO materials were investigated depending on the film thickness. The optical transmittance analysis was applied in the range of 200–1100 nm in air atmosphere at room temperature with a PERKIN ELMER UV–VIS spectrometer. The band gap of each sample was found using the Tauc equation with the obtained transmission data. PL, another standard method used for optical characterization of semiconductors, is based on the arrival of monochromatic light with energy higher than the band gap energy of the semiconductor on the semiconductor surface. This results in radiative recombination of electrons excited from the valence band to the conduction band. In addition, the radiation may be caused by defects. Therefore, it provides information not only about the band gap of the semiconductor but also about the dopants and defect levels present in the samples. To better interpret the impact of dopant elements on the optical properties of ZnO material, PL measurements were performed at room temperature. In PL measurements, a 450 W ozone-free xenon lamp, a 55 mW HeCd laser light source with 325 nm wavelength, a double-grating excitation monochromator (Jobin Yvon-Horiba), a sample chamber, a single-grating radiation monochromator (JYH), a photomultiplier tube (PMT), and a liquid nitrogen-cooled 2-mm-diameter InGaAs photodiode detector were utilized.

In this study, Hall measurement was performed to determine the semiconductor types (n-type or p-type) and carrier densities of pristine ZnO and doped ZnO samples. Hall measurement is based on the formation of the Hall potential by deflecting the carriers under the influence of the Lorentz force in the presence of an electric field applied to the material under a certain magnetic field. In p-type semiconductors, the carrier density value is positive, as the majority carriers are holes. On the contrary, in n-type semiconductors, where majority carriers are electrons, we observe a negative Hall coefficient and effective carrier density values. Hall analysis results of all thin films were obtained using Lake Shore's new Hall Effect Measurement System (HMS) for 1.5 Tesla magnetic field at room temperature.

The electrical and optoelectronic measurements of Au/ZnO–Zn0.94Fe0.06O–Zn0.90Fe0.06 B0.04O/p-Si diodes were taken using a Keithley 2400 multimeter in both dark and 100 mW/cm2 light conditions. The illumination was carried out with the ORIEL Sol 1A solar simulator. Thus, the effects of both the number of coating layers and the dopant elements on the electrical and optoelectronic properties were characterized. Finally, the electrical and optoelectronic properties of the sample, which exhibited the best results with Au contacts, were re-evaluated in the present study by replacing the Au contacts with Al contacts. Thus, the effect of the contact material, particularly on the optoelectronic properties of ZnO, was determined.

3 Results and discussions

3.1 The structural characterization of thin films

The optical, electrical, structural, and optoelectronic properties of samples with different thicknesses produced for the pristine ZnO, Zn0.94Fe0.06O, and Zn0.90Fe0.06B0.04O sample groups were investigated. First, the results of SEM and EDS analyzes are presented as structural characterization. SEM images of pristine ZnO, 6% Fe-doped ZnO, and 4% B-6% Fe co-doped ZnO, which were captured at a magnification of 250.000, are shown in Fig. 2a–c, respectively.

Fig. 2
figure 2

SEM images of a undoped ZnO, b 6% Fe-doped ZnO, and c 4% B-6% Fe co-doped ZnO

Figure 2a illustrates the formation of nanodots ranging from 30 nm to 110 nm in diameter when a pure ZnO solution is coated as a thin film on the glass substrate. The surface morphology of the Z sample appears non-uniform, with numerous voids between the particles and the nanodots lacking a specific arrangement. It is noticed from Fig. 2b that nanodots-like structures with a diameter range of 15–60 nm are formed in the F1 sample. We can conclude that more homogeneous and lower dimensional particles are formed compared to the pure ZnO thin film. The average grain size of ZnO sample decreases, and the spatial gaps within the structure diminish with iron doping. It can be seen from the SEM images that the best result is obtained for the Fe–B-doped ZnO thin film (Fig. 2c). Morphologically, the surface appears highly homogeneous and smooth. The sizes of the formed nanodots are relatively uniform, ranging from 7.5 nm to 15 nm. It is clear that the particle size decreases with Fe and B co-doping. One of the structural characterizations, energy-dispersive spectroscopy, was performed simultaneously with the SEM measurements using the same device. The results of the EDS analysis for all thin films, including EDS spectra and elemental mappings, are presented in Fig. 3.

Fig. 3
figure 3

a, c, e EDS spectrum and b, d, f the elemental mapping of pure ZnO, Zn0.94Fe0.06O, and Zn0.90Fe0.06B0.04O samples, respectively

Based on the EDS spectrum, it is evident that pure and stoichiometric ZnO is obtained (Fig. 3a). As can be seen from Figs. 3c and e, pure Fe-doped ZnO and Fe–B co-doped ZnO materials are also obtained, respectively. However, in these two examples, the presence of Fe, Zn, and B atoms in lower values than their required atomic ratios in the compound may indicate the point defects in the structure. On the other hand, it is seen that the amount of oxygen in the structure is higher than it should be. This may suggest the possibility of oxidation occurring on the surface of the sample. The elemental mapping results demonstrate the homogenous distribution of Zn, O, Fe, and B atoms in the host lattice for the pure ZnO, Zn0.94Fe0.06O, and Zn0.90Fe0.06B0.04O samples (Figs. 3b, d, and f).

The obtained XRD peaks of all thin films are shown in Fig. 4. We can conclude that the samples are in the wurtzite ZnO polycrystalline structure form (PDF Card No:79-0205). However, it is observed that the XRD peaks of the sample doped with both iron and boron begin to diminish, and even some peaks are completely absent compared to the other two samples, shifting toward an amorphous structure. Additionally, it is observed that the prominent peaks shift toward higher angle with doping. In fact, the general observation for doped ZnO samples is that as dopant elements are added to ZnO, the XRD peaks broaden, and the peak height decreases considerably. The observed situation in both samples can be interpreted as distortions in the crystal structure of ZnO. The decrease in the intensity of XRD peaks and the expansion of the full width at half maximum (FWHM) by 6% Fe incorporation suggest the presence of lattice disorder and increased stress induced by the addition of dopant ions into the ZnO matrix. This indicates that the doping process introduces structural irregularities and imposes mechanical strains on the crystal lattice. High levels of Fe doping, such as 6%, may have led to the formation of more defects in ZnO. Additionally, Fe can exist in both Fe2+ and Fe3+ states in its compounds. The ionic diameters of Fe2+, Fe3+, and Zn2+ ions are 78 pm, 64 pm, and 74 pm, respectively. It is evident that the ionic diameter of Fe2+ is larger than that of Zn2+, while the diameter of Fe3+ is smaller than that of Zn2+. Consequently, the diameters of the two types of Fe dopant ions differ from Zn2+. Fe2+ or Fe+3 can exist in the ZnO, as well as two types of Fe doping ions can coexist [30]. The fact that the diameters of the two types of Fe dopant ions are different from that of Zn causes the intensities of the ZnO peaks to decrease by increasing the strains and defects in the structure. However, in this study, the peaks of Fe-doped ZnO sample shift slightly to higher angle values compared to pristine ZnO and the decrease in crystallite size may indicate the possibility that Fe+3 ion may be dominant in the structure [31]. It is understood that, in addition to Fe doping, B incorporation into the sample thoroughly disrupts the crystal structure. Boron is a very light element, and its ionic diameter (23 pm) is much smaller than that of Fe and Zn. B3+ ions can diffuse more easily into ZnO due to these properties. The EDS result already indicates that the atomic presence of Fe in the structure decreases with B doping. It is seen that the XRD peaks shift toward larger angles with B doping compared to only Fe doping. This phenomenon implies that the differences between the ionic radii of Zn, Fe, and B cause stress in the ZnO lattice, potentially causing excess distortion. At the same time, it is not surprising that the crystal quality decreases due to the presence of numerous atoms with varying ionic diameters within the structure, which in turn leads to an increase in expected point defects. Apart from these, B doping may have caused a change in the crystal structure by decreasing the interplanar distance and increasing the residual stress [32]. When the size of dopant ions is very small, they can occupy the interstitial spaces within the crystal lattice. These interstitial spaces are essentially gaps or holes between the regular arrangements of atoms in the crystal structure. With smaller dopant ions, there is a higher probability of these ions fitting into these spaces. Now, when these dopant ions occupy these interstitial sites, they can influence the crystal growth process [33]. Essentially, they act as nucleation centers for crystal growth. More dopant ions can fit into the crystal lattice, promoting the growth of the crystallite size for Fe–B co-doped ZnO compared to Fe-doped ZnO.

Fig. 4
figure 4

XRD pattern of produced all thin films with the sol–gel dip coating method

Various physical parameters such the crystallite size (D), full width at the half maximum (FWHM) value, lattice parameters (a, c), interplanar spacing of (hkl) Miller plane (d-spacing), and dislocation density (\(\delta\)) of crystal structure can be determined from the XRD spectra of a crystal material. The estimated average crystallite sizes of thin films including nanodots were found using the Debye–Scherrer formula in Eq. (1) [34].

$$D=\frac{K\lambda }{\beta \text{cos}\theta },$$
(1)

where D is the average crystallite size, \(\lambda\) is the wavelength of the x-ray (0.154 nm), \(\beta\) is the FWHM values of diffraction peaks, \(\theta\) is the Bragg angle, and K is referred to as the Scherrer constant. K is influenced by factors such as the shape and distribution of crystallites, diffraction line indices, and the definition of β, whether based on FWHM or integral breadth [35]. Its values typically range between 0.62 and 2.08. In this study, a specific value of K = 0.94 was employed. Additionally, the presence of microstrain within the crystallite or nanocrystal can contribute to the broadening of β, necessitating careful consideration for accurate analysis. Variations in alloy composition across space can also impact the width of the diffraction peaks. The calculated values of crystallite size presented in this work serve as estimates, acknowledging potential limitations of Eq. (1) (Discussion on the correctness of Eq. (1) can be found in the literature, for example, in [36]).

In this study, the all samples have got wurtzite ZnO polycrystalline structure. The lattice parameters of this hexagonal structure (a = b and c) can be determined using Eq. (2). We know that a = b for hexagonal crystal [6].

$$\frac{1}{{d}_{hkl}^{2}}=\frac{4}{3}\left(\frac{{h}^{2}+hk+{k}^{2}}{{a}^{2}}\right)+\frac{{l}^{2}}{{c}^{2}},$$
(2)

where \(h, k,\text{ and} l\) indicate the Miller indices of crystal plane and \({d}_{hkl}\) is the distance between the planes of thin films (interplanar space, d-spacing). The amount of defects in the crystal structure can be defined as dislocation density, δ, which is related to the crystallite size of produced pristine ZnO, 6% Fe-doped ZnO, and 6% Fe-4% B co-doped ZnO samples. Actually, dislocation density is known as the length of dislocation lines per unit volume, and is defined as [37]

$$\delta =\frac{1}{{D}^{2}}.$$
(3)

Since the (002) plane is distinctly present in the obtained XRD spectra for all three samples and is dominant peak for pure ZnO in this study, it was preferred to perform all operations according to the (002) plane. The calculated and observed results for the (002) plane from XRD spectra are presented in Table 1.

Table 1 Parameters and their values related to the crystal structures of the produced thin films

The location of the peaks' maxima in the XRD spectrum and the broadening of these peaks may occur as a result of defects in the structure [38]. Williamson–Hall (W–H) is one of the methods that explains the broadening of the XRD peaks due to finite crystallite size and microstrain contribution [39]. Within the scope of Williamson–Hall analysis, three models are utilized: The Uniform Deformation Model (UDM), the Uniform Stress Deformation Model (USDM), and the Uniform Deformation Energy Density Model (UDEDM) [40,41,42]. In this study, the simplest of the three models, the UDM, was employed. According to this model, peak broadening can be expressed as follows:

$${\beta }_{hkl}={\beta }_{c}+{\beta }_{\varepsilon }$$
(4)

where \({\beta }_{hkl}\), \({\beta }_{c}\), and \({\beta }_{\varepsilon }\) represent the extended full-width half maximum, Scherrer's broadening (it is well known that this broadening is due to crystallite size), and the broadening induced by microstrain, respectively. Microstrain is caused by point defects, and the lattice dislocation can be exhibited as.

$$\varepsilon =\frac{{\beta }_{\varepsilon }}{4\text{tan}\theta }$$
(5)

When Eqs. (4) and (5) are substituted in Eq. (1), the following equation is obtained.

$${\beta }_{hkl}=\frac{K\lambda }{D\text{cos}\theta }+4\varepsilon \text{sin}\theta$$
(6)

According to the UDM, crystallite size and strain can be determined by utilizing the Williamson–Hall plot. The x-axis of the Williamson–Hall plot represents 4sinθ, while the y-axis represents \({\beta }_{hkl}\text{cos}\theta\). After the W–H graph is drawn, a linear fit is applied to the graph. According to the linear fit results, the intersection value of the linear fit determines the crystallite size, while the slope value provides the strain value [43]. Graphics are not presented here to avoid taking up too much space. However, the obtained average results regarding these physical quantities according to UDM are given in Table 2.

Table 2 Williamson–Hall results for Z, F1, and F1B thin films

The average crystallite sizes obtained from the Williamson–Hall graph for the three samples are smaller than the values obtained from the Debye–Scherrer equation. Indeed, the smaller crystallite size is obtained due to peak broadening. The lowest crystallite size is obtained with 6% Fe incorporation. Therefore, we can conclude that Fe doping reduces the crystallite size. Perhaps during the nucleation stage of nanostructure production, either during coating or solution formation, the presence of Fe may have led to smaller nucleation. The microstrain values of the thin films including nanoparticles are positive except Zn0.90Fe0.06B0.04O sample. Negative values of microstrain indicate compressive strain, while positive values indicate tensile strain in the material [44]. Negative value may be caused by lattice shrinkage [45]. This situation is already supported by the values of a, c, and d given for the Zn0.90Fe0.06B0.04O sample in Table 1. There is a contraction in lattice constants with respect to pristine ZnO.

3.2 The optical characterization of thin films

The optical properties of all produced thin films in this study were examined via optical transmittance and PL analyses, depending on thickness of films. The transmittance of materials, particularly in the visible region, was determined using this optical transmittance analysis. Optical band gaps of both pure and doped semiconductor samples were calculated by using the Tauc Model [46] as illustrated in Eq. (7).

$$\left(\alpha h\nu \right)=B{\left(h\nu -{E}_{\text{g}}\right)}^{1/2},$$
(7)

where α, h, ν, B, and \({E}_{\text{g}}\) define the absorption coefficient, Planck constant, frequency, a constant related to material, and band gap energy of semiconductor, respectively. Optical transmittance and band gap graphs for each sample, depending on the number of coatings of thin films, are presented in Fig. 5.

Fig. 5
figure 5

a, c, e Optical transmittance values and b, d, f band gap graphs of all thin films

The results obtained from the graphs in Fig. 5 are presented in Table 3 to provide a clearer understanding of the optical transmittance and band gap values based on the coating numbers of thin films for each sample and to facilitate comparison among them.

Table 3 Optical transmittance and band gap energy values of thin films produced in the form of nanodots depending on film thickness

An increase in the optical transmittances of the samples in the F1 group is observed in the visible region, correlating with the number of coatings. On the contrary, it is understood that the optical transmittance values of samples in the Z and F1B groups generally decrease for the same region as the number of layers increases. It is also noteworthy that the band gap decreases as the optical transmittance decreases for all sample groups. The increase in the refractive index of samples with decreasing optical transmittance may have led to a decrease in the band gap [47]. In our study, as the thickness of the thin films increases, the refractive index also increases. For example, while the refractive index is 1.5 for the F1B4 sample, it increases to 1.58 for F1B10 sample. This trend is also observed in other sample groups.

Optical transmittance graphs of thin films are used not only to understand the optical properties of samples but also to calculate the thickness of thin films. In this study, each sample type was coated 4, 6, 8, and 10 times on glass and Si substrates. The thickness of the thin films was approximately determined based on the number of coating layers using the Swanepoel method [48, 49]. In this method, the estimated thickness of thin films is obtained by processing the data of interference fringes in the optical transmittance graph through Eq. (8).

$$d=\frac{{\lambda }_{1}{\lambda }_{2}}{{\lambda }_{1}{n}_{2}-{\lambda }_{2}{n}_{1}},$$
(8)

where \({n}_{1}\) and \({n}_{2}\) are the refractive indices calculated from two consecutive maximum (TM) or minimum (Tm) point of interference fringes at wavelengths \({\lambda }_{1}\) and \({\lambda }_{2}\) in the transmittance–wavelength graphs. In this study, estimated thickness calculations of thin films were made using envelope analysis in the Origin program. The obtained results are presented in Table 4.

Table 4 The estimated thickness of thin films depending on coating numbers using Swanepoel method

As the number of coatings increases, the thickness of thin films also increases. In the sample group where only Fe and B are doped together, the thickness of the 8 layers of coated thin film is greater than the thickness of the 10 layers of coating sample. This result is consistent with the optical transmittance analysis results. It was likely caused by human error during coating, resulting in a larger amount of solution being sprayed during each coating.

PL analysis was performed at room temperature to compare the band gap of the samples with the results obtained from the optical transmittance analysis and to determine the levels that may arise due to defects in the forbidden band gap. The PL emission spectra for 6 layers of coated undoped ZnO, 6% Fe-doped ZnO, and 6% Fe-4% B co- doped ZnO thin films are shown in Fig. 6.

Fig. 6
figure 6

PL spectrum of a pure ZnO, b Zn0.94Fe0.06O, and c Zn0.90Fe0.06 B0.04O

When examining the PL graphs, it is evident that nearly identical spectra are obtained, especially for the Fe-doped ZnO and Fe–B co-doped ZnO thin films. Pristine ZnO exhibits a peak at 364 nm. This energy value, approximately corresponding to 3.4 eV, may represent the band gap energy. Additionally, there is a peak around 495 nm (2.5 eV) in the visible region. The Fe-doped ZnO thin film exhibits a prominent peak at 353 nm (approximately 3.5 eV), which can be attributed to the band gap energy of this semiconductor material. Additionally, two small peaks are observed at 487 nm (2.54 eV) and 509 nm (2.44 eV) for Fe-doped ZnO. The band gap energy of the Zn0.94Fe0.06O sample is found to increase compared to pure ZnO. This increase in band gap energy may be related to the reduction in the size of the nanoparticles in the structure or the shift of the Fermi level to the conduction band due to excessive doping. A peak at 376 nm, corresponding to the band gap of 3.29 eV, is observed for Zn0.90Fe0.06B0.04O. Similarly, this sample emits radiation in the visible region around 478 nm (2.59 eV) and 509 nm (2.44 eV). The emissions in the visible region may be likely caused by point defects resulting from zinc vacancies or oxygen vacancies. The results indicate that the co-doping of Fe and B leads to a narrowing of the band gap. In this case, the narrowing of the band gap can be attributed to the energy levels associated with dopant ions and defects within the lattice. As a result of Fe doping, donor energy levels are formed, strengthening the n-type conductivity of ZnO. On the other hand, B doping is likely to lead to the formation of shallow acceptor-type defect levels such as zinc vacancies. Additionally, this latter scenario is consistent with the results obtained from EDS analysis. Depending on this situation, various transitions may be possible. These transitions could arise from the conduction band to the valence band/shallow acceptor-type defect levels, from donor levels to the valence band, or between donor and acceptor-type defect levels. We can say that these results are almost compatible with the results obtained from optical transmittance analysis.

3.3 Electrical properties of thin f ilms

Before investigating the impact of the film thickness on the electrical properties of ZnO, the effects of dopant elements on the carrier density were analyzed. Consequently, Hall measurements, one of the electrical analyses, were conducted on thin films to determine the carrier density and semiconductor type for each sample. Hall measurements were applied to thin films produced with 6 layers coating on glass substrates using the spraying method. The results obtained from the Hall measurements are provided in Table 5.

Table 5 Hall analysis results of doped and pristine ZnO thin films

As observed from Table 5, the negative values of the Hall coefficient and carrier densities for both pristine ZnO and other doped samples suggest the production of n-type semiconductor materials. The carrier density of the ZnO thin film increases with only Fe incorporation. This suggests that Fe atoms contribute electrons to the material as free carriers. When B is doped together with Fe, the structure remains n-type, but the carrier density decreases compared to other samples. Although B3+ ion is known as an n-type dopant element, this result shows that it has a high potential to create acceptor-type defect levels such as zinc vacancies and oxygen interstitials within the structure. According to the results of EDS and PL analyses, the inclusion of boron in ZnO suggests an increase in zinc vacancies within the structure, indicating the presence of shallow acceptor-type defect levels. This implies that with boron doping, there is a significant contribution of holes to the system rather than electrons.

After determining the semiconductor type, I–V measurements were taken in the dark between − 3 V and 3 V for each sample group, depending on the film thickness. The measurements were actually taken for samples coated on p-type Si substrates with bottom and top contacts made of Au. To avoid taking up too much space, only I–V graphs of 6 layers of coated samples for each sample type are presented in Fig. 7. All thin film coatings produced in the form of nanostructures (12 samples in total) exhibit diode characteristics. As seen from the images in Fig. 7, all samples display almost non-ideal diode characteristics. An interesting result is observed for pristine ZnO: Negative differential resistance (NDR) is recorded for undoped ZnO at around 1.4 V. For the Zn0.94Fe0.06O sample, the slope of the I–V graph starts to change after around 0.8 V. As the forward bias value increases, the slope decreases. Despite the increase of current at forward voltages in the I–V graphs, the small increase in current can be attributed to the high serial resistance of the contacts or the excessive doping amount [47,48,49,50,51,52,53]. Additionally, the NDR state in pure ZnO can be associated with the tunneling current between the contact and the material [51]. Although the Fe–B -doped ZnO sample exhibits non-ideal diode properties, it is closer to normal diode behavior than the other two diodes.

Fig. 7
figure 7

I–V graph for a Au/ZnO/p-Si, b Au/Fe-doped ZnO/p-Si, and c Au/ Fe–B co-doped ZnO/p-Si diodes

To examine the electrical properties of each sample in more detail, the ideality factor, barrier height, and serial resistance values of all samples were determined. Since all examined ZnO sample types (undoped, Fe-doped, Fe–B co-doped) serve as an interlayer between Si and Au, a MIS structure is created. In particular, it is known that neither Fe-doped ZnO nor Fe–B co-doped ZnO materials have been previously studied as an interlayer between Au metal and p-type Si semiconductor. To find the values of the above-mentioned parameters, the I–V graphs presented in semi-logarithmic form were used, depending on thickness film. Figures 8a–c depict the semi-logarithmic I–V characteristics of Au/ZnO/Fe-doped ZnO/Fe–B co-doped ZnO/p-Si MIS structures, respectively.

Fig. 8
figure 8

Log(I)–V plots for a pure ZnO, b 6% Fe-doped ZnO, and c 6%Fe-4%B co-doped ZnO

The I–V diagram of each diode is defined by the thermionic emission approach as follows [54]:

$$I={I}_{0}\left[\text{exp}\left(\frac{qV}{nkT}\right)-1\right]$$
(9)

where V, n, k, T, q, and I0 depict the applied voltage, ideality factor, Boltzmann constant, temperature, electric charge, and leakage current, respectively. I0 generally can be described as [54]

$${I}_{0}=A{A}^{*}{T}^{2}\text{exp}\left(- \frac{q{\phi }_{b}}{kT}\right).$$
(10)

Here, A is contact area, \({A}^{*}\) is known as the Richardson constant for ZnO with a value of 32 Acm−2 K−2, and \({\phi }_{\text{b}}\) is the barrier height of Schottky diode. The leakage current and ideality factor were determined from Fig. 8. The intercept and slope of the linear region of forward bias values in Fig. 8 provide the value of leakage current and ideality factor, respectively. The barrier height \({\phi }_{\text{b}}\) was found using Eq. (10) at room temperature. Serial resistance of Schottky contact (Rs) was determined from the dV/dln(I) versus I graph using Cheung’s method \(\left(\frac{\text{d}V}{\text{d}(\text{ln}I)}={\text{IR}}_{\text{s}}+\frac{nkT}{q}\right)\) [54]. The slope of the dV/dln(I) against I graph gives the serial resistance of contacts. To save space, the graphs are not included here; only the values are presented in Table 6. Additionally, the built-in voltage (Vbi) values are extracted from the I–V graphs displayed in Fig. 7. The obtained results are given in Table 6.

Table 6 The values of some electrical parameters of thin films

MIS structures, which form Schottky barrier diodes, serve as the foundation for semiconductor electronic devices such as field-effect transistors (FETs), solar cells, and photodetectors. Therefore, it is crucial to thoroughly understand every aspect of their electrical properties. While the I–V graph typically exhibits linearity on a semi-logarithmic scale at low forward bias values, significant deviations from linearity occur as the forward bias value increases, primarily due to factors like serial resistance and interface states. Consequently, non-linear regions emerge in this I–V graph. Although the diode's ideality factor and barrier height are observable in both the linear and non-linear regions of this graph, these parameters exert a greater influence in the linear portion. [55].

As can be seen from Table 6, the ideality factor of thin films in three sample group increases depending on their thickness. Thickness-dependent, highly non-ideal diode behavior can be attributed to interface impurities, surface states, recombination mechanisms, serial resistance, barrier inhomogeneity, and oxide layer [56]. In addition, the increase in oxygen content with the formation of dislocations, and defects during the layer formation process can explain the increase in the ideality factor as the thickness of thin films increases. However, when only Fe doping, and Fe–B co-doping are applied, it is observed that the ideality factor increases compared to pure ZnO for doped samples with fewer layers. Indeed, improvements in the rectification behavior of ZnO diodes are the result of doping. Considering the average ideality factor across all layers, it can be concluded that the Fe–B co-doped diodes exhibit the superior value. While no significant change in barrier height is observed with respect to the thickness of Zn0.94Fe0.06O thin film, a general decrease is observed for the other two samples group. The lowest serial resistance between the metal contacts and the semiconductor is obtained for F1B6 sample. Based on all these findings, it can be concluded that co-doping of Fe and B improves the electrical properties of ZnO.

After evaluating the physical properties of all produced thin films, their device performances in the field of optoelectronics were investigated. For this purpose, the performances of the samples produced as solar cells and photodiodes were determined for each sample according to thickness of films and the effects of dopant elements were discussed. Measurements were conducted for each sample type under dark and 100 mW/cm2 light conditions. These samples were coated on p-type Si substrates using the spraying method, with upper and lower contacts made of Au. Due to the large number of samples, only semi-logarithmic J (current density)–V (voltage) plots of 6 layers coating are shown for each sample type in Fig. 9. However, short circuit current (Isc), open circuit voltage (VOC), fill factor (FF), and efficiency (η) parameters of solar cells are given in Table 7. Fill factor and efficiency of solar cell are identified with the expressions \(FF=\frac{{I}_{\text{m}}{V}_{m}}{{I}_{\text{sc}}{V}_{\text{oc}}}\) and \(\eta =\frac{{I}_{\text{sc}}{V}_{\text{oc}}FF}{{P}_{\text{in}}}\), respectively. Here, \({P}_{\text{m}}{=I}_{\text{m}}{V}_{\text{m}}\) represents the maximum power of the solar cell, which is determined from the J–V graph, and \({P}_{\text{in}}\) is the power of incident light absorbed by the solar cell. The obtained average results are presented in Table 7.

Fig. 9
figure 9

The J–V graph of a pure ZnO, b Zn0.94Fe0.06O, and c Zn0.90Fe0.06B0.04O for photovoltaic application

Table 7 Results on photovoltaic cells with Au electrodes

According to the values provided in Table 7, as the thickness of pristine ZnO increases, the efficiency of the solar cell decreases. Conversely, it is observed that the efficiency of Zn0.94Fe0.06O increases with the thickness of film. However, the best result is obtained for 6 layers coating of 6% Fe-4% B co-doped ZnO sample (F1B6) with 0.04% of efficiency. These results indicate that dopant elements enhance the efficiency of relatively pure ZnO as a solar cell. The shallow acceptor-type defect levels created by the B element within the structure, along with the donor-type defect levels predominantly formed by Fe, Zn, and O ions within the structure, may have facilitated greater utilization of visible light. Meanwhile, a coating thickness of 6 layers may be the optimal thickness to absorb sunlight. However, it is obvious that the solar cell efficiency of all samples, especially the Z sample group, is not very high. This could be attributed to the previously identified high series resistances or the notably low shunt resistance. Shunt resistance values were calculated in the range of 2–150 Ω. The high series resistance may be related to the use of Au as a contact material. Additionally, the low shunt resistance may be due to the formation of pores in the structure during thin film coating. One of our objectives in this study is to develop coatings that are inexpensive, facile, and applicable to large areas. While the applied sol–gel spray method may serve this purpose, it might have hindered the homogeneous formation of the thin film. Nevertheless, the Zn0.90Fe0.06B0.04O sample shows promising potential in this field with a relatively high solar cell efficiency of around 0.04%, which could be considered relatively high for ZnO-type materials.

To perform photodiode measurements, changes in leakage currents of 6 layers of coated samples were examined at feedback voltage in the range of − 3 to 0 V in both dark and light (power of 100 mV/cm2) conditions (Fig. 10). Graphs for other samples are not given here due to space constraints. The photodiode analysis revealed that the presence of only the Fe element within ZnO is not suitable for photodiode applications. In the F1 sample type, there is a negligible increase in leakage current under light. However, it is observed that the samples considered as photodiodes within each sample group exhibit similar characteristics within their own groups. Nevertheless, the Zn0.90Fe0.06B0.04O samples yielded the best results once again. This study demonstrates that the F1B6 sample could potentially serve as a photodetector for the visible region due to its response to visible light. The sensitivity of the Fe–B co-doped material to visible light may have increased owing to defects caused by different types of doping (donor-type and acceptor-type defect levels) or the distinct ionic diameters of the Fe and B atoms used as dopant elements. Fe–B co-doped ZnO has not been previously investigated as a photodiode. However, the photodetector properties of Fe-doped ZnO and pure ZnO materials were examined for the UV region [57, 58]. Overall, our results indicate that Fe and B elements enhance the development of the MIS-shaped diode structure in optoelectronic applications.

Fig. 10
figure 10

Photodiode properties of 6 layers of coated a pure ZnO, b Fe-doped ZnO, and c Fe–B co-doped ZnO

We previously mentioned that the obtained low efficiency as a solar cell could be attributed to the Au metal contacts. Therefore, instead of Au, the Al element was chosen as the contact material this time. Due to the multitude of samples, the effect of the contact material was investigated only in the 6 layers of coated Zn0.90Fe0.06B0.04O sample, which previously demonstrated the best results with Au contacts.

In fact, the J–V graph given in Fig. 11 explains very well all the physical parameters we want to investigate for the sample with Al contacts. From the measurements taken under light and dark conditions, it can be seen that the sample performs very well as a solar cell. The current density in the J–V graph shifts to the 4th quadrant region, indicating efficient power generation under illumination. Additionally, its diode properties are almost close to ideal, further highlighting its potential as a high-performance photovoltaic material. The obtained average results about photovoltaic cell are summarized in Table 8 for Al contacts.

Fig. 11
figure 11

J–V graph of 6 layers of coated Zn0.90Fe0.06B0.04O sample for Al contacts

Table 8 Photovoltaic analysis results for 6 layers of coated Fe–B co-doped ZnO thin film using Al contacts

It is evident that the obtained results for Al electrodes in solar cells are significantly better than the results previously achieved with Au. The solar cell efficiency of the F1B6 sample increases from 0.04% to almost 0.09% with the Al contacts. Perhaps the ohmic contact property required for solar cells can be better provided by Al than Au.

Figures 12a and b show the I–V characteristics of the 6 layers of coated Zn0.90Fe0.06B0.04O sample in linear and semi-logarithmic scales, respectively. The ideal I–V characteristic is approached with the Al contacts. The electrical parameters obtained from these graphs are given in Table 9.

Fig. 12
figure 12

a Linear I–V graph, and b Log (I)–V graph for 6 layers of coated Zn0.90Fe0.06B0.04O sample with Au and Al contacts

Table 9 The electrical parameters and their values for Al contacts

It can be seen that the serial resistance between the contacts and interlayer materials decreases for Al contacts. This provides better results in optoelectronic applications.

4 Conclusions

The primary aim of this study is to investigate the effects of two dopants with different ionic diameters on the physical properties of ZnO material. To achieve this objective, 6% Fe-doped ZnO and 6% Fe-4% B co-doped ZnO thin films were fabricated on glass and Si substrates using sol–gel dip coating and spraying methods. One of our other aims is to determine the effects of thin film thickness for each sample type (4, 6, 8, and 10 layers of coatings for each sample group), especially on the optoelectronic properties of ZnO. It is observed that wurtzite ZnO polycrystalline samples with the preferred orientation along the (002) plane are formed. However, it is understood that due to defects formed during doping, especially in the case of Fe–B co-doped samples, the crystal structure is disrupted and tends toward an amorphous structure. The surface morphology of all samples consists of nanodots. However, it has been noticed that as dopant elements are added to ZnO, the surface morphology becomes homogeneous and the particle size decreases. In this sense, the best result in morphologically is obtained for the sample doped with 6% Fe-4% B together. The ability of the B element to fill vacancies within the structure, owing to its small ionic radius, has resulted in the most homogeneous and smooth surface morphology for the F1B sample type. In addition, parameters such as lattice constants and interplanar space of this sample type are reduced compared to ZnO, and it exhibits a different behavior from the other two sample groups in terms of microstrain feature (compressive form). The reason for this could be that the atomic radii of Fe and B elements are smaller than that of Zn. The obtained results suggest that the Fe+3 ion may be more dominant in the structure. The highest optical transmittance in the visible region is observed in the Fe-doped ZnO, while the lowest value is obtained in the Fe–B -doped sample group (F1B8). As the thickness of the thin films in all sample groups increases, their optical transmittance in the visible region decreases. It is observed that as the optical transmittance of thin films decreases, the band gap also decreases. This is attributed to the increasing refractive index. Although all sample groups were n-type semiconductor, a decrease in carrier density was noticed compared to other sample groups due to the presence of acceptor-type defect levels formed in the structure with B doping. It is observed that doping leads to an increase in the ideality factor for samples with low coating layers, while simultaneously decreasing the barrier height. As the film thickness increases for each sample group, the ideality factor of the samples also increases. Again, the best results in this regard are obtained for Au/Zn0.90Fe0.06B0.04O/p-Si diodes. The 6 layers of coated Zn0.90Fe0.06B0.04O sample exhibits the best performance as both the solar cell and the photodiode. Since the best results are generally obtained for the 6 layers of coated Zn0.90Fe0.06B0.04O sample for optoelectronic applications, this sample is contacted with the Al element to understand the effect of the contact material on the optoelectronic properties. From the measurements taken with the 6 layers of coated Al/Zn0.90Fe0.06B0.04O/p-Si diode, it is understood that the best contact type for optoelectronic applications is Al.

This study concludes that with the Al contact and Fe–B co-doping coating with 6 layers, the electrical, optical, structural, and optoelectronic (such as solar cell and photodiode) properties of ZnO material are significantly improved.