Optical in situ monitoring during the synthesis of halide perovskite solar cells reveals formation kinetics and evolution of optoelectronic properties

The formation mechanism and the evolution of optoelectronic properties during annealing of chlorinederived methylammonium lead iodide (MAPbI3 xClx) are investigated in detail combining in situ and ex situ optical and structural characterization. Using in situ optical reflectometry we are able to monitor the evolution of the MAPbI3 xClx phase as a function of time and processing temperature. The formation kinetics is fitted using an improved Johnson–Mehl–Avrami–Kolmogorov model and a delayed formation of MAPbI3 xClx is found when chlorine is present in the precursor. This is verified by X-ray diffraction and X-ray fluorescence measurements. From absolute photoluminescence measurements we determine the implied Voc during film formation, which exhibits a maximum at a specific time during the annealing process. In conjunction with ex situ time-resolved photoluminescence we deduce a decrease in the net doping density for increased annealing times, while the minority carrier lifetime stays constant. We thus demonstrate the potential of in situ optical spectroscopy to monitor and tailor the electronic properties of hybrid perovskites directly during film growth, which can be easily applied to different growth recipes and synthesis environments.


Introduction
Metal-halide perovskite solar cells have risen to fame due to their rapid increase in power conversion efficiency to above 25%, 1 which has been achieved by systematic device, compositional 2-4 and process engineering. 5,6 A growing number of synthesis routes are being reported in the quest to optimize the optoelectronic properties of the perovskite absorber layer. [7][8][9] Especially methylammonium lead iodide has been synthesized by many procedures that oen differ in the choice of precursors, 10-13 their ratio, and solvents utilized. 8,14 Hence preparation protocols become increasingly complex.
A deeper understanding of how precursors, intermediates and lm preparation conditions determine the optoelectronic quality of the metal halide perovskite materials is crucial to: (1) ensure reproducibility of samples within individual laboratories (2) facilitate the adaptation of synthesis protocols and allow comparison between research laboratories and (3) translate device technology to larger areas. [15][16][17][18][19] It has been found that the formation of MAPbI 3 competes with decomposition into PbI 2 such that there is only a relatively small time-window to achieve pure MAPbI 3 without precursor residues or impurity phases such as PbI 2 . 12,20 Obtaining materials with well-dened properties reproducibly is crucial to enable the technological utilization of metal-halide perovskites. Ideally, process monitoring and integrated process control would enable to adjust or terminate annealing when optimal material properties are achieved. Lab-based monitoring tools such as optical monitoring are very fast and thus may allow real-time control. 21 Although real-time photoluminescence monitoring during perovskite growth has been reported previously [22][23][24] this has so far not been performed in a realistic device fabrication environment e.g. in a glovebox and, even more importantly, so far neither quantitatively analyzed with respect to the evolution of structural and optoelectronic properties of the growing lms.
Several studies have focused on understanding the basic mechanisms during the formation of perovskite lms. 12,[25][26][27][28][29][30] Among the most investigated processes has been the formation of MAPbI 3Àx Cl x involving chloride-containing lead precursors such as PbCl 2 . This synthesis route results in thin-lms with long minority charge carrier diffusion lengths and photoluminescence lifetimes as well as low series resistance and good morphology, comparable to materials grown from pure iodide precursors. 31,32 Recently, a record V oc ¼ 1.26 V has been demonstrated using such a synthesis route. 13 In contrast to the PbI 2 -based route, there is no need for additional steps such as an anti-solvent drip. The unique combination of good optoelectronic properties and an easy synthesis protocol makes the process exceptionally well suited for up-scaling approaches. The role of chloride in the growth from chloride-containing precursors has been widely debated in literature. Chloride has been suggested to act as a dopant or trap state passivant to rationalize the longer charge carrier lifetimes and higher mobility. 31,33 A photoluminescence microscopy study revealed a correlation between an enhanced Cl-content and the local photoluminescence lifetime in individual grains. 34 While chlorine has been conrmed to be present in the precursor phase immediately aer spin coating, the chlorine content decreases during annealing by loss of methylammoniumchloride (MACl). The chloride-content in annealed lms was found to be only a few percent, varying throughout the depth of the lm. 30,[35][36][37][38] The formation process itself and especially the crystalline intermediate phases containing chloride were found to be of signicant importance, as they template the growth of large grainsize, oriented and high-quality material. Several studies have been carried out to elucidate the key intermediates and lm formation kinetics. 25,29,30,32,[39][40][41] Stone et al. identied an intermediate phase as MA 2 PbClI 3 , consisting of a columnar structure of lead-iodidechloride octahedra. 28 While in previous studies mainly X-ray diffraction-based methods were applied to describe and monitor the growth process in hybrid perovskite thin lms, 12,20,[28][29][30]40,41 there has been also a recent study in which solar cell properties were simultaneously monitored during growth, by use of a special device structure with interdigitated back contacts. 42 Although this study gives information about the evolution of photovoltaic parameters during the growth of these specialized devices, the concept is not easily transferable to an in situ analysis of the optoelectronic properties of real planar devices.
In contrast, the approach followed in the present study focuses on lab-based in situ monitoring of UV/Vis reectance and photoluminescence during the formation process in a real processing environment (glove box), which can be applied to any real growth process currently used for planar hybrid perovskite devices. In particular, by contact-less monitoring of the evolution of optoelectronic properties during MAPbI 3Àx Cl x lm formation we are able to identify distinctively different phases during the lm formation process and deduce the kinetics of precursor phase consumption, intermediate phase formation and consumption, as well as nal product formation. Ex situ powder X-ray diffraction (XRD) as well as X-ray uorescence (XRF) measurements on samples aer dened annealing times are used to identify intermediate phases and quantify the relative chlorine content in the sample as a function of annealing time. Here we furthermore correlate the evolution of the band-gap and photoluminescence peak emission energy with the concentration of MAPbI 3Àx Cl x already formed, the photoluminescence quantum yield (PLQY) as well as photoluminescence lifetime to gain insight into the charge carrier dynamics as a function of annealing time and chlorine content. In particular, the PLQY allows us to directly estimate one of the most relevant photovoltaic parameters, the device open-circuit voltage, during the growth/annealing process. This demonstrates that by in situ optical monitoring of the MAPbI 3Àx Cl x formation, an optimal end-point of the annealing process can be dened for specic synthesis procedures, opening the way to further signicant improvements of performance and reproducibility of halide perovskite based photovoltaics.

Monitoring optical properties during growth
To investigate the evolution of the optoelectronic properties during the formation of the perovskite thin-lm from the spincoated precursor solution, the samples were monitored by spectrally-resolved reectance and photoluminescence (PL) measurements in a realistic glove-box processing environment, as sketched in Fig. 1a. In Fig. 1b, heat maps of the PL and reectance spectra for a MAPbI 3Àx Cl x sample are shown as a function of time during the drying and subsequent annealing process at 100 C. The synthesis process is further described in the Experimental methods section. The shi of the PL peak energy as obtained from a Gaussian-t to the individual spectra, and the evolution of the absorption onset as obtained from spectral tting as described below, are indicated as grey traces in the plot. Already during the drying process at t < 0 min the sample is strongly luminescent with an emission energy close to 1.7 eV. Aer ramping the temperature up to 100 C, the luminescence peak position decreases continuously down to 1.6 eV for the fully annealed lm. The emission intensity decreases within the rst minutes but increases again aer around 40 min. At this time the reectance spectra also start to exhibit a clear absorption edge at 1.6 eV, which increases in energy over time. Aer the PL intensity goes through a maximum it decreases again aer t $ 60 min.
To investigate changes in the crystalline phases during the different processing stages, room temperature XRD measurements were performed on samples from process interruptions at dened annealing times of 0 min, 40 min, 45 min, 60 min and 70 min as shown in Fig. 2. Already during the drying stage (t # 0 min), when strong PL emission at 1.7 eV is observed, the XRD pattern shows diffraction peaks from a crystalline phase, in agreement with previous reports. 25,28 The XRD pattern exhibits diffraction peaks at 11 , 12 , 15.6 , 16 , 28.5 and 32.7 , which do not agree with those expected for the binary precursor or impurity phases MAI, MACl, PbI 2 or PbCl 2 .
The presence of crystalline precursor phases during annealing and their subsequent decomposition, simultaneously to the formation of MAPbI 3 has been discussed for different precursor salts. 20,25,27,39 In the case of the PbCl 2 -derived synthesis route, diffraction peaks comparable with lattice distances in crystalline MAPbCl 3 (ref. 25) have led to the conclusion that a pure or chloride-rich methylammonium lead halide perovskite could be a component of the crystalline precursor phase. 25,32,[43][44][45] The associated lattice plane distances of the diffraction peaks at 15.6 and 32.7 are indeed consistent with those of MAPbCl 3 . However, some of the diffraction peaks expected for MAPbCl 3 , such as the (011) and (022) peaks, are not observed in the powder diffractogram of our samples (see Fig. S1 and S2 in the ESI †). Instead, all diffraction peaks are consistent with a crystalline phase of MA 2 PbClI 3 (ref. 28) which exhibits a similar near-range order but a lower local symmetry than MAPbCl 3 . In this proposed structure, chloride ions preferentially occupy the axial lattice sites of lead-iodide-chloride octahedra. Therefore, in the [002]-direction, the lattice constant is identical to that of MAPbCl 3 , resulting in the diffraction peak at 15.6 , which has sometimes been attributed to crystalline MAPbCl 3 . 40,45 Fig. 1 (a) Schematic of the glovebox-based synthesis and optical monitoring process. A camera image of the photoluminescence emitted from the sample after 60 min annealing shown in red colors is shown as an inset. (b) False-color plot of the evolution of photoluminescence (PL) and reflection spectra during the 3-stage synthesis of chlorine derived MAPbI 3Àx Cl x . The PL peak energy as well as the energy of the band gap, as obtained from fitting the individual spectra, are superimposed. During annealing, weak diffraction peaks evolve, that can be assigned to the tetragonal phase of MAPbI 3Àx Cl x , while the diffraction peaks of the precursor phase(s) diminish in intensity accordingly. The nal lm only exhibits peaks corresponding to a pure MAPbI 3Àx Cl x phase. A direct comparison of the evolution of the peak at 15.6 attributed to the MA 2 PbClI 3 (310)/(001) precursor and the MAPbI 3Àx Cl x (002)/(110) peaks is shown in Fig. 2b. It is noteworthy, that the decrease of the MA 2 PbClI 3 peak occurs in parallel to the evolution of the MAPbI 3Àx Cl x peak but at no point in time a solid-solution of both phases exists. It can thus be concluded that the nal lm is not formed by ionexchange from MA 2 PbClI 3 but nucleates and grows while consuming the precursor phase.
Photoluminescence and optical reection signals extracted from the in situ data sets at corresponding annealing times are shown in Fig. 3. The volume fraction of MAPbI 3Àx Cl x formed in the lm can be estimated from the optical reection data by employing a Beer-Lambert law based model, 21 assuming that light is fully reected at the silver back mirror and thus transmitted twice through the investigated layer of thickness d: where a(l,t) is the absorption coefficient of the layer and c(t) corresponds to the volume fraction of the detected phase in the lm, R o is the reection from the surface and R 1 is a constant.
The absorption coefficient is modeled as a 0 (E À E g ) 0.5 for photon energies above the band gap E g and as an exponential Urbach tail exp((E À E g )/E u ) for energies below the band gap, corresponding to a direct-gap semiconductor with exponential sub gap band tailing. 46 More details about the tting model can be found in the ESI (Note 2). † No clear absorption edge can be discerned during the initial annealing stage between t ¼ 0 min and t ¼ 35 min. However, the luminescence spectrum of the dried lm at t ¼ 0 min, in Fig. 3a, exhibits a peak with a maximum around 1.73 eV and a signicantly broadened high energy side.
At about t ¼ 40 min an absorption edge can be recognized in Fig. 3b and the photoluminescence peak redshis to about 1.6 eV, which agrees with literature values for band-to-band emission of MAPbI 3Àx Cl x at 100 C. 47 This is supported by the XRD patterns in Fig. 2a which show an increase of the diffraction peaks corresponding to MAPbI 3Àx Cl x between 40 min and 70 min. Thus, we propose that the variable c(t) obtained from tting the reection data can be associated with an increasing MAPbI 3Àx Cl x volume fraction in the lm. Fig. 3 also shows the ts of the reection spectra indicating that the spectra are well described by the model for annealing times > 35 min. Assuming that at t ¼ 70 min the concentration c ¼ 100% for the fully formed perovskite lm with a lm thickness of d ¼ 300 nm (compare Fig. S3 †), an absorption constant a 0 ¼ 1.6 Â 10 5 cm À1 eV À0.5 is derived, which corresponds to an absorption coefficient of a ¼ 2.5 Â 10 4 cm À1 at 1.6 eV. This value is in good agreement with literature values for PbCl 2 -derived MAPbI 3Àx Cl x . 48 In Fig. 4 the PL intensity, the PL peak position, the derived MAPbI 3Àx Cl x concentration c(t) and the total chlorine content of the lm (from XRF) are shown as a function of annealing time. Note that for all ex situ measurements the errors of the individual measurements are very low, whereas a larger uncertainty arises from the sample to sample variation. A comparison of the ex situ measurements and in situ reproducibility for different synthesis runs can be found in the ESI, Fig. S7-S9. † It can be seen in Fig. 4a that although a signicant PL yield is present during the whole process, there is a marked increase in PL yield aer 40 min followed by a decrease which, will be further analyzed in the following. Correspondingly, the MAPbI 3Àx Cl x concentration c(t) obtained from optical reection measurements (Fig. 4b) shows a sudden increase, agreeing with the increase of the MAPbI 3Àx Cl x phase determined from XRD measurements. Thus, the increase in PL yield can be explained by the formation of MAPbI 3Àx Cl x . The formation of MAPbI 3Àx Cl x does not occur continuously from the beginning of the annealing but only initiates aer a certain delay time. This indicates that the formation does not follow a simple rst order reaction but is related to a more complex transformation mechanism, as will be discussed further in Section 2.3.
From the evolution of the chlorine content determined from XRF measurements (Fig. 4d), it is noted that the onset of the MAPbI 3Àx Cl x formation coincides with a loss of about 50% of the initial chlorine content. This observation is consistent with previous studies, which showed that chlorine is released during formation of MAPbI 3Àx Cl x from mixed halide precursors. 25,28 Our results indicate that no apparent transformation to MAPbI 3Àx Cl x occurs before an apparent "excess" of Cl has evaporated during the initial annealing phase. Please note that we did not observe this delay of MAPbI 3 formation in a Cl-free processing route using only iodine-containing precursors (see Fig. S10 in the ESI †). This implies that the delay is caused by the presence of (excess) chlorine in the sample.
The PL peak position also shows an interesting behavior: at t ¼ 0 min the maximum is at E pl $ 1.7 eV and thus cannot be attributed to pure MAPbI 3 , which has a bandgap of 1.6 eV at T ¼ 100 C. 47 During the annealing, a red shi can be observed and the PL evolves continuously into the emission consistent with a pure MAPbI 3 phase (or MAPbI 3Àx Cl x with small x). This continuous redshi is visible during the entire annealing time. This suggests a continuous evolution of the material luminescent at 1.7 eV at t ¼ 0 into the nal MAPbI 3Àx Cl x phase. In contrast, in XRD the diffraction peaks corresponding to the MAPbI 3Àx Cl x phase do not evolve by a continuous peak shi from the observed crystalline precursor phase. The observed luminescent precursor phase must thus be different from the crystalline precursor phase visible in XRD, but possibly arises from MAPbI 3Àx Cl x crystallites already present at the beginning of the annealing process, as will be discussed further in Section 2.3.

Evolution of optoelectronic properties during growth
Aer about 45 min a decrease in photoluminescence intensity is observed, although the concentration of MAPbI 3Àx Cl x is still rising. This clearly indicates a change in the optoelectronic properties of the material. From the photoluminescence signal and the absorbed incident photon ux the photoluminescence quantum yield (PLQY) can be calculated, which is shown in Fig. 4 Time evolution of film properties during the annealing stage of the chlorine-derived synthesis of MAPbI 3Àx Cl x measured by in situ photoluminescence and reflection spectroscopy as well as ex situ Xray diffraction and X-ray fluorescence spectroscopy. The obtained photoluminescence intensity is shown in the top panel (a). It can be compared to the concentration of MAPbI 3Àx Cl x within the thin film, extracted by fitting the absorption edge of the individual reflection spectra, and the relative reflex height of MAPbI 3Àx Cl x measured by Xray diffraction (b). Furthermore, the PL peak energy (c) is compared to the decrease of the overall chlorine content within the sample, obtained from X-ray fluorescence (d).   5a. It can be seen, that the PLQY rst reaches a maximum of 0.14% at about 48 min, and then decreases with further annealing. We note that this value compares well to recent results obtained for perovskite absorber layers yielding more than 20% conversion efficiency in devices, 49 in particular when taking into account that the processing (and thus measurement) temperature of 100 C attenuates the PLQY by approximately a factor of 3 (see ESI, Fig. S11 †).
From the temperature-corrected PLQY, the quasi-Fermi level splitting m (or implied open-circuit voltage iV oc ) expected at room temperature can be estimated following the approach of Ross 50 m ¼ m rad + k B T ln(PLQY/a e ) ¼ qiV oc (2) where m rad denotes the quasi-Fermi level splitting in the radiative limit, which in the simplest approximation is equivalent to the Shockley-Queisser limit ($1.31 eV for a bandgap of 1.6 eV) 51 and a e is the absorptivity of the perovskite at the emission wavelength and T ¼ 300 K (see ESI, Fig. S12 †). The implied room-temperature open-circuit voltage for the growing lm is shown in Fig. 5b, where it can be seen that iV oc reaches a maximum value of 1.2 V aer an annealing time of 38 min, and then monotonically decreases to a nal value of 1.16 V at the end of the annealing process. This clearly shows that such an in situ monitoring approach can be applied to optimize the annealing conditions for various perovskite crystallization processes.
To estimate the minority carrier lifetime and possible changes in the charge carrier (doping) density n 0 during annealing, time-resolved photoluminescence (TRPL) measurements were performed ex situ aer different annealing times. To account for the concentration of MAPbI 3Àx Cl x formed aer different times, the initial TRPL amplitude was corrected by the absorption of the incident laser beam. Measured TRPL transients are shown in the ESI in Fig. S13. † We nd that the minority carrier lifetime stays nearly constant at s $ 130 ns and even increases with longer times of annealing as seen in Fig. 5c. The externally observed photoluminescence yield is proportional to the radiative recombination coefficient k rad , the photoexcited carrier density and the absorptivity at the emission wavelength Y PL f k rad npa e , which for low injection conditions can be approximated by Y PL f sn 0 a e , where s is the minority carrier lifetime and n 0 is the net doping density. [52][53][54] Although, without exact knowledge of additional constants, this does not allow the deduction of an absolute doping density, the relative change in doping density can be estimated from the PLyield and carrier lifetime as shown in Fig. 5d. It can be seen that the doping density continuously decreases with processing time by about one order of magnitude. Thus, it can also be concluded that the observed decrease in the implied V oc for longer annealing time is related to a decrease in the doping density rather than to an increase in non-radiative recombination.
A comparison with the pure PbI 2 derived synthesis route (ESI, Fig. S10 †) shows that aer the formation onset the photoluminescence yield shows a very similar behavior for both cases. Thus, it can be assumed that the decrease in doping density is not primarily caused by the decrease in the chlorine content. However, for both routes a ratio of 3 : 1 of MAI/PbI 2 or MAI/PbCl 2 was used. Thus MAPbI 3 /MAPbI 3Àx Cl x is grown from an initial excess of methylammonium in both cases. In the case of MAPbI 3 , this has been shown to result in highly p-doped MAPbI 3 (ref. 55) which is primarily attributed to Pb-vacancies exhibiting a rather low formation enthalpy. 56 Furthermore, it has been reported that annealing of pristine MAPbI 3 reduces the hole density even leading to a conversion to n-type doping. 55 Hence, the herein observed decrease in the effective doping density during the formation of MAPbI 3Àx Cl x can be assumed to be caused by a decrease of Pb-vacancies caused by the evaporation of MA during annealing.

Formation kinetics of MAPbI 3Àx Cl x
To further analyze the reaction kinetics of the chlorine-derived MAPbI 3Àx Cl x formation, the annealing process was carried out at different annealing temperatures (80 C, 85 C, 90 C, 95 C and 100 C). The time evolution of the MAPbI 3Àx Cl x concentration as derived from the reection measurements is shown in Fig. 6. It can be seen, that the duration for a complete transformation of the lm into MAPbI 3Àx Cl x ranges from approximately 35 min at 100 C to 180 min at 80 C. The delay in the formation reaction of MAPbI 3Àx Cl x ranges from approximately 15 min at 100 C to about 80 min at 80 C.
Kinetic parameters of the MAPbI 3Àx Cl x formation reaction can be extracted by applying an appropriate temperaturedependent formation model for the time evolution of the MAPbI 3Àx Cl x concentration c(t). The sigmoidal kinetics observed in Fig. 6a are characteristic for solid-state transformations and can be attributed to a nucleation and growth process. The widely used Johnson-Mehl-Avrami-Kolmogorov (JMAK) model 57-59 describes such solid-state transformation reactions at constant temperature T and has been recently applied to the formation of perovskites from precursors. 12 Model assumptions are that nucleation occurs homogenously distributed within the precursor phase, that the growth rate is constant in time and that growth occurs homogeneously in all directions. 58 We apply the JMAK-model using a thermally activated rate equation that includes a delay time t onset to account for the observed delay in MAPbI 3Àx Cl x formation: where E F a denotes the activation energy of the reaction, k 0 is the rate constant, and n is the growth dimensionality.
The dataset shown in Fig. 6a is tted for all temperatures simultaneously, varying k 0 , E F a and n globally for all processes. Alternatively, t onset is xed to zero for the pure JMAK model while it assumes temperature-dependent nite values for the altered model given by eqn (3). From tting the data in Fig. 6, it can be seen, that if the delay time is omitted (t onset ¼ 0 min) the global t insufficiently describes the measured data and results in a growth dimensionality of n ¼ 5.5, which is physically difficult to rationalize. When introducing a delay time t onset (T), the experimental data can be tted with higher accuracy for all temperatures, which can be also seen from the c 2 -coefficient which decreases from 11 to 6. The resulting activation energy of the formation reaction is E F a ¼ (94 AE 2) kJ mol À1 and the growth exponent is n ¼ 2.1 AE 0.1. The growth exponent corresponds to the dimensionality of the growth, where n ¼ 2 implies 2dimensional growth of previously nucleated material. As a growth exponent n > 4 bears no physical meaning, this shows that the formation of MAPbI 3Àx Cl x can only be correctly described by including a temporal delay in the onset of MAPbI 3Àx Cl x formation (eqn (3)).
In addition, a second activation energy can be extracted from the delay times. Fig. 6b shows an Arrhenius plot of the delay times t onset yielding an activation energy of E O a ¼ (84 AE 7) kJ mol À1 . Although both activation energies, estimated from the temperature dependence of t onset (T) and from the temperature dependence of the subsequent formation kinetics, are very close to each other we believe that they may correspond to two distinct phenomena, as discussed further below. 12,60 A comparison of the reaction kinetics determined in the present study with previously reported reaction kinetics observed by in situ GIWAXS shows some agreement and some differences (Fig. S14 in ESI †). While Chang, 40 Unger 25 and Stone 28 observe a delay, this is not observed by Moore et al. 12 The reported duration for complete conversion of the precursor to the nal lm varies from 30 min to 70 min at 100 C and the reported activation energies vary from 69 kJ mol À160 to 86 AE 6 kJ mol À1 . 12 It has to be noted, that these activation energies were obtained without including a formation delay. A comparison of the previously presented data shows that even though the formation onset differs signicantly in different studies, the reaction kinetics aer the formation onset obtained in the present study agree with the data presented by Chang, Unger and Stone 25,28,40 and hence seem to be more fundamental than the delay time (see Fig. S14 †). Thus, we propose that variations observed for the formation onset strongly depend on the processing conditions. The annealing environment, N 2 or dry air, varying relative humidity or ambient temperature is oen not specied in detail but may have a crucial inuence. This variance in process conditions and kinetics serves as a strong argument for the relevance of in situ process control during growth.
The strong variation of t onset visible in the literature data and in this study for different glovebox temperatures (see ESI, Fig. S7b †), together with the largely unaffected subsequent formation kinetics, indicate that the processes occurring during the delay and the formation phase itself may be distinctively different.
Considering all data from PL, UV-Vis, XRD and XRF we conclude, that MACl and MA 2 PbClI 3 as well as MAPbI 3Àx Cl xnuclei coexist within the lm from the beginning. The fact that the MAPbI 3Àx Cl x cannot be observed by XRD in the beginning of the growth process can be explained by an initially smalldomain size of the crystallites. We recall from Fig. 1 and 4 that a photoluminescence signal is observed from t ¼ 0 min which starts at a peak energy of 1.7 eV and then continuously red-shis to 1.6 eV. Although such a continuous red shi may be explained by a growth of the MAPbI 3Àx Cl x nuclei and thus decreasing of quantum connement, it may also be due to a continuous substitution of chlorine with iodine within the MAPbI 3Àx Cl x seed crystals. Assuming a linear dependence of the band-gap of MAPbI 3Àx Cl x on the chlorine content x, the PL peak energy would indicate a Cl-concentration of 6% of the original seed crystals at t ¼ 0 min, subsequently reducing to about 0.6% for the fully annealed MAPbI 3Àx Cl x lm. This explanation is consistent with the Rietveld renement of the powder diffractograms which show an increase of the unit cell volume approaching MAPbI 3 literature values for t > 40 min (see Fig. S2 in the ESI †), indicating a decrease of the Cl content in MAPbI 3Àx Cl x from that point onwards. 43,61,62 MACl was shown to evaporate during the process 25 which correlates to a loss of chlorine within the lm, as measured with XRF (Fig. 4). Once MACl is fully evaporated, further evaporation of chlorine leads to a decomposition of the MA 2 PbClI 3 precursor. By this, the limiting elements (Pb/I) become available and thus a sudden formation onset of MAPbI 3Àx Cl x can be observed. Thus, we propose an activation energy of E O a ¼ (84 AE 7) kJ mol À1 for the loss of Cl in form of MACl during the latent phase and an activation energy E F a ¼ (94 AE 2) kJ mol À1 for the subsequent formation of MAPbI 3Àx Cl x and decomposition of MA 2 PbClI 3 .

Conclusions
The evolution of halide perovskite formation was monitored in situ by optical spectroscopy during a regular solar cell synthesis process in a glovebox environment. The band-edge of the growing perovskite material was observed by white light reection and tted with an analytical model to extract the evolution of the MAPbI 3 concentration in the thin lm during annealing. Simultaneously, the optical properties of the lm are monitored by photoluminescence which allows us to quantitatively deduce the implied V oc during lm growth.
Analyzing the MAI/PbCl 2 based synthesis route it was found that a crystalline precursor phase develops which can be attributed to MA 2 PbClI 3 . Furthermore, the excess of chlorine is shown to delay the onset of MAPbI 3Àx Cl x formation. We propose that already from the beginning of the growth process MAPbI 3Àx Cl x nuclei exist, (with strong luminescence at 1.7 eV) from which the MAPbI 3Àx Cl x layer forms only aer a delay time t onset . This is supported by a growth exponent of n ¼ 2 for the formation of MAPbI 3Àx Cl x , indicating 2D growth with previous nucleation, and a PL emission which continuously approaches the nal MAPbI 3Àx Cl x emission. By correlation with TRPL measurements we observed that the excited charge carrier lifetime stays nearly constant during annealing, however the effective doping density decreases signicantly. This can be attributed to a loss of methylammoniumchloride during annealing. Thus, it is shown that through in situ monitoring the doping density could be ne-tuned by altering the annealing time. This work demonstrates the great potential of in situ optical spectroscopy in order to monitor and tailor the optoelectronic properties of hybrid perovskites directly during device processing. Furthermore, the possibility to analyze real growth processes in detail opens the way to an improved understanding and enhanced reproducibility of halide perovskite solution processing, which is a necessary prerequisite for up scaling approaches.

Perovskite synthesis
FTO coated glass substrates (Pilkington TEC7) were cleaned in an ultrasonic bath, using a laboratory cleaning agent (diluted Extran 1 : 1 with H 2 O) and subsequently rinsed with distilled water and dried with N 2 . The substrates were coated with a 75 nm thick layer of TiO 2 by electron beam evaporation and annealed in ambient air at 500 C for 2 h. To enable the reection/transmission measurements the back side of the substrates was coated with 150 nm of silver by electron beam evaporation. Methylammonium iodide (MAI) was prepared from methylamine and HI as described elsewhere. 10 Lead(II) chloride was used as purchased from Sigma Aldrich. MAI and lead chloride were dissolved in anhydrous N,N-dimethylformamide (DMF) in a 3 : 1 ratio 10 and stirred for 30 min at 20 C in a nitrogen-lled glovebox. 150 ml of the solution were drop cast onto the TiO 2 coated substrate and spin coated at 2000 rpm for 45 s. Aer spin coating, the samples were rst le to dry for 30 min at 20 C (ref. 63) and aerwards annealed on a hotplate at 100 C until the perovskite was fully formed. 10

In situ monitoring
For the in situ photoluminescence a custom setup was used in which the samples are excited with a blue LED (455 nm) at an intensity of 3 mW cm À2 and the luminescence is detected with a ber-coupled spectrometer with a spectral range of 341 to 1022 nm and spectral resolution of 0.28 nm. In situ reectance measurements were performed in the same setup using a 20 W tungsten halogen lamp for excitation and the same bercoupled spectrometer for signal detection.
During all room temperature measurements the temperature in the glovebox was kept constant at 20 AE 0.5 C. The temperature of the samples was determined using a Pt100 resistor.

Ex situ characterization
X-ray diffraction measurements were performed with a Panalytical X'PERT-PRO diffractometer using Cu K a -radiation. The samples were measured for 53 min between 2Q ¼ 10 and 70 in Bragg-Brentano geometry. All measured patterns were corrected for Cu Ka 2 -emission using the X'Pert Highscore Plus soware tool.
X-ray uorescence was measured in a custom system (IFG) using a rhodium tube with a micro-focus capillary optics with a focus spot size of 100 mm. The uorescence signal is detected with an energy dispersive detector with a resolution of 190 eV. For the measurements of the Cl-content a mean value and the standard deviation was calculated from 4 spots of each sample. The standard deviation of the Cl content lies between 0.1 and 0.2% and thus is smaller than the marker size in Fig. 4d.
Time-resolved photoluminescence was measured by excitation with a pulsed laser with 660 nm wavelength (pulse duration 100 ps) detection with a Si-Avalanche Photo Diode (time resolution 60 ps). Repetition rates of either 1 MHz or 250 kHz were used, depending on the transients measured. The excitation density, calculated from the time-averaged laser power, the repetition rate of the pulses, the spot size of the laser on the sample and absorption coefficient was F ¼ 2.45 Â 10 15 photons per cm 3 per pulse.

Conflicts of interest
There are no conicts to declare. alignment and calibrations, Martin Kärgell for synthesis of MAI and Lars Steinkopf for technical support. E. U. and K. S. acknowledge funding from the Swedish Research Council (Project 2015-00163 and Project 2018-05014) and Marie Sklodowska Curie Actions Cofund Project INCA (grant number 600398). P. B. and D. D. acknowledge support by the joint University Potsdam-HZB graduate school 'hypercells'. E. U. acknowledges funding from the German Ministry of Education and Research (BMBF) for the Young Investigator Group Hybrid Materials Formation and Scaling (HyPerFORME) within the program "NanoMatFutur" (grant no. 03XP0091).