Full-frame and high-contrast smart windows from halide-exchanged perovskites

Window glazing plays an essential role to modulate indoor light and heat transmission, which is a prospect to save the energy cost in buildings. The latest photovoltachromic technology has been regarded as one of the most ideal solutions, however, to achieve full-frame size (100% active area) and high-contrast ratio (>30% variable in visible wavelength) for smart window applicability is still a challenge. Here we report a photovoltachromic device combining full-transparent perovskite photovoltaic and ion-gel based electrochromic components in a vertical tandem architecture without any intermediated electrode. Most importantly, by accurately adjusting the halide-exchanging period, this photovoltachromic module can realize a high pristine transmittance up to 76%. Moreover, it possesses excellent colour-rendering index to 96, wide contrast ratio (>30%) on average visible transmittance (400-780 nm), and a self-adaptable transmittance adjustment and control indoor brightness and temperature automatically depending on different solar irradiances.

S ince the original photoelectrochromic devices (PECDs) based on liquid dye-sensitized solar cells (DSSCs) was described by Bechinger et al. 1 , the development on selfdriven smart windows has been evolving for quarter century 2 . One step forward for PECDs was disclosed by Wu et al. 3 , who presented the first photovoltachromic devices (PVCDs) combining the photovoltaic (PV) and electrochromic (EC) features of DSSCs in a separated electrode architecture 3 . This breakthrough broadened the PV technologies to all solid-state candidates, such as amorphous silicon (α-Si), organic photovoltaic (OPV) 4 , and perovskite solar cell (PSC) 5 . Nevertheless, the integration of solid PVCDs for building envelopes was filled with more challenges than liquid PECDs. Starting from the external connections between separated opaque PV and EC devices, these systems were not truly monolithic structure devices, and in simple terms, merely shortened power delivery distance from the photovoltaic power generator to terminal electrical equipment, which were too cumbersome for building integrated applications. Soon afterwards monolithic integration was succeeded by a parallel side-byside architecture. Unfortunately, the opaque or semi-transparent PV component was unable to be chromotropic as an inactive area, limited its application as ideal smart windows requiring 100% active coverage (Fig. 1a). Ultimately, vertical tandem architecture was considered as the most advanced integrating strategy. This monolithically hierarchy configuration demanded a high visible transparency for both PV and electrode layers. Otherwise these layers would block the visible sunlight through smart windows for indoor illumination. In view of this, recently semi-transparent characteristics had applied into tandem structure PVCD by using two pathways: (i) Physically reducing the thickness or patterning voided windows on intrinsically opaque PV layers led to low pristine transmittance (T%) and low contrast ratio in PVCDs (Supplementary Table 1). (ii) Chemically broadening the optical bandgap of PV materials to absorb only partial visible wavelength resulted in an uncomfortable visual environment and poor color-rendering index (CRI) (PVCDs appeared orange or brownish, since they only absorbed bluegreen radiation). In this work, we present a facile full-solution processing technique to realize a full-transparent perovskite PV layer with high pristine T% and excellent CRI. Based on this we manufacturing a monolithic photovoltachromic smart window using visibly-transparent perovskite and flexible electrochromic ion-gel 6 .

Results
High quality MAPbCl 3 films based on ion-exchanged reaction. Metal halide perovskites become state-of-the-art in the optoelectronic field because of their high power conversation efficiency (PCE), abundant diversified ingredient, and tunable absorption across the whole visible spectrum 7,8 . Transparent photovoltaic technology provides an effective way to fabricate power generation smart windows, building integrated photovoltaics, agricultural greenhouses, and other fields 9 . However, compared to iodide and bromide counterparts, chloride perovskite has been rarely exploited in PV application due to its limited solution-processability and over-grown crystallinity, leading to poor film morphology and massive grain boundary recombination. Thus the photograph of Methylamine lead chloride (MAPbCl 3 ) perovskite film prepared by one-step solution (named 1-step MAPbCl 3 ) spin coating method exhibits a frosted appearance with high haze (Fig. 1b). Herein, we have developed a halide-exchanging technology ( Supplementary  Fig. 1), which could convert the solution-processable bromide perovskite (MAPbBr 3 ) film with into full transparent perovskite (named 2-step MAPbCl 3 ) with a low haze for further enhancing film transmittance (Fig. 1b). Semi-transparent MAPbBr 3 perovskite layer was originally composed of condensed grains, then shrunk along grain boundaries during halide-exchanging process, and finally formed transparent 2-step MAPbCl 3 film in 15 min (Fig. 1b). By contrast, 1-step MAPbCl 3 films have the morphology of isolated cubic blocks with the scale of tens of microns. The T% spectra of perovskite films (Fig. 1c) exhibited that the shortest transparent cut-off wavelength was shifted from 525 nm of pristine Methylamine lead bromide (MAPbBr 3 ) to 407 nm of 15-min ion exchange 2-step MAPbCl 3 and the average visible transmittance (AVT) (400-780 nm) was raising along with the halide-exchanging period from pristine 44-76% for 15 min. It was worth noting that although the absorption cutoff wavelength of the 1-step MAPbCl 3 film was also around 405 nm, the transmissivity of visible light was very poor with a AVT of 15%. It was obvious that the result is directly related to the haze of the film. In order to prove this point, the haze values of three perovskite films were characterized, manifesting 95.8% of 1-step MAPbCl 3 , 32.2% of MAPbBr 3 , and 34.6% of 2-step MAPbCl 3 perovskite films, respectively. The X-ray diffraction spectrum (XRD) was performed to confirm the incorporation of Cl into the MAPbBr 3 lattice (Fig. 1d). The diffraction peaks at 15.0°and 30.2°from the pristine sample were ascribed to the (100) and (200) of MAPbBr 3 crystal, respectively 10 . During halide anion exchange, these characteristic peaks moved toward higher angles because of crystal lattice shrinkage. After 15 min ions exchange peaks shifted to 15.6°and 31.4°, respectively, which were coincided with the characteristic diffraction peaks of the cubic phase of MAPbCl 3 as previously reported 11 , suggesting the completed conversion of MAPbBr 3 into MAPbCl 3 . In meanwhile, there are diffraction peaks at 22.2°and 35.3°of 1-step MAPbCl 3 film attributing to (110) and (120), and extra signals from FTO substrate, which indicates that the 1-step MAPbCl 3 film has poor growth orientation and many covering defects on substrate.
Optimization of MAPbCl 3 perovskite film for PVCD. In order to find out the optimal halide ingredient in perovskite for PVCD, the halide-exchanging progress was further investigated. The extrapolation of the linear part of the Tauc plot ( Fig. 2a) showed the optical gap of MAPbBr x Cl 3−x were shifted from 2.24 eV to 2.95 eV, corresponding to band gaps of pristine MAPbBr 3 and MAPbCl 3 perovskites 12,13 . It was noticed that, after 10-minute anion exchange, the band gap shifted to 2.89 eV, enabling saturated CRI and AVT. The synchrotron-based 2D grazing-incident wide-angle X-ray scattering (GIWAXS) was conducted on a series of samples, including pristine MAPbBr 3 and MAPbBr x Cl 3−x perovskites with different halide-exchanging periods (Fig. 2b). The coordinate of inplane direction (q xy ) and out-of-plane direction (q z ) diffractions corresponding to perovskite (110) lattice planes are obviously shifted from (1.07, 1.08) for MAPbBr 3 to (1.12, 1.12) for MAPbBr x Cl 3−x (10 min) because of crystal lattice shrinkages ( Supplementary Fig. 2). To investigate the influence of the anion exchange on the HOMO energy level of MAPbBr x Cl 3−x , the HOMO energy level of perovskites with different reaction periods were determined by photoelectron yield spectroscopy (PYS). Where a molecular of 2,2′,7,7′-tetrakis[N,N-phenothiazine]-9,9′-spirobifluorene (Spiro-PT) 14 was employed as hole transport material (HTM) because of matchable HOMO energy level (Fig. 2c). The detailed elemental distribution in PV component was further analyzed by time-of-flight secondary-ion mass spectra (ToF-SIMS) (Fig. 2d), which reveals clear boundaries of functional layers ascribed to anion counts of S − , Br − , Cl − , and F − . Additionally, doping information could be observed more clearly in the corresponding 3D distribution images (Fig. 2e). Notably, the intensity of Cl − is increasing whereas that of Br − is decreasing from bottom to top side, in accordance with the halide-diffusion mechanism from solution to film. Therefore, based on the halide exchanged strategy, the Cl/Br ratio in perovskite is a gradient distribution in vertical direction, resulting in a graded heterojunction with variable molecular orbital energy levels 15 , whose functionality in photoelectronic devices will be discussed afterwards.
Solar-driven smart window plays an essential role to modulate indoor illumination and temperature, which is the most ideal glazing technology to save the energy cost in buildings. To date, many prototypes of PVCDs based on liquid dye-sensitized solar cells or side-by-side device structure or opaque perovskite layers or four-terminal external circuits have been reported (Supplementary Table 2) 2, [16][17][18] . It is still a challenge to realize the ideal solar-driven smart window in solid state with simplest twoterminal electrodes in full-frame size. In order to achieve such ultimate smart window architecture, we fabricated a monolithic PVCD as glass/FTO/ PV/electrochromic (EC) gel/FTO/glass architecture via a full solution process ( Supplementary Fig. 3), which presented a feasibility for scale-up large-area device (ca. 36 cm 2 ) ( Supplementary Fig. 4). This sandwiched PVCD architecture was unambiguously observed by cross-section SEM images ( Fig. 2f) in which the flexible EC gel 6 (~90 μm in thickness) exhibited sufficient ohmic contact and mechanical strength on the top of the PV component (~800 nm in thickness). The partially enlarged details presented the PV submodule consisted of 300 nm ETL, 350 nm perovskite and 40 nm HTL.
To further understand the working mechanism that occurred in this monolithic PVCD, we separately prepared individual PV and EC components and analysed their energy levels. The valence bands (VBs) and conduction bands (CBs) of Spiro-PT and perovskites with different reaction-diffusion periods were calculated by PYS (Fig. 2a) and cut-off edge of absorption spectra (Fig. 2c), which are in accordance with literatures 19 Fig. 1 Evolution on architectures of PVCDs and characterization of perovskite films. a Four-terminal side-by-side PV-EC device architecture: two terminals of PV element and two terminals of EC element were connected via two external circles. Two-terminal monolithic integrated PVCD architecture in this work: only one external circle required to connect top and bottom terminals, which is the most ideal structure for achieving full-frame active area and high transmittance synchronously. b The photographs and SEM images of 1-step MAPbCl 3 , MAPbBr 3 and 2-step MAPbCl 3 film respectively. Scale bar is 5 μm. c The transmittance spectra of 1-step MAPbCl 3 , MAPbBr 3 and 2-step MAPbCl 3 films. d X-ray diffraction patterns of 1-step MAPbCl 3 , MAPbBr 3 , and 2-step MAPbCl 3 films.  Table 3). Therefore, one key factor to realize a working monolithic PVCD is keeping Br-rich perovskite residually at the ETL side. Fortunately, our aforementioned ToF-SIMS analysis (Fig. 2d) presented that the reaction-diffusion process could create a gradient Cl/Br distribution in perovskite, which offered an intermediate energy ladder of Br-rich perovskite in between Cl-rich perovskite and ETL for better interfacial charge collection. In addition, incident photon-to-electron conversion efficiency (IPCE) spectra ( Supplementary Fig. 6) can explain that partial root of descending J SC is due to narrowing light conversion wavelength range.
High reversibility and stability of PVCD. By optimizing the halide-diffusion period for perovskite, we successfully achieved a self-adaptable adjustment on transmittances depending on varying solar irradiation intensities for this monolithic PVCD. We performed PVCD based on 10-min halide-diffused perovskite under varying solar intensity from 10 to 100% AM 1.5G illumination (0.1-1.0 sun) (Fig. 3a). The initial T% is around 83% at 600 nm for the bleached state (BS) of PVCD. It is obvious that under different sunlight irradiations, the steady T% for the colored state (CS) is divergent from 83% (0.1 sun) to 20% (1.0 sun). In contrast, PVCD based on semi-transparent perovskite demonstrates a much narrower contrast difference between 0.1 and 1.0 sun (Supplementary Fig. 7) due to its visiblewavelength photon-to-electron conversion providing saturated   ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-23701-z current density. Moreover, a photochromic lens as reference also manifests a poor contrast ratio ( Supplementary Fig. 7), since the trigger of photochromic compounds is independent of sunlight intensity 24 . Besides that, according to the CIE 1976 color space standard, color coordinates of the transmission through PVCD demonstrated good color-neutralities close to Planckian locus for all diverse sunlight intensities, only with transitional correlated color temperatures (CCT) from 4800 to 10,400 K (Fig. 3b). Photographs of PVCD under 0.1 sun illumination clearly showed an excellent color rendering index (CRI) of 96 (Fig. 3c), which emerged "excellent level" color saturations of indoor objects by using this PVCD-based smart window, according to the international standard-ISO 9050 glass in building 25 . The in situ dynamic T% spectra of visible and near-infrared (IR) wavelengths were investigated under 1.0 sun illumination as the contour mapping diagram (Fig. 3d), wherein the external circuit between two FTO electrodes was disconnected at the 415th second. The instantaneous T% spectra of PVCD present the photovoltachromic coloring period is ca. 200 s and self-bleaching time by disconnection is ca. 300 s ( Supplementary Fig. 8), exhibiting a perfect contrast ratio (>30%) on average visible-light transmittance (AVT) between BS and CS. To mimic the effect of PVCD on indoor dimming and cooling, we also collected profile and IR photos for three different situations (Fig. 3e). In contrast to the reference temperature by two glass substrates at 49°C, the PVCD demonstrates no interference on temperature at 49°C for BS and a significant cooling-down to 40°C for CS, heralding an enormous energy-saving on air-conditions for buildings. To estimate the duration of transmission response under operational conditions, the AVT of PVCD was monitored by repeatedly switch on-off 395 nm UV controlling light ( Supplementary Fig. 9), which demonstrated an good >10,000 cycle reproducibility and one-week service period (Fig. 3f). Although the contrast ratio of 60% at 600 nm in the first 100 cycles decreased to~40% after   Table 2).
The self-adaptability of PVCD. Based on our postulated electric circuit diagrams for charging and discharging states (Fig. 4a), to further understand the working mechanism that occurred in our PVCD, we in-situ monitor short-circuit current (I SC ) for charging state at different solar irradiances and corresponding open-circuit voltage (V OC ) for discharging state, respectively. The I-t diagram (Fig. 4b) during the charging procedure demonstrates a two-step tendency including an exponential decay (from I max to I steady ) at the beginning and a steady current (I steady ) afterwards, which is corresponding to charge capacitor C SC and pass resistor R P , respectively. Based on the following formulas: Both calculated short-circuit quantity of charge (Q SC ) and experimental I steady are increasing along with brightening sunlight (Fig. 4c), which can explain the working principle of solaradaptable adjustment on T% and prove the equivalent circuit of monolithic PVCD. When sunlight irradiates PVCD, the PV semimodule will provide voltage to charge the EC semi-module. The Q SC of PVCD is in direct proportion to T%, which can be adjusted by the photon-generated current during exponential decay step. Once EC semi-module charged to Q SC , R P will stabilize I steady and bypass photon-generated current into EC for further darkening. Besides that, when we block the sunlight or disconnect the external circuit between two electrodes, the electrochemical capacitor will self-discharge via the drain current circuit through R P , resulting in the self-bleaching of PVCD. The instantaneous maximum discharging voltage (V EC ) in V−t diagram (Fig. 4d) is steady at ca. 0.6 V for different sunlight intensities and consistent with the driving voltage of EC ion-gel ( Supplementary Fig. 10), which is in accord with the fundamental mechanism of electrochemical capacitors 26 .

Discussion
In summary, we initially applied self-regulated anion exchange strategy in photoelectronic application, and successfully realized a promising enhancement performances, synchronously. This fulltransparent monolithic smart window possesses not only full advantages of self-power, on-demand control and self-adaptive based on solar-irradiances, but also good features including excellent visible transparency and color neutrality, high adjustable range on transmittance and temperature, as well as repeatable serviceability. Moreover, the level for switching AVT could be selfadaptable by solar irradiation intensity automatically to endue smart windows a "smarter brain" to response sunrise-sunset and real weathers (Supplementary Movie 1). Most importantly, the full-solution processability of two-terminal sandwiched glass-gelglass architecture can offer the simplest architecture, scalable producibility and building integration as safety glazing for future energy-saving skyscrapers.  Gels for EC component. Heptyl viologen bis(trifluoromethylsulfonyl)imide (HV (TF-SI) 2 ) was prepared by an ion-exchange reaction between 514 mg HV(Br) 2 (1 eq) and 689 mg Li-TFSI (2.4 eq) in 40 mL deionization water. The aqueous solution was kept shaking for 3 h, then centrifuged at 3000 rpm for 5 min. The precipitated product HV(TFSI) 2 was washed by deionization water until color from yellow to white, then dried by cryodesiccation. Twenty-one milligram HV(TFSI) 2 as aforementioned and 7 mg dmFc was dissolved in 420 mg [BMI][TFSI] at 60°C for 30 min, then added dropwise under stirring into another solution which was prepared by 84 mg PVDF-HFP in 500 mL EA, resulting in the EC gel.
Transparent PV component fabrication. The pre-patterned FTO (sheet resistance: 8 Ω sq −1 , thickness: 2.5 mm, Asahi Glass Co.) substrates (2 cm × 2.5 cm) were ultrasonically cleaned with diluted detergent, deionized water, acetone, and isopropanol in succession for 20 min. The as-cleaned FTO substrates were treated by UV-ozone for 30 min. The c-TiO 2 solution was spin-coated onto the FTO substrates at 2000 rpm for 20 s with a ramping rate of 2000 rpm s −1 , and then the samples were heated at 180°C for 10 min. After cooling to room temperature, the m-TiO 2 paste was spin-coated at 2000 rpm for 20 s with a ramping rate of 2000 rpm s −1 , then annealed at 120°C for 10 min. These ETL-coated substrates were sintered at 500°C for 30 min in a muffle furnace. After cooling to room temperature, these ETL coated substrates were transferred into a N 2 -filled glovebox. Hundred microliter of MAPbBr 3 precursor solution was spin-coated by a two-consecutive step program at 1000 rpm for 10 s with a ramping rate of 1000 rpm s −1 , and 4000 rpm for 60 s with a ramping rate of 4000 rpm s −1 . During the second step, 100 μL of chlorobenzene was drop on the center of the spinning substrates at 40 s prior to the end of the whole spinning program. These MAPbBr 3 perovskite films were then annealed at 100°C for 10 min in glovebox. For halide diffusion process, the as-prepared MAPbBr 3 perovskite film was immersed into 5 mL of as-prepared MACl solution at room temperature in glovebox for different periods (1-30 min), then rinsed with isopropanol three times and dried at 70°C for 10 min in glovebox, indicating perovskites with different transmittances. Afterward, 40 μL of as-prepared Spiro-PT solution was spin-coated onto the perovskite films at 4000 rpm for 30 s with a ramping rate of 4000 rpm s −1 , and then the samples were heated at 180°C for 10 min in glovebox, achieving PV component in an architecture of glass/FTO/ETL(c/ m-TiO 2 )/perovskite/HTL (Spiro-PT).
Monolithic PVCD fabrication. The as-cleaned FTO/glass substrates (2 cm × 2.5 cm) were treated by UV-ozone for 30 min. Then 300 μL EC gel was cast uniformly on the FTO side and kept drying in air for 12 h. The resulting EC gel was cut into an active area of 2 cm × 2 cm. The EC gel component was pasted onto the top of PV component, forming glass/FTO/PV/EC gel/FTO/glass configuration of the device. Subsequently, side faces of both EC and PV submodules were fixed firmly using UV curing adhesive. Finally, two FTO electrodes in PVCD were connected with thin copper wire and conductive copper glue, inducing an external electron-transporting channel between two FTO electrodes.
In situ T% measurement. The in situ T% spectra were recorded by using AM1.5G solar simulator (San-EI Electric, XES-40S3) as the illuminant via an optical fiber with a spectrometer (OceanOptics, Maya 2000, VIS-NIR) at the 350-1000 nm range.
Long-term repeatability test. For repeatability test, the T% spectra were recorded by using a halogen lamp (OceanOptics, HL-2000) as the illuminant and a 395 nm LED (10 Watt) with an electronic shutter (Daheng Optics, GCI-73M) as the control light ( Supplementary Fig. 9). In each cycle, PVCD was illuminated for 10 s under UV light for coloring process and blocked by shutter for 45 s for bleaching process, periodically. The dynamic T% intensity at 600 nm were collected by spectrometer (OceanOptics, Maya 2000, VIS-NIR). After recording the initial 100 cycles, the two-terminal FTO electrode was short connected by using a copper wire for continuously operation under UV irradiation for 1-week (ca. 11,000 cycles) in glovebox. Afterwards, the final 100 cycles were collected again by spectrometer in dynamic model.
Time-of-flight secondary-ion mass spectrometry (ToF-SIMS). A TOF-SIMS was used to depth-profile the perovskite materials and completed devices. Analysis was completed using a 3-lens 30-kV Bi-Mn primary ion gun, the Bi + primary-ion beam (operated in bunched mode; 10-ns pulse width, analysis current of 1.0 pA) was scanned over a 25 × 25 μm area. Depth profiling was accomplished with a 1 kV oxygen-ion sputter beam (10.8 nA sputter current) raster of 80 × 80 μm area. All spectra during profiling were collected at a primary ion dose density of 1 × 10 12 ions cm −2 to remain at the static-SIMS limit.
Scanning electron microscopy (SEM). The top-view and side-view morphologies were investigated by using field-emission scanning electron microscope (JEOL, JSM-7800F).
Haze characterizations. The haze of perovskite films were measured by a hazemeter (Diffusion Systems UK, EEL 57D) Solar cell characterizations. The photocurrent density-voltage curves of the perovskite solar cells were measured using a solar simulator (Oriel 94023A, 300 W) and a Keithley 2400 source meter. The intensity (100 mW cm −2 ) was calibrated using a standard Si solar cell (Oriel, VLSI standards). All the devices were tested under AM 1.5G sun light (100 mW cm −2 ) using a metal mask of 0.1 cm 2 with a scan rate of 10 mV s −1 . IPCE measurements were carried out in DC mode by using a Keithley 2400 source meter and a SOFN 7ISW752 monochromator equipped with a 500 W Xenon lamp. The wavelength sampling interval was 5 nm and the current sampling time was 1 s, which was fully controlled by computer. A Hamamatsu S1337-1010BQ silicon diode used for IPCE measurements was calibrated at the National Institute of Metrology, China.

Data availability
All relevant data that support the finding of this study are available from the corresponding author upon reasonable request.