1 Introduction

With the current rate of population increase, the global energy demand is projected to increase to 30 TW by the year 2050. High fossil fuel usage is causing serious environmental pollution and global warming, which triggered the scientific community to search for sustainable energy options [1]. Among the existing energy sources, which include tidal power, wind power, solar thermal power, and hydropower, photovoltaic technology seems to be the most effective [2]. The solar cell, being a photovoltaic cell, is capable of converting sunlight directly into electrical energy [3]. However, the available materials for solar cell fabrications remained both a scientific opportunity and a challenge for researchers to have clean, inexpensive, and renewable energy [1]. The first commercially available solar cells were made of Pb and had a power conversion efficiency (PCE) of about 15–20% [4]. Though these compositions are highly stable, they are not exciting because of their carcinogenic nature. So there is an urgent need to substitute this Pb-based composition with some Pb-free compositions without compromising its stability and PCE. This aim opened a new debate among the scientific community to adopt new and novel strategies to synthesize next-generation solar cells. In the last decade, considerable work has been devoted to synthesizing the dye-sensitized solar cell (DSSC). The first dye-sensitized solar cell (DSSC) was reported by Grätzel and O’Regan, which received considerable interest from the researchers because of their high conversion efficiency up to ~ 10%, simplicity of manufacturing, and low cost of production [5]. The DSSC is a third-generation solar cell with a production cost of roughly 1/3 to 1/5 times less than Si-based solar cells. The number of studies of metal complexes for photovoltaic applications has improved this efficiency. In DSSCs, the interaction of dye molecules with the porous thin film of a wide bandgap semiconductor plays a pivotal role in defining its efficiency. The material with sponge-like morphology and a larger surface area is an efficient choice for photoelectrodes. The efficiency of DSSC is fundamentally controlled by the transport capabilities of electrode materials and electron injection [6]. It has been reported that the number of electrons injected into wide-bandgap nanostructured semiconductors has a direct relationship with the overall conversion efficiency of DSSCs. So far, the small cells currently exhibit a record efficiency of around 11.1%, and large-scale experiments have made it clear how urgent the commercialization of DSSCs is. As a result, DSSCs are superior to Si-based solar cells in terms of (i) position of the dye's border molecular orbitals, i.e., HOMO and LUMO, (ii) Fermi level of scaffold material, and (iii) redox potential of electrolyte [7]. The dye molecule’s HOMO and LUMO energy gaps should be small enough that photon absorption can easily excite electrons from the ground to an excited state. For uninterrupted electron flow from dye to TiO2 material, the LUMO of the dye molecule must lie below the conduction band of TiO2. The electronic transfer from photoanode to counter electrode makes the working of the DSSC very interesting, as shown in Fig. 1.

Fig. 1
figure 1

Schematic diagram of the working principle of DSSCs (adopted from [8])

The central part of the DSSCs is the mesoscopic semiconductor oxide sheet that is in contact with either an organic hole conductor or a redox electrolyte. The monolayer of dye sensitizer is affixed to the film of nanocrystalline material. When exposed to sunlight, the dye sensitizer absorbs a photon (light), and if the energy of the photon is sufficient to promote electrons of dye molecules from the HOMO to the LUMO level, it becomes photoexcited. The holes present in dye molecules at the interface and electrons in TiO2 set up the charge separation that is essential for DSSCs to work. The dye molecules adsorbed at the surface provide electrons from the LUMO level of dye to the anatase phase of TiO2, which has smaller energy levels than the excited state of dye molecules [9].

The rear contact of the working electrode becomes active when the charge collection takes place after the electrons have been transported via the porous TiO2 network. When these charged particles return to the counter electrode, the Pt coated on the FTO substrate in the form of Pt2+ captures these incoming electrons and reduces them to Pt. This Pt once again oxidizes by donating one electron to the iodine electrolyte, which is ready to perform the redox reaction and thus regenerate dye molecules [10]. The iodine molecule (I2) and iodide ion (I), are typically united to form I3 in the electrolyte. Iodide ions (3I) are formed during the process of accepting electrons from the counter electrode [11]. These ions are oxidized again by giving electrons to the dye, which yields triiodide ions. Finally, the liquid electrolyte will reduce the oxidized dye and thus complete the reaction. The voltage produced during this process is determined by the electrolyte's redox potential and the electron Fermi level of solids. In general, the device produces electric power from light without undergoing any long-term chemical changes [12]. MoO3, SnWO4, CuWO4, TiO2, and V2O5 are the dye-sensitized nanocrystalline semiconductor photoanodes used in DSSCs. The stability of TiO2 in three different phases, anatase, rutile, and brookite, makes the TiO2-based DSSCs the most astounding among all available options. The high chemical stability, high conduction band edge energy (3.2 eV), and low synthesis temperature make the anatase phase very attractive for the photoanode in DSSC. Rutile's conduction band edge energy, in contrast, is around 3 eV [13]. Due to the high packing density of rutile TiO2, which prevents electron transmission, anatase-based DSSCs produce a 30% higher short circuit current than rutile-based DSSCs for the same film thickness [2]. TiO2 is a good photoanode, although its efficiency is constrained by a high recombination rate. To lower the recombination rate and current density of TiO2, doping has been one of the methods that has received the most attention. TiO2 has already been reported to be modified by dopants such as Cd, Ni, Cu, Zn, Co, Sn, W, Fe, and Au for specific and intended uses. To solve the problem of quick recombination and increase the current density of DSSCs, doping with Cd is suggested as the optimum crystal-modified element. Cadmium (Cd) is a suitable dopant for titanium dioxide (TiO2) owing to its specific properties and compatibility with the crystal lattice of TiO2. A key factor in its suitability is the ionic radius of Cd, which, at 0.97 Å, is very similar to the ionic radius of titanium (Ti4+) ions in TiO2. This similarity enables Cd to seamlessly substitute for Ti in the crystal lattice. The introduction of Cd into the TiO2 lattice creates new energy levels within the bandgap, leading to a modification of the material's electronic structure. This alteration plays a crucial role in diminishing the rate of electron–hole recombination, a significant factor in enhancing the efficiency of optoelectronic devices utilizing TiO2, such as solar cells or photocatalysts. Furthermore, experimental findings validate that Cd doping in TiO2 markedly improves the absorption of visible light and facilitates a more efficient transfer of electrons across the interface. The notable enhancement in solar cell performance observed with Cd doping is predominantly ascribed to the increased short-circuit current density (Jsc). The augmented Jsc signifies that more electrons are effectively generated, contributing to an enhanced photocurrent and ultimately resulting in higher overall efficiency in solar energy conversion. The heterostructure also suppresses the rate of recombination through doping. The lattice mismatching is crucial when creating heterostructures because most of the time heterostructure formulism makes the structure unstable [8]. To overcome this challenge, we created a heterostructure comprising pure and doped material using a straightforward procedure. The material in this kind of heterostructure is highly crystalline and stable. Additionally, since the electrolyte is exposed to two layers, corrosion will be minimal. The other layer will continue to connect the cell if one layer is damaged by the electrolyte. Meanwhile, the heterostructure prevents the electrolyte from contacting the FTO and creating a short circuit. To lower the recombination rate and increase the current density, Cd–TiO2@TiO2 heterostructures have been fabricated, which pave the path to stable heterostructure design for additional electrochemical and optoelectronic devices and open a new debate for the research community. The broad research scope that this study presents creates opportunities for the developed technologies to be applied in a variety of optoelectronic devices. Apart from the direct focus on dye-sensitized solar cells (DSSCs), various optoelectronic applications may benefit from the knowledge gathered from the study of Cd-doped TiO2 and Cd–TiO2@TiO2 heterostructures. These could be sensors, light-emitting diodes (LEDs), photodetectors, and photocatalysts, among others. The distinct characteristics and improved performance noted in the context of solar cells imply that these materials and heterostructures may find flexible applications in a variety of devices, thereby advancing a range of optoelectronic technologies. The results of this study pave the way for additional investigation and debate among scientists, fostering cooperative endeavors to fully use these materials' potential in tackling complex problems and strengthening the discipline of optoelectronics. The heterostructure also suppresses the rate of recombination through doping. The lattice mismatching is crucial when creating heterostructures because most of the time heterostructure formulism makes the structure unstable. To overcome this challenge, we created a heterostructure comprising pure and doped material using a straightforward procedure. The material in this kind of heterostructure is highly crystalline and stable. Additionally, since the electrolyte is exposed to two layers, corrosion will be minimal. The other layer will continue to connect the cell if one layer is damaged by the electrolyte. Meanwhile, the heterostructure prevents the electrolyte from contacting the FTO and creating a short circuit. To lower the recombination rate and increase the current density, Cd–TiO2@TiO2 heterostructures have been fabricated, which pave the path to stable heterostructure design for additional electrochemical and optoelectronic devices and open a new debate for the research community.

2 Experimental setup

2.1 Material synthesis

2.1.1 Synthesis of titanium dioxide (TiO2)

The sol–gel method was employed for the synthesis of TiO2. In this process, 20 ml of titanium tetraisopropoxide was combined with 20 ml of ethanol through continuous stirring for 7–10 min. Simultaneously, a second solution was prepared by mixing 24 ml of nitric acid (HNO3) with 8 ml of distilled water. This second solution was then added to the homogeneous titanium-containing mixture. The entire combination formed a gel as a result of continuous stirring. To complete the drying process, the gel was placed in an oven set at 80 °C for 3 h. After the drying process, a white precipitate was produced, which was then finely turned into a powder. This white-colored fine powder was then placed into a muffle furnace and annealed at 450 °C for 2 h. The material was removed from the furnace and processed again until fine nanoparticles were obtained.

2.1.2 Synthesis of cadmium-doped titanium dioxide (Cd–TiO2)

For Cd doping, the sol–gel method was employed. 20 ml of titanium tetraisopropoxide (TTIP) and 20 ml of ethanol were stirred for 10 min. Subsequently, 3% of 0.1 M CdCl2 was introduced into this solution through continuous stirring. A mixture of 24 ml of nitric acid (HNO3) and 8 ml of deionized water (D.I. water) was added to the solution, and continuous stirring for 30 min resulted in the formation of a gel. The gel was then dried in an oven at 80 °C for 3 days. After drying, the powder was annealed at 450 °C for 2 h in a muffle furnace. Following the annealing process, the doped material was crushed to produce fine nanoparticles of Cd–TiO2.

2.1.3 Synthesis of heterostructures (TiO2@Cd–TiO2 and Cd–TiO2@TiO2)

Heterostructures were synthesized using cadmium-doped titanium dioxide (Cd–TiO2), titanium dioxide (TiO2), and distilled water. For the fabrication of TiO2@Cd–TiO2, a solution of 0.1 mol of TiO2 was initially prepared, and then nanoparticles of Cd–TiO2 (0.1 mol) were added. The process was repeated, followed by drying to obtain a fine powder. Similarly, for the fabrication of Cd–TiO2@TiO2, a solution of 0.1 mol of Cd–TiO2 was first prepared, and nanoparticles of TiO2 (0.1 mol) were added. The same drying process was repeated to obtain a fine powder.

2.1.4 Characterizations

Using a \(CuK_{\alpha }\) source with a 1.5406 Å wavelength, the Bruker D8 X-ray diffractometer was used to determine the crystal structure. The operating voltage and current used for this characterization were 40 kV and 100 mA, respectively. Field emission scanning electron microscopy was used to analyze the materials' surface morphology (FE-SEM, Nova-450). The optical properties of the materials were assessed using the spectrophotometer Agilent 8453.

2.2 Cell fabrication and photovoltaic measurements

For photovoltaic measurement, the cell assembly is designed by pasting the pristine and Cd-doped TiO2, TiO2@Cd–TiO2, and Cd–TiO2@TiO2 nanostructures on FTO glass substrates using a doctor blade. The electrodes were sintered for 120 min at 450 °C, and these sintered samples were soaked in a Ru dye and ethanol solution for 24 h. The platinum paste was used to make the collector electrodes. To facilitate the redox process, a mixture of 0.5 M LiI, 0.05 M I2, 0.6 M TBP, and 0.6 M HMII in MPN were employed. To perform solar cell testing, a Keithley 2611 source meter (Keithley Instruments, Inc.) was used, and a solar simulator AM 1.5 was used for incident light with an intensity of 100 mW cm−2, and the working area for all these measurements was limited to 0.2 cm2.

3 Results and discussion

3.1 X-ray diffraction analysis

Figure 2 displays the XRD peaks of the synthesized samples in the 20–70°, 2θ range. These XRD patterns were indexed, and the Miller indices corresponding to these diffraction peaks are mentioned on top. These Miller indices were (101), (004), (200), (211), and (213) corresponding to the X-ray diffraction peaks that appeared at 25.33, 37.95, 48.02, 55.17, and 62.33 2θ values. It has been observed that these peaks were well matched with the PDF card # 21-1272 and confirmed the formation of the anatase phase of TiO2. In Cd–TiO2 samples, the same Miller indices were observed while the peaks were little shifted toward the smaller angle, and the intensity of the peak increased. No other peaks related to Cd–Ti, CdO, etc. were seen, which is an undeniable evidence that Cd was doped into TiO2 without bringing any structural distortion. No other peak can be seen in the Cd–TiO2 graph, which is an undeniable evidence that Cd was doped into TiO2 without bringing any structural distortion. The stability of the anatase phase persists even in the formation of heterostructures, as can be witnessed from the XRD patterns of TiO2@Cd–TiO2 and Cd–TiO2@ TiO2. This high-intensity peak is observed by the sample of Cd–TiO2@ TiO2, which showed high intensity.

Fig. 2
figure 2

X-ray diffraction analysis patterns of TiO2, Cd–TiO2, TiO2@ Cd–TiO2 and Cd–TiO2@ TiO2

According to published reports, a high dopant concentration may result in the accumulation of dopants and can give rise to some new phases [14]. It is important to note that even with heterostructure semiconductor materials, no rutile peak was seen. The emerging peaks in all four materials maintain the same planes with Miller indices of (101), (004), (200), (211), and (213), which are identical to those of pristine TiO2. However, with doping, the peaks grow more pronounced and narrower, and particularly the heterostructure materials show increased tilting toward lower angles. This is the first success of this work to grow the pristine TiO2, Cd–TiO2, TiO2@ Cd–TiO2, and Cd–TiO2@ TiO2 heterostructures, and these heterostructures have great potential for DSSC applications [15].

Crystallite size is one of the key structural parameters that determines the extent of crystal growth and is usually calculated using Scherrer’s formula: D = 0.9λ/βCosθ, where θ, β, and λ are diffraction angle, full width at half maxima, and wavelength of incident X-rays. In addition, the value 0.9 is the shape factor. Since the value of crystallite size is directly linked to the peak’s shape, a larger peak corresponds to a larger crystallite size. It has been noticed that Cd doping made the peak thinner, which reflects the growth of crystallite size. Similarly, in the formation of heterostructures, the peaks became sharper, which proved that the heterostructure formation approach is a suitable option to get a larger crystallite size. The same type of attempt is made in the literature by choosing different dopants such as Zn, Sn, and Cr and observing smaller crystallite sizes [16]. A larger crystallite size facilitates electronic transportation by minimizing the charge trap at the grain boundaries and thus improving the device's efficiency. In addition, this increase in grain size will decrease the charge trapping sites noticeably and yield a better current density [17]. It has been proposed that the material with a larger crystallite size is preferable for DSSC applications, and there might have been some favorable conditions for the production of larger particle sizes in the absence of any other TiO2 phases [18].

X-ray diffraction is a powerful technique that can be used to calculate the d-spacing of any crystalline material. The d-spacing for pristine TiO2 was noticed at 3.50 Å which slightly increased to 3.51 Å for Cd–TiO2. This slight increase in d-spacing has been attributed to the incorporation of Cd at the interstitial sites [19]. For both heterostructures: TiO2@Cd–TiO2 and Cd–TiO2@TiO2 the d-spacing is further increased and noted as 3.52 Å. Identical d-spacing value for heterostructures indicates that these formalisms grow in a quite similar fashion and that new materials with comparable structures have formed. In addition, this increase in d-spacing is also consistent with a slight shifting of peaks in X-ray diffraction patterns [20].

Table 1 summarizes the calculated values of lattice parameters, and interestingly, it has been observed that the unit cell of pure TiO2 expanded a little when it accommodated Cd. This increase in lattice parameters is associated with the larger ionic radii of Cd2+ as compared with Ti4+. It is intriguing that the parameter a is compressed when heterostructures are formulated, whereas the parameter c is noticeably extended. A novel environment for charge transport is provided by these modified parameters in addition to the production of new materials. Modified lattice parameters considerably reduce the rate of charge recombination [21, 22].

Table 1 Lattice parameters of pristine TiO2, Cd–TiO2, TiO2@Cd–-TiO2 and Cd–TiO2@TiO2 nanostructures

3.2 Scanning electron microscopy analysis

Figure 3 displays the SEM images of TiO2, Cd–TiO2, TiO2@Cd–TiO2, and Cd–TiO2@TiO2 samples captured at 100,000× magnification which uncovered the minor details of the surface of the sample and provided better estimation regarding the particles size, particle’s distribution, surface roughness, and texture. For the parent composition, that is, the pristine TiO2 exhibited well-shaped spherical grains with sharp and distinct boundaries. These particles are well connected, leaving behind little pores. The particle size was estimated using the Java-based software ImageJ, and the average particle size was found to be 53 nm, as shown in Fig. 3a. When a small amount of Cd is doped, it increases the surface energy and facilitates particle agglomeration, which is evident from Fig. 3b. However, using the heterostructure formalism, we obtained particle dispersion in densely stacked layers, which provides a better opportunity for electronic transportation, as shown in Fig. 3c and d. This unpolished surface is more absorbent for dye and, therefore, thought to be better suited for effective DSSCs [23].

Fig. 3
figure 3

SEM images of TiO2, Cd–TiO2, TiO2@Cd–TiO2 and Cd–TiO2@TiO2 films

3.3 UV–Vis analysis

The absorbance capabilities of the four semiconductor materials, TiO2, Cd–TiO2, TiO2@Cd–TiO2, and Cd–TiO2@TiO2, were evaluated by recording their absorption spectra using a UV–visible spectroscope. Any semiconductor material used to fabricate the photoanode for the DSSC is supposed to be a good absorber [24]. The absorption spectrum for heterostructures is shown in Fig. 4a. The absorbance spectra revealed that Cd doping increased the absorption of pure TiO2, which is attributed to the localized electron exchange activity [25]. However, the conduction barrier of TiO2 is controlled by the 3d electrons. In the case of heterostructure formation, TiO2@Cd–TiO2 and Cd–TiO2@TiO2, the effect of absorbance favorability becomes more pronounced. Increased absorbance below the UV region is significantly influenced by the absence of the rutile phase [26]. The change in absorbance is primarily attributed to heterostructures' increased grain size and lattice parameters [27]. Upon observing the morphology of Cd–TiO2@TiO2 (Fig. 3c), it is evident that its surface is remarkably smooth in comparison to the others. Additionally, both SEM and XRD analyses indicate a larger grain size for this film. The quantum confinement effect comes into play, where a higher grain size leads to a smaller bandgap energy and a shift in the absorbance peak towards longer wavelengths. Therefore, the absorbance of the Cd–TiO2@TiO2 sample is high. The best properties for absorbance in heterostructures are shown by Cd–TiO2@TiO2.

Fig. 4
figure 4

Absorbance and transmission spectra of TiO2, Cd–TiO2, TiO2@Cd–TiO2 and Cd–TiO2@TiO2 heterostrucutres

The transmission capability of each semiconductor was evaluated, and the results are shown in Fig. 4b. For photoanode materials, high transmittance in the visible portion of the spectrum is a highly desirable property [28]. Figure 4b depicts a visible region with a relatively high transmittance. Comparatively speaking, the heterostructures revealed better transmission in the visible range of the electromagnetic spectrum, and the highest value of transmission is recorded for Cd–TiO2@TiO2, which makes this composition adequate for DSSC applications. The high transmission reflects the ability of semiconductors to generate charges for the functioning of DSSCs [29].

3.4 Dielectric constant

The real (εr) and imaginary (εi) parts of the dielectric constant for all the samples are presented in Fig. 5. εr is associated with the absorption of the material, and a material having a larger value of εr is a good absorber. It is evident from Fig. 5a that all samples reveal good absorption in the UV region of the electromagnetism spectrum, which supports the finding of absorbance spectra. However, in the visible range, the value of εr is small and reflects a small reflection in this region. The imaginary part of the dielectric constant determines the dispersion of light from the material. It is observed that the trend of εi is somehow identical to that of εr. It means pure and Cd-doped TiO2 as well as heterostructure compositions show good absorption as well as good dispersion in the UV region of the spectrum.

Fig. 5
figure 5

Real and imaginary parts of dielectric constant for TiO2, Cd–TiO2, TiO2@Cd–TiO2 and Cd TiO2@TiO2 heterostrucutures

3.5 Refractive index

The refractive index is one of the key optical parameters that quantifies the response of a material to external light, and it depends upon the polarization of ions present inside them and the local electric field. The refractive index (n) is linked with the reflection (R) and extinction coefficient (k) as:

$$n=\left(\frac{1+R}{1-R}\right)+\sqrt{\frac{4R}{{\left(1-R\right)}^{2}}-{k}^{2}.}$$
(1)

The value of n versus the wavelength of incident light is plotted in Fig. 6, which shows a peak value in the UV region and then becomes constant in the visible spectrum of light. According to Fig. 6, the refractive index of all materials increases with the increase in wavelength, reaches a maximum value, and then begins to fall. The lowest refractive index is shown by the semiconductor material Cd–TiO2@TiO2, while the highest refractive index is shown by pure TiO2. After reaching a particular maximum value, the value of n began to decrease. This decrease in the value of n is attributed to the decrease in surface optical dispersion and optical losses. These optical losses are caused by increased charge concentration and decreased surface roughness due to newly produced materials as a result of doping [30,31,32]. When compared to non-heterostructure materials, heterostructure materials such as TiO2@Cd–TiO2 and Cd–TiO2@TiO2 show reduced refractive responses.

Fig. 6
figure 6

Refractive index (n) of TiO2, Cd–TiO2, TiO2@Cd–TiO2, and Cd–TiO2@TiO2 films

3.6 Optical bandgap

The optical bandgap (Eg) is the most important parameter, which plays a pivotal role in controlling the optical conductivity of the material. The analysis of the Tauc plot is an appropriate way to estimate the bandgap values, which are presented in Fig. 7. The value of Eg for TiO2 was noticed as 3.43 eV, and when a nominal amount of Cd was incorporated, the value of Eg was slightly reduced to 3.32 eV. This reduction of bandgap value shows the ease of electronic transition from the valence to the conduction band that is attributed to the creation of new dopant levels in the bandgap by the inclusion of Cd doping [33]. In addition, the introduction of Cd into TiO2 creates some electron capture and thus helps to suppress electron–hole recombination [34]. The bandgap value was further reduced for heterostructure formulism, and it was noticed as 3.28 eV, and 3.24 eV for TiO2@Cd–TiO2, and Cd–TiO2@TiO2, respectively.

Fig. 7
figure 7

Energy bandgap of TiO2, Cd–TiO2, TiO2@Cd–TiO2 and Cd–TiO2@TiO2 films

Furthermore, the red shift in the absorption edges indicates that the bandgap of Cd–TiO2@TiO2 is the smallest, while that of pure TiO2 is the largest. When heterostructures are produced, the bandgap is slightly reduced since the rutile phase is not present. The inherent properties, in conjunction with enhanced light sensitivity in the visible region, are made possible by the presence of a Cd dopant in Cd–TiO2@TiO2. The increased light scattering and absorption are made possible by the narrow bandgap [35].

3.7 Photovoltaic performance

Figure 8 shows the JV characteristics of various DSSCs nanostructures, and these graphs were used to calculate the key performance parameters like open circuit voltages (Voc), current density (Jsc), and fill factor (FF) and the calculated values of all these factors are provided in Table 2. The calculation of Jsc involves the initial number of photogenerated carriers, the recombination rate of electron–hole pairs, and injection efficiency. The recombination rate depends on the number of injected electrons, redox species, and oxidized dye molecules. The open circuit voltage, fill factor, and efficiency are calculated as:

$$V_{{{\text{oc}}}} = \left| {E_{{\text{F}}} - E_{{{\text{redox}}}} } \right|$$
(2)
Fig. 8
figure 8

JV measurement of TiO2, Cd–TiO2, TiO2@Cd–TiO2 and Cd–TiO2@TiO2 photoanodes-based dye-sensitized solar cells

Table 2 Parameters of different DSSCs
$$\eta =\frac{{\text{FF}}\times {V}_{{\text{oc}}}\times {J}_{{\text{sc}}}}{{p}_{{\text{in}}}},$$
(3)
$${\text{FF}}=\frac{{I}_{{\text{max}}}\times {V}_{{\text{max}}}}{{J}_{{\text{sc}}}\times {V}_{{\text{oc}}}}.$$
(4)

Here, EF is the fermi level and Eredox depends upon the energy levels of electrolyte, i.e., (\({{\text{I}}}^{-}/{{\text{I}}}_{3}^{-}\)). In addition, Pin, Imax, and Vmax are input power, maximum current, and maximum voltage, respectively. The larger value of Voc shows a large difference between EF and Eredox. It is evident from Table 2 that the values of Jsc, Voc, FF, and efficiency (η) for pure TiO2 are recorded as 6.04 mA/cm2, 0.76 V, 0.571, and 2.622%, respectively. The inclusion of 1% Cd improved the values of Jsc (7.35 mA/cm2), Voc (0.762 V), FF (0.653), and η (3.66%). The increase in the value of Jsc is attributed to the transfer of electrons from the HOMO of dye to the LUMO of TiO2, which is the active contact between 1% Cd–TiO2 and dye molecules.

The heterostructure materials with TiO2 riding the cores have a higher absorption capacity due to their high porosity [36]. This is due to the improved adhesion to cores and the increased dye load capacity [37]. Porous nano-meso-microstructures with Cd–TiO2@TiO2 surface characteristics are very advantageous for maximum absorbance and scattering. For the DSSC to function, a favorable environment is provided by loosely packed grains [38]. The morphological structure’s relative roughness is increased by the high porosity. Roughness in Cd–TiO2@TiO2 increases both the number of active sites from the smooth photovoltaic activity and the effective area of the film [39]. The structural arrangement's topography contributes to the photoanode semiconductor material's improved capacity for light harvesting. Because Cd-rich sites are typically thought to be less favorable for charge production activity, this is also reflected in Cd–TiO2@TiO2, where more TiO2 is exposed than Cd.

In the case of heterostructure formulism, these values are further increased and are mentioned in Table 2. The maximum value of η is reported for Cd–TiO2@TiO2 i.e., 4.848%, and the corresponding values of Jsc, Voc, and FF are observed as 8.65 mA/cm2, 0.78 V, and 0.718 respectively. Electron trap sites produced via Cd doping prevent the recombination of electrons and holes. In Cd–TiO2@TiO2, more trap sites are created, increasing the rate of electron injection. Heterostructure Cd–TiO2@TiO2 takes advantage of Cd as a dopant and TiO2's improved interaction with a sensitizer to create an environment that is favorable for rapid electron transportation. Because of the extrinsic absorption band, heterostructures are more effective at collecting light, including visible light. The photoionization of imperfections in Cd–TiO2@TiO2 results in extrinsic absorption. By creating oxygen vacancies, this photoionization increases photovoltaic activity [40]. When compared to TiO2@Cd–TiO2, TiO2–Cd@TiO2 has better directionality and physical structure, which results in fewer grain boundary trapping sites and longer electron lifetimes, which eventually lead to higher current densities. A table of comparison of the efficiency of dye-sensitized solar cells with the published work is presented in Table 3.

Table 3 Efficiency chart of dye-sensitized solar cells

3.8 Electrochemical impedance analysis

Electrochemical impedance spectroscopy (EIS) is a useful tool for studying the electrical properties of dye-sensitized solar cells (DSSCs) [46]. In a typical EIS experiment, a small AC voltage is applied to the cell, and the resulting current response is measured as a function of frequency. The EIS graph of DSSCs synthesized by coating TiO2 on 1% Cd-doped TiO2 (TiO2@Cd–TiO2) and 1% Cd-doped TiO2 on TiO2 (Cd–TiO2@TiO2) are shown in Fig. 9, indicating two semicircles in the Nyquist plot. The first semicircle is small and located near the origin, specifying the charge transfer resistance at the interface between the electrolyte and the TiO2 or Cd-doped TiO2 electrode [47]. This resistance is related to the recombination of electrons and holes at the interface, which can limit the overall efficiency of the solar cell [48]. The large semicircle away from the origin is associated with the impedance of the charge transfer at the counter electrode/electrolyte interface, which is typically composed of a platinum electrode and an electrolyte solution [49]. This impedance is mainly determined by the diffusion of the redox couple and the resistance of the electrolyte. Thus, the EIS results suggest that this layered structure has a significant impact on the electrical properties of the DSSCs, which can potentially lead to improved efficiency compared to the TiO2-only DSSCs.

Fig. 9
figure 9

Electrochemcial impedance spectroscopy of TiO2@Cd–TiO2 and Cd–TiO2@TiO2 photoanodes-based dye-sensitized solar cells

4 Conclusion

Here, we have synthesized the pure and Cd-doped TiO2 materials and their heterostructures as electrode materials for dye-sensitized solar cells. These materials were synthesized using the sol–gel method and are found to be pure, highly stable, and very suitable as electrode materials for solar cell applications. The formation of stable anatase phases in pristine TiO2, 1% Cd-doped TiO2, TiO2@Cd–TiO2, and Cd–TiO2@TiO2 heterostructures was ascertained using the X-ray diffraction method. The incorporation of Cd insignificantly affected the lattice parameters, whereas in the case of heterostructure formulism, a prominent tunability in structural parameters was observed. Well-shaped spherical nanoparticles with an average size of 53 nm were observed in the case of pure and Cd-doped TiO2; however, in the case of heterostructures, these grains took the shape of stacked layer-like morphologies, which is favorable for the photo-absorbing functionality of these materials. These compositions respond to light very actively in the IR region and are exposed to the maximum absorbance and transmission in this region. In addition, the photovoltaic performance revealed that Cd–TiO2@TiO2 heterostructures exhibited a maximum efficiency of 4.848% with a fill factor value of 0.718, which makes this composition a potential candidate as an electrode material for dye-sensitized solar cells.