Controlling competing photochemical reactions stabilizes perovskite solar cells

We find that long-living carrier traps related to halide defects trigger photoinduced transformations that drive both PLIE and PLID. As long as the density of traps is relatively low or they are scarcely populated, photoinduced PLIE will be dominant, but photoinduced PLID will take over in the presence of a high density of populated traps located close to the thin-film surface and grain boundaries, which provide a reservoir of binding sites for photogenerated species, eventually leading to material Metal halide perovskites have become a popular material system for fabricating photovoltaics and various optoelectronic devices. However, long-term reliability must be assured. Instabilities are manifested as light-induced ion migration and segregation, which can lead to material degradation. Discordant reports have shown a beneficial role of ion migration under illumination, leading to defect healing. By combining ab initio simulations with photoluminescence measurements under controlled conditions, we demonstrate that photo-instabilities are related to light-induced formation and annihilation of defects acting as carrier trap states. We show that these phenomena coexist and compete. In particular, long-living carrier traps related to halide defects trigger photoinduced material transformations, driving both processes. Defect formation can be controlled by blocking under-coordinated surface sites, which act as a defect reservoir. By use of a passivation strategy we are thus able to stabilize the perovskite layer, leading to improved optoelectronic material quality and enhanced photostability in solar cells.

T he interest in metal halide perovskites has been growing continuously in recent years due to the remarkable evolution of their application in photovoltaics, where power conversion efficiencies exceeding 24% have been achieved 1 , as well as promising performance in light-emitting diodes 2 , photodetectors 3-5 and lasers 6,7 . This success owes much to their optimal optoelectronics properties, that is, their high absorption coefficients and long carrier lifetimes [8][9][10] . The soft nature of the lead-halide lattice induces relatively low defect formation energies, which implies a significant probability of defects formation 11 through combined thermal-and light-induced phenomena. While the impact of defects seems not to be too detrimental with respect to the figures of merit of perovskitebased devices 12 , their activity poses a challenge to the widespread uptake of perovskite-based optoelectronic devices in terms of material stability under electrical and optical stimuli [13][14][15][16][17] . Monitoring the photoluminescence and dynamics of photogenerated charge carriers is an effective approach for gathering information about the optoelectronic properties of a semiconductor. The photoluminescence efficiency is extremely sensitive to a combination of parameters such as recombination rate constants, defect densities, carrier lifetimes and non-radiative decay paths; as such, the photoluminescence efficiency is usually taken as a measure of the material optoelectronic quality.
Since the primary function of lead halide perovskites in solar cells is to absorb light, the material response to light exposure and the possible associated phenomena are fundamental properties when creating reliable devices. A photoluminescence intensity decrease (PLID) has been observed in lead halide perovskite thin films of different composition as a result of photoinduced trap formation in inert atmosphere 18 . Enhanced photoinduced ion migration 19 has been interpreted as a defect density increase under light irradiation 20 . In direct contradiction, photoluminescence intensity enhancement (PLIE) under illumination has also been observed 21,22 , which was explained by a light-induced trap annihilation mechanism 23 . A dependence of the photoluminescence efficiency variation on defect density 24 and excitation intensity 25 , with both PLIE and PLID, has been reported. The atmosphere also has a strong impact on photoluminescence efficiency, with strong PLIE observed by exposing the sample to an oxygen-rich environment 18,[26][27][28][29][30] .
The presence of transient phenomena following electrical and photoexcitation and a lack of understanding of the mechanisms behind such phenomena have led to skepticism about the successful integration of lead halide perovskites in a reliable technology. From a more fundamental point of view, no general consensus exists on whether the observed transient behaviours can eventually lead to improved material quality or if they could actually destroy the material.
Here, we provide a comprehensive picture of the PLIE and PLID processes in methylammonium lead iodide (MAPbI 3 ) and bromide (MAPbBr 3 ) perovskites, showing that both phenomena can take place and compete in both materials by varying the illumination conditions, although with different characteristic times and temperature responses.
Combining our observations with first-principles calculations, we propose a model based on lead halide defect chemistry for both PLID and PLIE that consistently explains the overall phenomenology. We find that long-living carrier traps related to halide defects trigger photoinduced transformations that drive both PLIE and PLID. As long as the density of traps is relatively low or they are scarcely populated, photoinduced PLIE will be dominant, but photoinduced PLID will take over in the presence of a high density of populated traps located close to the thin-film surface and grain boundaries, which provide a reservoir of binding sites for photogenerated species, eventually leading to material degradation. Consistent with the developed model, we show that surface passivation of MAPbI 3 thin films allows us to switch off the PLID mechanism and make the PLIE process dominant, which translates into an associated solar cell efficiency increase and enhanced temporal stability.

Results
We monitored the photoluminescence intensity of MAPbI 3 and MAPbBr 3 perovskite thin films (used in efficient solar cell devices) as a function of illumination time. Figure 1a shows the room-temperature integrated photoluminescence over time of MAPbI 3 polycrystalline films deposited on glass. The sample was excited with a laser beam incident on the film surface. The laser was modulated with a fixed pulse width of 200 ns and varying repetition rate (that is, varying the period δ between two excitation pulses). The pulse energy was kept constant to guarantee the same carrier generation density at each excitation pulse (see Supplementary Table 1 for the average excitation intensities as a function of δ). To exclude the effect of oxygen and moisture 18,27,28 , all measurements were performed under active vacuum (pressure < 10 −5 mbar, under a constantly running pump). We observe that the photoluminescence intensity changes over time, showing both PLIE and PLID, depending on the repetition rate for both MAPbI 3 and MAPbBr 3 (Fig. 1a,c). At low repetition rates-that is, long δ, corresponding to the sample being in the dark for periods on the scale of milliseconds-the photoluminescence intensity grows cumulatively with subsequent illumination periods. On increasing the repetition rate-short δ, corresponding to longer light exposure and less time in the darka quenching process kicks in, which eventually becomes dominant (Fig. 1a). These observations clearly indicate that light absorption can lead to competing PLIE and PLID phenomena, depending on the excitation conditions. We thus performed additional experiments at varying temperatures to disentangle the factors underlying the individual phenomena involved in PLIE and PLID. Figure 1b shows the time evolution of the integrated photoluminescence intensity of a MAPbI 3 film excited with continuous-wave (c.w.) light, analogous to a very high repetition rate (that is short δ), at different temperatures. Each curve was taken on a fresh spot of the sample. For MAPbI 3 , at 77 K the photoluminescence is stable for the entire duration of the experiment, and the same holds when heating the sample to 137 K. On further raising the temperature to 197 K we observe a strong PLIE over time; this is further boosted on increasing the temperature to 237 K, leading to an approximately eightfold photoluminescence increase compared to the initial value. At still higher temperature (277 K) an initial PLIE is superseded by PLID at longer exposure times, which eventually dominates at room temperature and above. Similar behaviour was observed for MAPbBr 3 films on varying the temperature, but with lower thresholds for PLID and PLIE (Fig. 1d), allowing us to safely exclude any role of structural phase transition in the observed dynamics ( Supplementary Fig. 27).
The variations in photoluminescence intensity with increasing temperature, and the transition from stable photoluminescence to PLIE and to PLID, is clearly suggestive of competing thermally activated processes that either improve or hinder the efficiency of radiative recombination. The dominant contribution of PLID at higher temperature suggests a higher energy demand for this process compared to PLIE. Also, the enhanced stability range of MAPbI 3 compared to MAPbBr 3 at low temperatures (see Fig. 1b  starting at 277 and 197 K, respectively) suggests that the threshold for switching between the two phenomena is determined by the precise material composition, in particular by the nature of the halide. To identify what additional factors affect the PLID and PLIE processes, we investigated the photoluminescence time evolution of MAPbI 3 as a function of the excitation wavelength, as shown in Fig. 2a. The incident photon density over the illuminated spot area was kept constant, and each curve was taken on a fresh spot of the film. We observe that PLID is significantly enhanced at shorter excitation wavelengths, while band-edge excitation results in more stable photoluminescence. Besides the additional thermal energy provided by above-gap excitation, shorter-wavelength light also has significantly shorter penetration depth (Fig. 2b). This results in a higher carrier generation close to the film surface, with a factor of ∼2 increase in the first 30 nm film away from the surface in the case of 480 versus 750 nm excitation. While we cannot exclude direct excitation of PbI 2 as the cause of PLID and PLIE 30 , the observation of both phenomena for MAPbBr 3 is consistent with a minor role of this phenomenon in our conditions, as excitation of the higherbandgap (∼4 eV) PbBr 2 phase only occurs at much shorter excitation wavelength than those used in our experiments. Our observations suggest that the competition between PLID and PLIE is strongly related to the illumination conditions of the thin film, which may include factors such as proximity to the reactive surface, uniformity of the excitation profile, and excitation density, with a possible contribution of thermal dissipation effects following photoexcitation.
To complement our phenomenological consideration, we investigated whether the experiment geometry could affect the relative weight of PLID versus PLIE. We find a reproducible PLIE when illuminating the film from two sides (the open surface and the glass side) with two identical beams covering a large area of the thin film, suggesting that uniform illumination may reduce the impact of PLID (Fig. 2c). Similar observations, that is, a switch from PLID to a more stable photoluminescence, are also made by varying the lateral illumination gradient ( Supplementary Fig. 7).
To provide a rationale for these observations we first consider the possible role of trap-state filling, followed by de-trapping, as a possible cause determining the observed phenomenology. Despite the long lifetimes of trapped carriers in both MAPbI 3 and MAPbBr 3 (refs. 12,18,31 ), extending up to several microseconds, the timescales spanned by the repetition rates in Fig. 1a are too long to be solely explained by trapping/de-trapping mechanisms. The system can reach almost a stationary density of charge carriers within the 200 ns pulse (see Supplementary Figs. 2-4 and 22-25 for simulations of charge carrier dynamics under c.w. or modulated illumination). Note that the change in modulation mainly results in a change in the averaged excitation intensity and an enhancement of the photoluminescence absolute value at time t = 0, due to an associated enhancement of counts during the integration ( Supplementary  Fig. 26). If no concomitant processes take place, though, the millisecond delay time between two consecutive pulses allows the system to return to the ground state before a second pulse comes, in contrast to the cumulative effect of pulsed illumination observed in Fig. 1a and c. At the same time, charge/lattice interaction through the formation of large polarons 32 shows lifetimes comparable to those of the charge carriers, inconsistent with the cumulative effect observed with millisecond delays. Similarly, we can rule out a role of light-induced release of lattice strain 33 in PLIE, because electronic effects are too fast to provide a cumulative effect on the millisecond repetition timescale of our experiments. The timescales involved in PLID and PLIE are consistent with the reported ionic activities, such as ion/defect annihilation and migration rates, in both MAPbI 3 and MAPbBr 3 (refs. 23,34 ) and with the timescale of photoinduced transformations in free-standing MAPbI 3 films 35 . Comparably, in mixed halide (I, Br) perovskites ion segregation was shown to take place via halide defects, mainly vacancies and interstitials, driven by the gradient in carrier generation through the thickness of these strongly absorbing materials [36][37][38] . Importantly, the observation of typical spectral features associated with trap carriers and defects in the lattice that are enhanced under c.w. illumination (Supplementary Figs. 8 and 9) is suggestive of photoinduced defect formation and annihilation being respectively related to PLID and PLIE.
With the aid of first-principles calculations we propose a model based on lead halides defect chemistry that allows us to consistently explain the observations of the data set presented above. MAPbI 3 and MAPbBr 3 show a remarkably similar defect chemistry (see Supplementary Information for a comparative analysis based on hybrid density functional theory calculations including spin-orbit coupling) that is dominated by lead vacancies (V Pb ) and interstitial halogen (I i or Br i ) defects. We henceforth use this notation for defects in MAPbI 3 -for example, I i -but the mechanism applies similarly to MAPbBr 3 . We notice, however, that for the latter the involved defects are somehow shallower than in MAPbI 3 ( Supplementary  Fig. 10). Both halide interstitials and lead vacancies show thermodynamic ionization levels in the bandgap. At the calculated native Fermi level, V Pb is stable in the 2− charge state, so this defect could trap holes by the (−/2−) transition level, whose energy falls 0.13 eV above the valence band, while I i − exhibits a (0/−) charge transition 0.29 eV above the valence band. The partial shallow character of the V Pb transition, less deep than I i , and the high migration barriers associated with the diffusion of the defect (E a ~ 1.0 eV) 39 highlight that this defect is only moderately active as a trap, while I i can significantly trap both electrons and holes ( Supplementary Fig. 10) through the (+/0) and (0/−) transitions. Hole trapping/de-trapping at I i − is a relatively fast process, while electron trapping at I i + induces long living states due to the strong associated geometrical relaxation decreasing the kinetics of electron de-trapping 12,31 . The promoter of possible material transformations must be a long-living species, whose formation may trigger subsequent photochemical transformations leading to both PLID and PLIE. The most natural candidates are thus the filled electron traps with their associated lifetime of several (tens to hundreds) microseconds.
Recombination of I i − with V I + was proposed as a means of trap annihilation 23 , which restores the pristine material and decreases the concentration of traps; thus it can be associated with PLIE. Here we further disclose that long-living electrons at trapped I i + defects may additionally mediate Frenkel defect annihilation.
Briefly, the formation of a I i -V I + Frenkel pair in the presence of a neighbouring I i + is endothermic by 0.55 eV because this process requires breaking of a Pb-I bond and displacement of the I i -V I + defects (Fig. 3a). Upon electron trapping at I i + , which is preferentially located next to I i − , the system is further destabilized by 0.31 eV (Fig. 3b), adding a significant driving force to restore the pristine material. The long-living nature of the formed I i 0 , which mirrors the long electron de-trapping time, may allow sufficient time for I i -V I + annihilation to effectively take place. Further insight into such a process was obtained with ab initio molecular dynamics. We start from the minimum energy geometry of an I i -V I + Frenkel pair interacting with I i + (Fig. 3a) and add one electron to the system, following the dynamical evolution of this globally neutral system. A sequence of ion reorganization and migration events can be visualized (Fig. 3c): (1) following electron trapping at I i + , confirmed by spin localization at the defect site, the system rapidly reaches the minimum energy structure of I i 0 (blue line in Fig. 3c in the direction of I i − (red and magenta lines in Fig. 3c); (3) I i − further migrates in the direction of V I + (green and magenta lines in Fig. 3c). The results are consistent with electron trapping at I i + promoting I i -V I + annihilation, as inferred from the two oppositely charged defects migrating towards each other twice within less than 10 ps. A simulation starting from the same structure but with no added electron at I i + did not show any shortening of the I i -V I + distance, although the I i + /I i − defects jointly migrated in the investigated time (Supplementary Fig. 11).
The light-induced PLIE process can be schematized as follows: where prist represents the pristine material. Annihilation of the I i -V I + Frenkel pair is entropically disfavoured, with a small energy barrier related to the migration of I i − and V I + (∼0.1 eV) 40 . This reaction is thus favoured at low temperature but it still requires a sufficient thermal energy to accomplish defect migration.
The de-trapping reaction instead has a significant activation energy (0.29 eV) 12 , so the annihilation process of equation (1), mediated by the high ion mobility of iodine defects, can effectively prevail over the thermally activated detrapping of equation (2). Such a PLIE mechanism is fully consistent with the data of Fig. 1b, showing a preferential PLIE at low temperature but no PLIE if the temperature is too low to hamper defect migration. In the absence of other (PLID) processes this PLIE mechanism is cumulative because it requires a long time after de-trapping to restore the initial density of Frenkel defects due to the endothermic nature of the process, with the possible associated entropic gain hindered at low temperature. By definition, in a Frenkel defect an ion leaves its place in the lattice, creating a vacancy, and it becomes an interstitial by lodging in a nearby location, thus we expect to observe their annihilation happening even when only short-range migration is allowed (for example, at low temperature). The PLID process is probably more complex than PLIE. We know that PLID is favoured by high illumination repetition rates. This, in turn, is associated with a larger fraction of traps being filled at any time, and possibly to a higher effective temperature due to heating of the sample. We also know from the wavelength dependence of PLID that this process is more efficient when the photogeneration happens close to the surface where a larger trap density can be envisaged. It is also amplified when ion diffusion is enhanced, that is, by the presence of gradient across dark/light regions.
A possible PLID mechanism could thus be reasonably associated to a bimolecular reaction-boosted by increasing the encountering probability of the reactants, by increasing their density and/ or their mobility-occurring among the filled, long-living traps, in a film region close to the surface. Following the initiating trapfilling reaction of equation (2), two filled traps could react to form an I 2 molecule: This radical quenching reaction, involving two coordinated I 2 − molecules 41 , takes place with virtually no energy barrier ( Supplementary Fig. 12) being only limited by the diffusion of the reactants. Such a bimolecular reaction is favoured by a high trap concentration in a small volume, which increases the probability of a bimolecular encounter, as realized by the high irradiation intensity of short wavelength, as well as by allowing for long-range I i 0 migration. The direct recombination of two interacting I i − /I i + defects to give I 2 instead has a fairly high activation energy (0.33 eV, when calculated among surface-adsorbed species; Supplementary Fig. 13).
Sequential electron and hole trapping could alternatively take place at the I i + / I i − defect pair: The last reaction step leads to the same I 2 product as equation (3), but its reaction probability is likely to be limited by the short-living trapped hole at I i − . A filled trap may also take a second electron to form I i − : The bielectronic reaction in equation (5) is favoured by high irradiation intensity. The formation of I 2 is possibly favoured over capture of a second electron, but both mechanisms can coexist. I 2 loss into toluene solution following MAPbI 3 light irradiation was recently reported 20 , consistent with equations (3) and (4). I 2 can be trapped as a complex in the bulk (formally I 4 2− , Fig. 3d) or it may disproportionate to reform the I i + / I i − pair 40,42 . Importantly, both coordinated I 2 and the I i + / I i − pair tend to migrate to the surface, being stabilized by ∼0.4 eV. A surface-coordinated I 2 molecule represents the final reaction product (Fig. 3e). Such an I 2 molecule can remain bound to the surface or to grain boundaries. Notably I 2 can act as an electron trap, as I i + does. The iodine imbalance between surface and bulk can trigger a series of compensating reactions that regenerate the starting equilibrium distribution of I i + / I i − defects to compensate their transformation to surface-bound I 2 . This can be accomplished by disrupting the pristine lattice as Note that V Pb 2− + 2V I + corresponds to the loss of PbI 2 , which may segregate as a separate phase, with consequent material degradation 43 and associated PLID. Alternatively, metallic Pb could nucleate on the material surfaces 44 .
The trigger to PLID is thus the surface (or grain boundary) stabilization of coordinated I 2 . Treating the thin film with appropriate passivating agents and blocking undercoordinated surface Pb atoms is thus the key to avoid PLID 45 . Surface passivation will result not only in an improvement of the absolute photoluminescence quantum yield of the semiconductor thin film (surface-bound I i − is destabilized when the MAPbI 3 surface is capped by aliphatic ethers; Supplementary Fig. 14) but also hamper the PLID phenomenon, leaving room for PLIE to happen.
The key to blocking PLID and probably to significantly slow down perovskite degradation is passivation of the surface sites to which I 2 can bind in its various forms. These undercoordinated Pb surface sites, only marginally involved in trapping/de-trapping events, act as a reservoir for I 2 , leading to iodine imbalance in the bulk and stimulating the production of additional defects. The process continues until surface sites are saturated, after which the material may start releasing I 2 and possibly form a segregated PbI 2 phase. Figure 4 summarizes the PLIE and PLID mechanisms.
To check the importance of the surface in PLID, we compared a pristine MAPbI 3 film with one coated with tri-n-octylphosphine oxide (TOPO) or polyethylene oxide (PEO) (Fig. 5a). TOPO has been applied for the passivation of perovskite films, resulting in enhanced photoluminescence efficiencies and lifetimes 10 . PEO is a polymer containing polar ether groups and hydroxyl terminations, providing a moisture barrier and a possible passivating agent 46,47 . In Fig. 5a, by illuminating a fresh spot on the samples (560 nm, c.w. excitation, fluence of ~0.1 µJ cm −2 ) and monitoring the integrated photoluminescence signal over a few minutes, we observed a slow quenching for the bare MAPbI 3 thin film and an initial enhancement followed by a slower quenching for the TOPO-passivated thin film. On the other hand, in the presence of PEO we observe that the mechanism leading to PLID is switched off even at room temperature (Fig. 5b). Despite TOPO and PEO both being characterized by the presence of oxygen atoms that interact with undercoordinated surface Pb atoms ( Supplementary Fig. 14) the increased PLIE observed with PEO is suggestive of a more effective passivation by the latter, probably because of the larger fraction of oxygen atoms versus aliphatic carbon chains in PEO. Figure 5b shows the relative photoluminescence quantum yield (PLQY), calculated as the integrated photoluminescence intensity normalized by the excitation intensity, of MAPbI 3 films. Each data point was taken after a hold time of ~30 s. When measuring from low to high excitation intensities (solid lines) and then in reverse order (dashed lines), we observe a hysteretic behaviour resulting from photoinduced trap formation, that is, PLID and a concomitant photoluminescence intensity reduction from bare perovskite thin films. By illuminating the film from the passivated side, both the TOPO-and PEO-coated samples show a higher photoluminescence signal, indicating a decrease in the density of native defects on the thin-film surface. Thus, also in agreement with the data shown in Fig. 5a, the sample coated with TOPO shows a less pronounced hysteretic behaviour compared to the uncoated film, while the PEOpassivated thin film presents an opposite hysteretic behaviour of the relative photoluminescence as a function of excitation intensity, as a consequence of a dominant PLIE process. This clearly shows that efficient surface passivation can reduce the density of defect states and photostabilize the perovskite thin film. To connect our experimental and computational model, in particular the central role of surface-stabilized I 2 in PLID, we investigated the I 2 -releasing reaction in hexane solution from MAPbI 3 films considering three cases: (1) the bare thin film; (2) MAPbI 3 capped by an inert polystyrene film 48 ; (3) a PEO-passivated film. In line with the results of ref. 20 , prolonged irradiation of the bare MAPbI 3 and polystyrene-capped thin films produced the same amount of I 2 , while a significant reduction in I 2 production was observed for the PEO-passivated thin film (Supplementary Figs. 18-20). The passivating PEO layer has a significant technological relevance as it allows for the formation of high-quality interlayer thin films that can be easily implemented in perovskite solar cells. In Fig. 5c we show the J-V characteristic of MAPbI 3 -based solar cells. Here, we add PEO interlayers between the perovskite active layer and the selective charge-extracting layers. The PEO layer is seen to improve the open-circuit voltage (V oc ) when applied to either the electron-or hole-extracting interface, with the best performance given by the device with PEO applied to both sides (see Supplementary Table 2 for the figures of merit of the devices and Supplementary Fig. 15 for their statistics). In Fig. 5d we show the evolution of the V oc of solar cells with and without the PEO interlayers under 1 sun illumination (see Supplementary Fig. 17 for monochromatic photoexcitation). The devices were encapsulated in an inert atmosphere. Despite the fact that the perovskite layer in the reference device is already interfaced with materials that have to some extent a passivating role, such as C 60 (refs. 49,50 ), we still see competing dynamics in the V oc that mirror the PLID and PLIE shown in Fig. 5a. However, the relative contribution of the PLID is drastically reduced in the PEO-treated device, resulting in a higher and more stable V oc .
Most notably, the PEO-passivated device also shows significantly longer stability under light soaking at the maximum power point, retaining more than 90% of its initial efficiency for 15 h, while the bare MAPbI 3 device loses 35% of its initial efficiency within the first 6 h (Supplementary Fig. 21).
It is worth mentioning that light-emitting diodes may operate at a relatively high density of carriers, and thus may suffer more from the PLID mechanism. As we have demonstrated, PEO interlayers are capable of passivating the perovskite surfaces, minimizing the formation of degradation products (I 2 ) without blocking charge injection in the device. We therefore believe that PEO could also be beneficial for light-emitting diode stability.

Conclusions
In summary, by monitoring the evolution of photoluminescence intensity under systematic control of the experimental parameters we have identified two distinct processes behind the instabilities observed in lead halide perovskites, excluding effects related to the atmosphere. We demonstrate that such processes are happening simultaneously within thin films under photoexcitation and that, depending on the conditions, one process can overcome the other, thereby reconciling the conflicting reports in the literature and providing a consistent understanding of photoinduced phenomena in this class of materials. Based on simple, yet comprehensive, experimental evidence, we are able to provide a clear model in which longliving trapped carriers-typical of halide photochemistry-mediate photoinduced ionic dynamics and lead to a dominant photoluminescence enhancement or decrease. The latter stems from a bimolecular reaction due to the encounter of two I 0 species to form I 2 , and thus it is favoured in the presence of high trap density concentration and/or high temperature. The stabilization of coordinated I 2 at the surface (or grain boundary) is a fundamental factor for the efficiency loss. On the basis of this, we show that passivating the thin film surface prevents the detrimental process leading to photoluminescence decrease, favouring defect healing. This allows us to target the relevant defect sites by passivating the semiconductor surface with PEO interlayers, improving device performance and stability.

online content
Any methods, additional references, Nature Research reporting summaries, source data, statements of code and data availability and associated accession codes are available at https://doi.org/10.1038/ s41566-019-0435-1.
MAPbBr 3 thin films. These films could be fabricated by an adapted nanocrystalpinning technique 51 . In this case, two steps of spin-coating speed were used (500 r.p.m. for 7 s, 3,000 r.p.m. for 90 s). After spin-speed acceleration, a solution of MABr and PbBr 2 (molar ratio 1.05:1) in DMSO was spin-coated onto the clean glass substrate. After 60 s, pinning occurred by dropping 300 µl of chlorobenzene onto the spinning sample. The samples were then baked at 90 °C for 10 min.
MAPbI 3 thin films. These films were fabricated by quenching a precursor solution with an antisolvent during spin coating 52 , in a nitrogen-filled glovebox. A 1.45 M precursor solution of PbI 2 :MAI:DMSO in a molar ratio of 1:1:1 was prepared in DMF. This solution was spin-coated onto the glass substrate at 4,000 r.p.m., with an acceleration of 4,000 r.p.m. s −1 , for 15 s. After 6 s, toluene (an antisolvent to the precursor solution) was dropped onto the spinning sample by pipette. The samples were then annealed at 100 °C for 10 min.
MAPbI 3 thin films with passivation. TOPO or PEO was dissolved in anhydrous chlorobenzene at a concentration of 10 mg ml −1 . Solutions were sonicated for 10 min for complete dissolution before deposition on top of the perovskite film by spin-coating at 4,000 r.p.m.
Device fabrication. Film fabrication. Indium tin oxide (ITO) on a glass substrate was etched with 2 M aqueous HCl solution and zinc powder (Sigma Aldrich). The ITO substrates were sequentially washed with 2% Hellamanex in deionized water, deionized water, isopropanol, acetone, isopropanol in a sonication bath, followed by O 2 plasma cleaning for 10 min. The cleaned ITO substrate was covered with a SnO 2 layer (~20 nm) by spin-coating of a diluted SnO 2 nanoparticle solution (Alfa Aesar) and annealed at 180 °C for 1 h. On the SnO 2 layer, a C 60 layer was deposited from a C 60 solution (10 mg ml −1 ) in 1,2-dichlorobenzene by spin-coating at 3,000 r.p.m., followed by thermal annealing at 100 °C for 10 min. The perovskite layer was fabricated by applying an anti-solvent quenching method. For the hole transport layer, a spiro-MeOTAD solution was spin-coated on the perovskite layer at 4,000 r.p.m. for 30 s. Spiro-MeOTAD solution was prepared by dissolving 73 mg of spiro-MeOTAD in 1 ml chlorobenzene (99.8%, Sigma-Aldrich), to which was added 28.8 μl of 4-tert-butylpyridine (96%, Sigma-Aldrich), 17.5 μl lithium bis(trifluoromethanesulfonyl)imide (LiTFSI) solution (520 mg LiTSFI in 1 ml acetonitrile, 99.8%, Sigma-Aldrich). This fabrication process was carried out under controlled conditions in a glove-box atmosphere. Finally, 75 nm gold was thermally evaporated on top of the device at a pressure of 1 × 10 −6 mbar to form the topcontact electrode.

Solar cell characterization.
All devices were measured under simulated AM1.5 solar illumination using a class AAA solar simulator (Oriel Sol3A, Newport). The illumination intensity was calibrated using an unfiltered certified Si reference diode (area = 4 cm 2 , Newport) to be 100 mW cm −2 (typical spectral mismatch factor of 1.01 for solar cells based on CH 3 NH 3 PbI 3 ). The current density-voltage (J-V) characteristics were recorded with a Keithley 2440. No light soaking or pre-biasing was applied before the J−V measurements. The illuminated electrode area, defined with a holed black anodized aluminium mask, was 0.0935 cm 2 . Devices were measured in an ambient atmosphere at 23 ± 2 °C and 40-60% relative humidity. The scan rates of the J-V sweep were 0.2 V s −1 . The forward scan was from 0 V (the short-circuit condition) to 1.4 V, and the backward scan was from 1.4 V to 0 V. The stability of the current/power output with time was recorded for 120 s. The external quantum efficiency was measured with a home-built set-up. The external quantum efficiency spectra were recorded using the monochromated (Bentham) output from a tungsten halogen lamp calibrated with a Newport UV-818 photodiode.
Transient open-circuit voltage measurements. The excitation source was simulated AM1.5 solar illumination produced using a class AAA solar simulator (Oriel Sol3A, Newport) or an unfocused beam of a 450 nm c.w. diode laser (Oxxius). The beam was expanded to match the active area of the device (~0.1 cm 2 ) and the excitation power density was ~100 mW cm −2 . The devices were encapsulated using epoxy and glass, and then mounted perpendicular to the excitation. A Keithley 2401 instrument was used to measure the transient opencircuit voltage over a duration of ~1,500 s.
Modulation frequency-dependent photoluminescence. Excitation was provided with a c.w. diode laser (Oxxius laserboxx). The excitation wavelength was 405 nm for MAPbBr 3 films and 450 nm for MAPbI 3 . Modulation was accomplished using a waveform generator connected directly to the laser. Pulse widths were kept fixed to exclude the effects of varying illumination times so we could probe only the dependence on the intervals in the dark. MAPbI 3 films were illuminated with pulses of 200 ns at frequencies of 1, 3, 10 and 30 kHz. MAPbBr 3 films were illuminated with pulses of 10 µs and frequencies of 50, 500 and 5 kHz. The excitation fluences used were ~0.5 µJ cm −2 , corresponding to an excitation density of ~1 × 10 16 cm −3 . Samples were mounted inside a vacuum chamber mounted on a translation stage that allowed fresh spots to be probed between every curve by changing the sample height without damaging the collection alignment. Photoluminescence was collected in reflection mode and focused into a fibre coupled to a spectrometer (Ocean Optics Maya Pro 2000).
Temperature-dependent photoluminescence. Excitation was provided with a c.w. diode laser (Oxxius laserboxx). The excitation wavelength was 405 nm for MAPbBr 3 films and 450 nm for MAPbI 3 . The excitation intensity was ~50 mW cm −2 , corresponding to an estimated excitation density ~1 × 10 16 cm −3 . Films were mounted in vacuum in a cold finger cryostat cooled with liquid N 2 (Oxford Instruments), perpendicular to the excitation line. The excitation beam was directed to the sample by a dichroic mirror and photoluminescence was collected in reflection mode and focused into a fibre coupled to a spectrometer (Ocean Optics Maya Pro 2000).
Double-sided illumination. The beam of a 560 nm c.w. diode laser (Oxxius) was expanded and collimated with a telescope to a diameter of ~3 mm. A beamsplitter was used to obtain the two excitation lines and attenuators were used to balance the intensities. Samples were mounted inside a vacuum chamber (pressure below 1 × 10 −5 mbar) and photoluminescence was collected at a right angle to the excitation line and focused into a fibre coupled to a spectrometer (Ocean Optics Maya Pro 2000).
Photoluminescence on passivated samples. The excitation source was an unfocused beam of a 560 nm c.w. diode laser (Oxxius). Samples were mounted inside a vacuum chamber (pressure below 1 × 10 −5 mbar) and photoluminescence was collected in reflection mode at a right angle from the excitation line and focused into a fibre coupled to a spectrometer (Ocean Optics Maya Pro 2000). Integrated photoluminescence over time was measured on fresh spots of the film with an intensity of ~40 mW cm −2 .
For relative PLQY measurements, the integrated photoluminescence was measured at varying excitation intensities and plotted as = I I Relative PLQY PL pump Excitation wavelength dependence. The excitation source was a supercontinuum laser (SuperK Extreme, NKT Photonics), spectrally filtered by an acousto-optic modulator (SuperK Select, NKT Photonics). The selected output was directed to a home-built transmission microscope in a confocal configuration. The sample was placed on top of a piezoelectric translation stage. The photoluminescence transients (Fig. 2a) were taken by tuning the wavelength of the acousto-optic modulator output and monitoring the photoluminescence over time with a spectrometer (Ocean Optics Maya Pro 2000) coupled to the microscope for detection.

Data availability
The data that support the plots within this paper and other findings of this study are available from the corresponding authors on reasonable request.