### 1. Introduction

_{2}film [13,14], etc.

*n*(

*x*,

*t*) =

*n*+

*ñ*, where

*n*is the steady state electronic concentration and

*ñ*is the sinusoidal excitation of amplitude 10 mV approx. [15]. The technique is mainly

*τ*

*= 1/*

_{n}*k*

*, based on Fick*

_{rec}*’*s laws with a certain recombination term related to the carrier lifetime. The PIT technique also allows determining the electronic concentration in the film by the chemical capacitance parameter, typical of a porous electrode system [16,17]:

*C*

*=*

_{μ}*C*

_{μ}_{, }

*+*

_{cb}*C*

_{μ}_{, }

*. This is a consequence of the distribution of the trap states and conduction band states from the oxygen vacancies at the grain boundaries (*

_{ss}*Ti*

^{3}

^{+}).

*v*

*and average de-trapping velocity:*

_{trapp}*v*

*) until they reach the collector.*

_{detrapp}*Na*

^{+},

*K*

^{+},

*Li*

^{+}) in the electrolyte. Therefore, a factor that will determine the average detrapping rate is the ease of the counterion to penetrate the TiO

_{2}film and neutralize the trap states by forming an ionic pair in the pores and immobilizing the charge, which is why the size of the cation has an influence. As can be seen in Fig. 1, another factor that also influences the average rate of detrapping is the distribution of trap states, the average energies or depth of the trap states

*m*

*are higher in distribution 1 than in distribution 2, thus it will be easier to release an electron in a semiconductor oxide film that presents a distribution of trap states of type 1. When the trapped electrons are affected by either of the two factors mentioned above,*

_{c}*v*

*tend to decrease, which causes the carriers to increase the time to reach the collector (TCO)*

_{detrapp}*τ*

*.*

_{c}*Na*

^{+},

*K*

^{+},

*Li*

^{+}) in the film and the consequent decrease in the rate of detrapping, electrodes with the same particle size and heat treatment at the same temperature have been prepared, therefore it can be considered that in the ratio of electron collection time

*τ*

*and short circuit current density*

_{c}*J*

*,*

_{sc}*m*

*remains constant in each electrode [18]:*

_{c}*α*≤ 1;

*k*

_{B}*T*is the electron energy, which, as can be seen from the distribution of the trap states, conditions the value of the short-circuit current density. On the other hand, in Bisquert

*’*s model an approximation is found in the dependence of

*τ*

*and the electron diffusion coefficient*

_{c}*D*

*given by [19]:*

_{n}*D*

*is maximum,*

_{n}*τ*

*is minimum and*

_{c}*J*

*is maximum. Moreover, if*

_{sc}*m*

*is constant, the short circuit current will depend on the diffusion coefficient*

_{c}*D*

*or the adsorption and desorption velocities (*

_{n}*v*

*and*

_{a}*v*

*) of the counterions in the film.*

_{d}*D*

*by the generalized Einstein relation. There are reports that the concentration of trap states in a porous TiO*

_{n}_{2}anatase electrode is of the order of 10

^{15}cm

^{−3}[20]; and there is large distribution throughout the film, both indicating that the effective electron diffusion coefficient

*D*

*(*

_{n}*n*), is dependent on the electronic concentration in the film, and therefore on its illumination or dark state. As mentioned before, the PIT technique also provides information about the impedance of the electrolyte and the counter electrode, which are very often modeled using Warburg impedance

*Z*

*and a circuit*

_{W}*C*

_{CE}*R*

*, respectively [21].*

_{CE}*’*s second law was applied and adjusted to a system of this nature, obtaining a model for the determination of the diffusion coefficient given by a nonlinear partial equation of second order, which tends to be complex to solve in comparison with the model of

*D*

*=*

_{n}*const*[23]. To avoid the nonlinearity of the equation, the current dark stage and the illumination stage have been treated separately, assuming different electron diffusion coefficients in both stages.

### 2. Methodology

*D*

*(*

_{n}*n*). It depends on the electron density and the characteristics and concentration of the added ions; these produce important variations on the magnitude and shape of the photocurrent profiles. The diffusion coefficients of both, the transient and steady states in dark and illumination conditions, were obtained by Cyclic Voltammetry (CV). The chemical capacitance for each ion in illumination condition,

_{2}film; this information allows to determine the electron density in that state; it is possible to mention that the characteristics and concentration of added ions control in some way affect the electron distribution on the mesoporous surface.

^{−2}(7 seconds-light) was used for each DSSC allowing to obtain the dark diffusion coefficients for each ion:

### 2.1 Theoretical considerations

*ɛ*

*≈ 10*

_{r}^{2}. This implies that the potential difference is less than the energy of the thermal potential

*q*is the charge. Therefore, the diffusive currents are those that control the system and can be studied under Fick

*’*s theory.

### 2.2 Modeling the electron diffusion coefficient

_{2}/E interface [16,25]. Such processes can be modeled by the electrochemical impedance proposed by Bisquert

*et al*. [15]. For the study of the transition from the dark state to the light state, a hybrid model of the carrier source is given by:

*H*(

*t*) in time for which a constant function in time has been taken for

*t*≥ 0 in the illumination state, but dependent on the position given by the Lambert-Beer absorption law. Here

*α*represents the effective adsorption coefficient of the pigment molecules distributed on the film of thickness

*L*, and

*I*

_{0}is the irradiance or the coefficient of the effective flux of incident photons. Thus, the model describing the system is given by:

*C*

_{2}represents the concentration of carriers in the solid phase (2), (electrons),

*C*

_{20}is the initial concentration of the same species in the same phase,

*k*is the recombination frequency, and

*D*

*the effective electron diffusion coefficient in the film.*

_{n}^{1}–10

^{2}

*Hz*in this case. Therefore, Eq. (4) can be rewritten in the transient state as:

*C*

_{2}:

*l*≈2–3, is a parameter related to the distribution of the trap states [28]. Then, the model is a nonlinear partial differential equation with no analytical solutions. At Ref. [23], solutions were determined by numerical methods for illum,ination pulses of Eq. (5), but those results do not fit the experimental results. Therefore, in the study of dark-illumination transients proposed in this work, an approximation is used in which

*D*

*is time-dependent rather than electron concentration-dependent:*

_{n}*t*≤ 0, or when

*C*

_{2}=

*C*

_{20}and

*D*

*is the effective diffusion coefficient in the illuminated state (EDCI) in*

_{n}*t*≥ 0 of the transient part. This allows for avoiding the nonlinearity of the model as it is shown in the following equation for the approximate model in the transient:

*x*= 0, where the proportionality constant is given by the ratio of the electron extraction rate

*k*

*at the TCO contact.*

_{ext.}*x*= 0, due to the low charge generated by the NOP used [29], it is considered that there is no electrical or transport impediment for the electrons to reach the collector, this is reflected due to the low screening of the electrons arriving at

*x*= 0 and that there is a maximum in the concentration gradient in that region. Therefore, at this boundary, it can be considered that the charge control is first-order kinetic (Arrhenius type) and consequently the diffusion coefficient in that region will be given by

*x*=

*L*, at the mixed-phase electrode boundary (MPEB) and the bulk of the electrolyte was determined with the electron flow completely blocked, thus the concentration gradient is minimal and equal to zero and hence there is no electron diffusion in that zone.

*C*

_{2}(

*x*,

*t*) is given by:

*n*

_{t}_{≤}

_{0}(0,0) =

*n*

_{t}_{≥}

_{0}(0,0) and the current density in the whole film:

*J*

_{t}_{≤}

_{0}(

*x*,0) =

*J*

_{t}_{≥}

_{0}(

*x*,0), it is obtained the parameter relationship with the coefficients:

*c*

_{1},

*c*

_{2},

*c*

_{3}and

*B*

_{n}*Li*

^{+}; c4 and c5 are parameters determined by fitting experimental results.

*t*≥ 0 is a summation of different exponentials, which could represent the contribution of each of the charge species contributing to the current in phase (2). Each species is identified by its diffusion frequency given by:

*ω*

*is the diffusion frequency of the umpteenth component of the current.*

_{n}*x*= 0) is affected by the charges accumulated at the bottom of the pores of the mixed electrode and in the steady state can be taken into account by means of the impedance

*Z*

*of Fig. 2. When this area is exposed directly with the electrolyte both recombination and charge accumulation can arise [13]. Since both processes demand charge in that region, they can modify the photocurrent profile measured in the transient.*

_{B}*x*)[

*C*

_{2}|

_{t}_{≤ }

_{0}(

*x*= 0,

*t*= 0)], is injected into the TCO from the sensitized TiO

_{2}layers at the TCO/TiO

_{2}+ dye interface; where

*C*

_{2}|

_{t}_{≤ }

_{0}indicates that the evaluation is done in part of the solution when

*t*≤ 0. Once the charge is injected into the TCO, some carriers tend to return to the mixed-phase electrode by a new reinjection at the TCO/E interface but in a different direction (from the TCO to the electrolyte). As discussed above, the movement of carriers in the opposite direction is due to the accumulation of ions of different signs at the TCO/E interface and may cease until their steady state impedance Z

_{B}in direct current is obtained. Since charge neutrality tends to be preserved in the film, it is equivalent to thinking that in

*x*=

*L*, a number of holes has been injected equal to the quantity of electrons injected in

*x*= 0, and that the concentration in the same region is zero. One way to guarantee this boundary condition is to establish a charge of equal magnitude, but different sign at

*x*= −

*L*, the other condition will be given by the blocking of electrons at

*x*=

*L*. Considering that the same model of Eq. (8) for

*t*≥ 0 and the initial condition mentioned above we have that the electron concentration will be given by:

*D*

*and the electron diffusion coefficient*

_{h}*D*

*of the mixed phase electrode:*

_{n}*t*≤ 0 the solution will be given in the same way by Eq. (10) respectively.

### 3. Experimental

### 3.1 DSSCs construction

_{2}anatase at 99.99% particle size < 10 nm (Sigma-Aldrich) and 99.99% glacial acetic acid (Sigma-Aldrich), the film was deposited by the doctor-Blade technique on a conductive FTO glass from

_{2}films is approximately 34 μm, measured with a profilometer 3D Bruker, Contour GT In Motion. The dye used was “

*Dactylopius coccus*” known as “cochineal”, due to its low toxicity, its large amount of OH groups, and its abundance in Mexico. Its preparation was based on a solution of 0.5 g of cochineal powder from the Sonora-Mexico region, adding 20 mL of distilled water, 10 mL of 99.99% acetyl acetone (Sigma-Aldrich), and 0.25 g of alum (alumina sulfate and potash). It should be noted that a gap of 53 μm was established between the electrode and the counter electrode. The latter was prepared by a clay of 0.15 g of activated carbon ground and sieved to 74 μm, 0.13 g of polyurethane resin and 0.15 g of acetyl-acetone. The film was deposited by the same technique of roto-etching and a thickness of 23 μm.

*I*

_{2}to promote the formation of triiodide ions

### 3.2 Experimental model

*D*

*, which, as stated above, depends on the electronic concentration in the mesoporous given by:*

_{n}*n*=

*n*

*+*

_{cb}*n*

*, the electronic concentration in the conduction band states and the electronic concentration in the trap states. Therefore, it is crucial to determine both the electronic structure and the presence and distribution of trap states in the TiO*

_{t}_{2}film used as electrodes.

_{2}films which were covering the surface of the FTO photoanodes, as well as the graphitic (G band) and the amorphous (D band) composition of the carbon-based counter electrodes (see Fig. 3).

_{2}films, cyclic voltammetry (CV) experiments were performed using an Epsilon BAS potentiostat-galvanostat which was connected with a three-electrode cell (see Fig. 4) where a silver (Ag) and a platinum (Pt) wire were used as pseudo-reference and counter-electrodes, respectively. Complementarily, FTO plates coated by anatase TiO

_{2}films were employed as working electrodes. The electrochemical cell was filled by a 5:95% v/v solution of 3-methoxypropionitrile (Sigma Aldrich, 99%) and acetonitrile (Sigma Aldrich, 99%) containing 1 mM of LiI, KI, and NaI, in the absence of I

_{2}to inhibit the formation of triiodide ions

*I*

_{3}

^{−}.

^{−2}- light power provided by an MR16 GE 12V–50W halogen lamp equipped with a dichroic reflector) by performing photo-electrochemical impedance spectroscopy (PEIS) experiments using an IM6 BAS-Zahner potentiostat-galvanostat where the frequency was scanned from 1 MHz to 50 mHz, whereas D.C. (equals to the open-circuit potential of the photocells) and A.C. signals (amplitude of ±10 mV) were applied under the steady-state of the DSSC.

^{−2}and a rising slope of 250 mV s

^{−1}was applied on the electrode side of each DSSC using a 50 W halogen lamp, overlying a hot mirror lens (Edmund Optics model 47303) between the DSSC and the lamp to reduce heat transfer. The photocurrent obtained from each DSSC as a function of time was measured by the Keithley 2400 Source-Meter, using a KUSB-488B data acquisition interface and LabView v. 2014 based Software.

### 4. Results and Discussion

### 4.1 Micro-Raman spectra

### 4.2 Trap states for each ion

*D*

*during a transient. Another important factor is the ions present in the electrolyte that can recombine and form ionic pairs with the electrons of the occupied trap states. Therefore, the presence and distribution of these ions were determined. In Fig. 5,–12, the trap states that can be neutralized by different ions*

_{n}*Li*

*,*

^{+}*Na*

*and*

^{+}*K*

*using the cyclic voltammetry (CV) technique.*

^{+}*Li*

^{+}ion; the peaks in the voltagram in the interval [−0.579, −0.335] Potential vs.

*Fc*

^{+}*|Fc*are evidence of the presence of surface trap states on the photoelectrode [30]. The presence of trap states at deeper levels neutralized by the same ion is also determined in the interval [−1.469, −0.986] Potential vs.

*Fc*

^{+}*|Fc*.

*Li*

*. These states are due to the crystallographic concentration (101) in the film which gives rise to states at the grain boundaries, then, it is also an important factor in the chemical capacitance.*

^{+}*Ti*

^{3}

^{+}at the grain boundaries, and it is also an important factor in the chemical capacitance

*C*

_{μ}_{, }

*at the TiO*

_{cb}_{2}/E interface [31]. Since the pores in the photoelectrode allow the passage of a certain number of cations.

*C*

_{μ}_{, }

*of the surface states in the solid phase of the mixed-phase electrode.*

_{ss}*Na*

^{+}ion; in the interval [−0.672, −0.539] Potential vs.

*Fc*

^{+}*|Fc*the presence of shallow trap states has been determined and in the interval [−1.548, −1.118] Potential vs.

*Fc*

^{+}*|Fc*the deep trap states have been determined.

*Na*

^{+}are less than those neutralized by the cation

*Li*

^{+}shown in Fig. 6.

*Li*

^{+}, which reflects a lower diffusion of ions into

*Na*

^{+}in the pores of the photoelectrode, this could be attributed to its size, Fig. 10.

*K*

^{+}fail to diffuse in the film in the same way as ions of

*Li*

^{+}or

*Na*

^{+}, this is reflected in the null neutralization of shallow trap states. The states that do manage to neutralize are the deep states in the interval [−1.829, −1.304] Potential vs.

*Fc*

^{+}*|Fc*The Fig. 12 shows the distribution of the states neutralized by the ion

*K*+, which, as can be seen, neutralizes a larger number of deep trap states. It should be noted that the cyclic voltammetry (CV) technique was performed with a scanning speed of 25 mV s

^{−}

^{1}, a speed with which the system is polarized, which allowed the distinction and distribution of trap states that manage to neutralize each ion.

### 4.3 Photoelectrochemical impedance spectroscopy (PEIS)

*Z*(

*ω*) of the different DSSCs with different cations. Here, are determined:

*ω*

_{K}_{+}= 89.047 s

^{−1},

*ω*

_{Na}_{+}= 186.74 s

^{−1}and

*ω*

_{Li}_{+}=353.3568 s

^{−1}additionally, diffusion frequencies were estimated in the TiO

_{2}film anatase of

*ω*

_{K}_{+}= 689.6551 s

^{−1},

*ω*

_{Na}_{+}= 988.0495 s

^{−1}and

*y*

*ω*

_{Li}_{+}=2,500 s

^{−1}.

*R*

*=*

_{pore}*r*

*×*

_{pore}*L*is the resistance to the ionic transport in the phase (1),

*R*

*=*

_{et}*r*

*×*

_{et}*L*

^{−1}is the resistance to the electronic recombination at the TiO

_{2}/E interface,

*C*

_{μ}_{, }

*=*

_{cb}*c*

_{μ}_{, }

*×*

_{cb}*L*is the chemical capacitance due to the occupied states of the conduction band,

*C*

_{μ}_{, }

*=*

_{ss}*c*

_{μ}_{, }

*×*

_{ss}*L*

^{−1}is the chemical capacitance due to the occupied trap states,

*R*

*=*

_{tr}*r*

*×*

_{tr}*L*is the electron transmission resistance in the phase (2). In addition, it was determined

*R*

*=*

_{t}*R*

*+*

_{subs}*R*

*that is the total resistance of the counter electrode and*

_{ce}*R*

*= 196.1*

_{subs}*Ω*, 146

*Ω*and 207.6

*Ω*for the DSSC with

*Li*

^{+},

*Na*

^{+}and

*K*

^{+}respectively, the substrate resistance or the measured FTO.

*L*

*given by the relation [32]:*

_{D}### 4.4 Light-dark transients

*Li*

^{+},

*Na*

^{+}and

*K*

^{+}ions. By taking in each part of the model

*e*

^{−}

*C*

_{2}(0,0) and the boundary conditions, the DSSC with

*Li*

^{+}ions yielded the following values of the fit parameters, shown in Tables 3 and 4:

*Na*

^{+}and

*K*

^{+}ions, she density of injected electrons was considered to be given by

*Na*

^{+}ion at the same dark-light, transitory and steady state conditions.

*Li*

^{+}are the smallest ions with access to shallow and deep trap states, therefore, they tend to neutralize those states beneficially promoting a decrease in the available charge at the TiO

_{2}/E interface and of the shallow trap states as can be seen in the

*C*

_{μ}_{,}

*and*

_{cb}*C*

_{μ}_{,}

*values for each DSSC. In the case of the DSSC with*

_{ss}*K*

^{+}ion due to null neutralization of the shallow states, presents a higher charge concentration at the TiO

_{2}/E interface than the DSSC with

*Li*

^{+}but not higher than the DSSC with

*Na*

^{+}, because

*Na*

^{+}ions are smaller and diffuse in greater quantity in the pores of the film.

*Li*

^{+}ions, the change in the electron diffusion coefficient during a light step can be determined. It is observed that in the dark state, the electron diffusion coefficient is higher, this is due to the majority of unoccupied states in the gap and conduction band, which facilitates the movement of carriers trapping and releasing from one state to another, which as can be seen from the same tables in the dark stage the concentration is 1.36699 × 10

^{−}

^{7}C cm

^{−}

^{3}. This relatively large value of the diffusion coefficient also explains why a large amount of charge is incorporated during injection. During the dark phase due to a relatively large electron diffusion coefficient, the dark current density takes a value of: 1.9852 × 10

^{−}

^{7}C s

^{−}

^{1}cm

^{−}

^{2}, this is due to the low population of carriers in such a state. On the other hand, it is observed that during the transient, the electron diffusion coefficient is lower, this is due to the charge that has been injected in the trap and conduction states. In addition, the electron diffusion coefficient has decreased since the ions of phase (1) of the mixed electrode perceive the electric charge injected in

*x*= 0.

*Na*

^{+}and

*K*

^{+}ions that partially and completely neutralize the shallow states, a differently modeled photocurrent profile is presented, due to a part of the ions are not in the TiO

_{2}/E interface, and remain active in phase (1) and being in contact at the bottom of the pore with the FTO promotes the diffusion of holes in the photoelectrode with a diffusion coefficient

*D*

*respectively for each ion. This causes that when electrons are injected in*

_{h}*x*= 0, an instantaneous displacement of the holes occurs by diffusion in the photoelectrode to the same position causing the photocurrent to drop by recombination, which gives rise to the profile of the photocurrent signal in both cells. Moreover, due to the ion concentration at the TCO/E interface, the overvoltage in that region can be modified, so the extraction rate

*k*

_{ext}_{.}can be affected since it depends on the voltage [33].

*Na*

^{+}ion, which could explain why it emits lower photocurrent density as can be seen in Fig 14. This could be due to the interaction of the

*Na*

^{+}ion with the carminic acid molecules of the pigment.

*D*

*, which could be due to the variation of the velocities*

_{n}*v*

*and*

_{a}*v*

*in each ion according to the following situations:*

_{d}*J*could decrease if_{sc}*v*is large, which could be happening with larger cations adsorbing faster (easier) than smaller ones, leading to a decrease in the rate of electron detrapping from the trap states._{a}*J*could decrease if_{sc}*v*is small, which could be due to the fact that once the cations are adsorbed it is very difficult to desorb them, which causes the electrons to stay longer in the trap states and requires more energy to be released, also causing a decrease in the detrapping rate of the electrons from the trap states._{d}

*V*

*is considered to remain constant, a variation in the short circuit current density*

_{oc}*J*

*or the diffusion coefficient*

_{sc}*D*

*will be reflected in a variation of the DSSC efficiency:*

_{n}### 5. Conclusions

*Li*

^{+},

*Na*

^{+}, and

*K*

^{+}which allow revealing the trap states used to quantify the chemical capacitance in the pores of mesoporous TiO

_{2}. A strong dependence of the magnitude and shape of the profiles of the photocurrent sent by the DSSCs during the same transient on the cations used has been established since the trap states neutralized by the cations affect the electrochemical parameters in the DSSCs such as the diffusion coefficient itself and the rate of extraction

*k*

_{ext}_{.}at the contact

*x*= 0.