Sulfur- and Nitrogen-Containing Porous Donor-Acceptor Polymers as Real-Time Optical and Chemical Sensors

Fully aromatic, organic polymers have the advantage
of being composed from light, abundant elements, and are hailed as candidates
in electronic and optical devices “beyond silicon”, yet, applications that make
use of their π-conjugated backbone and optical bandgap are lacking outside of
heterogeneous catalysis. Herein, we use a series of sulfur- and
nitrogen-containing porous polymers (SNPs) as real-time optical and electronic
sensors reversibly triggered and re-set by acid and ammonia vapors. Our SNPs
incorporate donor-acceptor and donor-donor motifs in extended networks and
enable us to study the changes in bulk conductivity, optical bandgap, and
fluorescence life-times as a function of π-electron de-/localization in the pristine
and protonated states. Interestingly, we find that protonated donor-acceptor
polymers show a decrease of the optical bandgap by 0.42 eV to 0.76 eV and
longer fluorescence life-times. In contrast, protonation of a donor-donor polymer
does not affect its bandgap; however, it leads to an increase of electrical conductivity
by up to 25-fold and shorter fluorescence life-times. The design strategies
highlighted in this study open new avenues towards useful chemical switches and
sensors based on modular purely organic materials.

highlighted in this study open new avenues towards useful chemical switches and sensors based on modular purely organic materials.

INTRODUCTION
Conjugated microporous polymers (CMPs) 1 attract marked attention as sustainable, noble metal free materials in a wide range of applications such as heterogeneous catalysis, 2 gas storage and separation, 3 energy storage, 4 optoelectronics, 5 photovoltaics, 6 and sensors. 7 Thanks to their high chemical modularity, exceptional thermal and chemical stability, and a wide array of synthetic approaches, several classes of CMPs have emerged over the last two decades, like polymers of intrinsic microporosity (PIMs), 8 hyper-cross-linked polymers (HCPs), 9 covalent organic frameworks (COFs) 10 and their nitrogen-containing analogues -covalent triazine-based frameworks (CTFs). 11 Arguably, the most important parameters for the performance of these materials in optoelectronics and catalysis is their bandgap energy and their band structure. These will not only depend on the size and co-planarity of the π-conjugated domains in the polymer backbone, but also on the chemical composition of the building blocks. The most common strategy to vary the bandgap of CMPs relies on changes of the size of the carbon-based, polycyclic building blocks. [12][13] Although this bottom-up approach can indeed lead to networks with variable pore sizes and bandgaps, it can also have detrimental effects on the pore structure once pore channels get sufficiently large for inter-penetration of polymer strands to occur. One further strategy to tune the optical bandgap of a conjugated polymer is the incorporation of heteroatom-containing donor-acceptor (D-A) motifs into its backbone. [14][15] Recently, we have introduced a family of sulfur-and nitrogen-containing porous polymers (SNPs) that make use of D-A interactions between neighboring electron-deficient triazine (C 3 N 3 ) cores and electron-rich aryl thiophene building blocks of the polymer to achieve control over the bandgap energy without large changes to the pore structure. 16 In addition, incorporation of aromatic spacers between the donor-and the acceptor-domains enabled us to predictively control the strength of donor-acceptor interactions and -by proxy -the extent of charge-carrier recombination in these networks. This has implications for the fluorescence life-times and the outstanding performance in photocatalytic hydrogen evolution from water of these D-A materials. [17][18] In this study, we make use of four key-properties of our conjugated, porous D-A polymersnamely, (1) their strong, covalent backbones, (2) their intrinsic Lewis acidity and basicity, (3) their permanently accessible pore channels to gaseous guest molecules, and (4) their optical bandgaps in the visible part of the spectrum -and we use them as optical and electronic sensors and switches that are triggered by volatile acid vapors and re-set by gaseous ammonia. While colorimetric chemical probes are known from molecular systems in solutions, [19][20] or work on the basis of chemical transformations, 21-23 the here-presented study shows one of the first instances of amorphous porous conjugated polymers used as fully-reversible, colorimetric chemical probes.
Recently, we showed, that triazine-containing COFs, made by the same principle, can be also exploited as acid/base chemosensors, thus, highlighting the significance of our approach in view of making multifunctional smart materials. 24 Herein, we choose four previously reported SNP systems as reference: SNP-NDT1, SNP-NDT2, SNP-BTT1 and SNP-BTT2 that consist of electron-donating thiophene-based naphthodithiophene (NDT) and benzotrithiophene (BTT) moieties, and electron-withdrawing 1,3,5-triazine (Tz) and tris-phenyltriazine moieties (Scheme 1). 18 In addition, we expand the family of SNPs by three networks, two of which contain a benzodithiophene (BDT) moiety -SNP-BDT1 and SNP-BDT2. To study the effect of D-A dyads versus sheer heterocycle content, we further prepare one polymer comprised from electron-rich BTT-building blocks only -SP-BTT. All polymers were prepared using the robust, Pd-catalyzed Stille cross-coupling to link the readily available, stannylated derivatives of thiophene-based molecules with halogenated triazine (TzCl 3 ) and tris-bromophenyltriazine (Tz(PhBr) 3 ) or sulfurcontaining benzotrithiophene (BTT-Br 3 ) monomers (see SI and Table S1). 18,25 Scheme 1. Synthetic pathway towards sulfur-and nitrogen-containing polymers (SNPs) and sulfur-only polymer, SP-BTT. Electron-donating thiophene-based linkers (in red) are coupled with electron-accepting triazine-based monomers (in blue) via Pd-catalyzed Stille crosscoupling.

EXPERIMENTAL SECTION
Details of all characterization conditions, as well as results of the gas adsorption experiments, PXRD, SEM, TEM, elemental analyses, EDX, XPS, UV-Vis, PL, TCSPC, conductivity, and EPR experiments, which were not included in the main manuscript, are listed in the respective sections of the Supporting Information. Information (Scheme S1-S4).

General procedure for Stille-coupling polymerisation
An overview of all prepared materials can be found in Table S1.
The respective stannylated monomer, brominated monomer, and Pd(PPh 3 ) 4 (3:2:5% mol ratio; in case of benzo[1,2-b:3,4-b':5,6-b'']trithiophene (BTT) -1:1:5% mol ratio) were dissolved in anhydrous toluene under inert atmosphere and refluxed for 3 days. In a short time period (1-2 h) the precipitate of polymer started to appear in the reaction flask. After completion of the reaction the precipitate was filtered and washed with hot toluene, DMF, chloroform, THF and methanol (3 times each solvent). Subsequently, Soxhlet extraction was performed using chloroform, THF, and methanol (24 h each solvent). Afterwards the solid was dried in a vacuum drying oven at 120 o C for 24 h. More detailed reaction parameters can be found in Table S2.

RESULTS AND DISCUSSION
Structure and chemical composition of the polymer systems were confirmed via 13 C crosspolarization magic-angle-spinning (CP-MAS) NMR spectroscopy, combustion elemental analysis (EA), X-ray photoelectron spectroscopy (XPS), and thermogravimetric analysis (TGA). Both the triazine-and thiophene-containing SNP-BDT1 and SNP-BDT2 polymers have characteristic signals at 167-169 ppm in solid-state 13 C CP-MAS spectra which belong to C 3 N 3 -ring carbons.
Signals in the range from 110-150 ppm are attributed to sp 2 -hybridised carbon atoms within aromatic phenyl and thiophene units ( Figure S2). The sulfur-containing polymer, SP-BTT, shows three distinct signals at 136, 131 and 118 ppm, which correspond to quaternary carbons in thiophene and phenyl rings, and to tertiary thiophene carbons. Details of the bulk analysis of the as-received polymers are found in the SI (Table S2, S4-S7, Figure S12-S17). For all polymer systems, we detect residual Pd-content (0.03 to 1.05 wt%) and P atoms (0.09 to 0.36 wt%) trapped in the polymer matrix after the cross-coupling reaction, as well as Sn (0.39 to 1.07 wt%) and halogen atoms (Cl: 0.57 to 3.72 wt%, Br: 2.25 to 5.74 wt%) arising from unreacted endgroups. These findings correlate with results from TGA measurements under an oxidative atmosphere that show a residual content of non-combustible inorganics between 3 and 7 wt% ( Figure S4a). Irrespective, the high degree of cross-linking we achieve in all networks confers high thermal stability up to 750 °C under an inert atmosphere ( Figure S4b).
Powder X-ray diffraction (PXRD) shows that the SNP-BDT1, SNP-BDT2 and SP-BTT networks are -just like the previously reported SNPs -amorphous with broad features at around 10 and 25° 2θ which correlate with in-plane distances between aromatic building blocks and π-stacking distances of approx. 3.6 Å, 11 respectively ( Figure S5). [16][17][18] Scanning electron microscopy (SEM) images of SNP-BDT1 and SNP-BDT2 networks confirm a 'cauliflower'-like morphology typical for nucleation-growth polymers, while the SP-BTT polymer grows in rod-like aggregates of 20 to 100 μm length ( Figure S6-S8). Transmission electron microscopy (TEM) and selected-area electron-diffraction (SAED) for these three polymers confirm a similar degree of internal, microscopic structure as seen in PXRD data with visible, concentric rings indicative of polycrystalline materials ( Figure S9-S11). Cross-linking of C 2 and C 3 symmetric building blocks suggests a regular bonding pattern with hexagonal, "honeycomb"-shaped pores on paper, and the low number of unreacted end-groups in our polymers suggests just that. However, as structural analysis reveals and as we established previously, 26 Pd-catalyzed Stille cross-coupling favors the formation of the disordered, kinetic product, presumably with some degree of interpenetration of adjacent pore structures. We investigated these pore channels by nitrogen gas adsorption/desorption analysis performed at 77 K. All polymers show Type I isotherms with a pronounced hysteresis indicative of micro-and mesopores ( Figure S3). 27 The guest accessible surface area was calculated according to Brunauer-Emmett-Teller (BET) and varies in the range from 79 to 698 m 2 g -1 (Table 1).
So far, we have established the covalent bonding pattern of our networks and their permanent micro-and mesoporosity. Further, we make use of their intrinsic π-aromaticity and heteroatom content by exposing these polymers to a trigger: corrosive HCl vapors. In principle, SNPs have two Lewis-basic sites that can be protonated -triazine-ring nitrogens and thiophene sulfur atoms.  plot of SNP-NDT1 in pristine state (black), after exposure to HCl (red) and NH 3 (blue) vapors. In the inset of (a) -photographs of polymer before and after protonation; c) Repeating unit of SP-BTT and solid-state UV-Vis absorption spectra and d) Tauc plot of SP-BTT in pristine state (black) and after exposure to HCl (red) vapor. In the inset of (c) -photographs of polymer before and after protonation.

SP-BTT
Notably, this coloration can be fully re-set when the HCl-treated polymer is exposed to NH 3 vapors from 24% aqueous ammonia solution (Figure 1a, c, S1). This on/off response to HCl/NH 3 vapors can be triggered at least five consecutive times (as shown for SNP-NDT1, Figure S26) with no apparent losses in the intensity of the optical response.
We closely examined the chemical composition of the polymer backbone during this on/off response to verify that the interaction of the polymer with corrosive HCl is indeed a reversible chemisorption process. Fourier-transform infrared (FT-IR) spectra of pristine and HCl-treated samples show characteristic C 3 N 3 -ring vibrations around 1500 cm -1 and 1360-1370 cm -1 , along with the triazine-ring breathing mode at 805-820 cm -1 ( Figure S28-33). 32-33 Moreover, there are no indicative signals in the OH-and NH-region around 3000 cm -1 that would be a tell-tale sign of irreversible hydrolysis of the polymers. Similarly, FT-IR spectra of the pristine and HCl treated SP-BTT polymer show C-S vibrations of the thiophene ring at 810 cm -1 as well as aromatic C-C stretching at 1342 cm -1 ( Figure S34). 26 A comparison of FT-IR spectra over five cycles of exposure to HCl/NH 3 gases shows that all reported networks remain chemically stable ( Figure  S35). Previous DFT calculations confirm that the Lewis basic N-atoms of the triazine moieties are the preferred site of protonation. 24 This rapid and fully-reversible detection of HCl vapors at low concentrations makes SNPs suitable candidates for naked-eye sensors. Moreover, we monitored the response of SNP-NDT1 to different acids, such as hydrobromic, nitric, sulfuric, trifluoromethylsulfonic (TFMSA), and acetic acid. Initial exposure for 1 min revealed color changes only in case of HCl. Longer exposure for up to 3 days ensured complete diffusion of acid vapors throughout the material.
Accordingly, we also observed marked color change in case of HBr and HNO 3 , whereas vapors of TFMSA and acetic acid caused only slight shifts of the UV-Vis absorption edge ( Figure S27).
Interestingly, sulfuric acid shifted the absorption edge of SNP-NDT1 towards the blue region by ~12 nm; an electron induction effect into the polymer network which probably stems from a strong interaction of the SO 4 2anion with the polymer network, analogous to charge-transfer complexes formed between sulfate and molecular electron acceptors. 34-35 Overall, we observe that soft conjugate bases (e.g. AcO -) cause a smaller UV-Vis shift than hard conjugate bases (e.g. Cl -).
This phenomenon merits further study, but a conceivable explanation is that more localised charge-transfer complexes with hard conjugate bases are responsible for a larger UV-Vis shift than weaker, more delocalised CT complexes with soft conjugate bases, as observed previously. 36 Previously we discovered, that SNPs are highly fluorescent in benzene suspensions under UVlight irradiation. 18 Here we confirmed the fluorescence of obtained materials in solid state, including newly synthesized frameworks ( Figure S36). Absolute quantum yields (AQY) measured under 365 nm UV light irradiation vary from 0.3% (at 79.5% absorbance) for SNP-NDT1 to 1.0% (at 79.9% absorbance) for SNP-NDT2 (Table S10). We performed solid-state photoluminescence emission (PLE) measurements in steady-state and time-correlated single photon counting (TCSPC) experiments to better understand, how the protonation event influences the optical properties of the materials. As expected, PLE spectra recorded at 440 nm excitation wavelength revealed marked red-shift of the emission maximum after protonation, with emission maxima appearing in the near IR region up to 788 nm for SNP-BDT1 ( Figure S37). were obtained from I-V profile measurements with bias sweep of -10 to 10 V, triplicates of each sample were conducted and an average was taken.*-the S BET , E g dir and E g indir data for SNP-NDT1, SNP-NDT2, SNP-BTT1 and SNP-BTT2 polymers was taken from previous report by us. 18 These findings are in a good agreement with UV-Vis study -the observed decrease of the optical bandgap width corresponds to a lower transition energy to the excited state, hence, to longer emission wavelengths in fluorescence decay. Average fluorescence life-times estimated by tripleexponential fitting from TCSPC for the pristine polymers are in the range from 0.37 ns for SNP-BTT2 and SP-BTT to 1.06 ns for SNP-NDT2 ( Figure 2a, Table 1, S10). After exposure to HCl, however, we observe a 2-to 3-fold increase in fluorescence life-times for triazine-containing polymers from 1.03 ns for SNP-BDT1-HCl and SNP-BDT2-HCl up to 1.89 ns for SNP-BTT1-HCl ( Figure 2b, Table 1, S10). The results indicate, that after protonation charge carriers are in general more localized, which will lead to fewer non-radiative charge recombination events, and hence, longer fluorescence lifetimes. Here, we can appreciate the advantage of the modular makeup of SNPs: strong donor-acceptor interactions in SNPs that contain directly linked triazine-and thiophen-moieties enable more efficient charge transfer -and, hence, comparatively faster exciton decay -than their counterparts where D and A moieties are separated by an aryl spacer. 37-39 Notably, the sulfur-containing SP-BTT network did not show such dramatic increases in fluorescence life-times with a total change from 0.37 to 0.49 ns in the HCl-treated network. In this case, charge carriers are more delocalized due to the absence of strong D-A interactions.
This small increase in fluorescence life-times in SP-BTT can be explained by a partial transfer of electron density from the central benzene ring of the benzotrithiophene core. It is worth to note, that the fluorescence intensity of SNPs in the solid state is completely quenched to the naked eye after exposure to HCl vapors after 30 seconds, and it is fully recovered after exposure to ammonia (Figure 2c, d). This feature can be used for manufacturing of acid-base fluorescence sensors.
Protonation of the heteroatoms has an influence on the bandgap width and photoluminescence, and it involves charge transport across the π-aromatic network as a whole. Such an increase of charge carrier mobility was reported for p-type doping of semiconducting, linear polymers. [40][41][42] Thus, we examined the influence of protonation on the charge carrier mobility of our bulk materials using two-probe measurements ( Figure S38-S46). Interestingly, there is only a slight measurable increase of conductivity within the same order of magnitude for all SNPs upon activation with HCl vapors (Table 1, Figure S45). However, the thiophene-only SP-BTT framework showed a dramatic increase in conductivity after protonation from 0.415 to 10.371 μS m -1 (Figure 3a). These results support the fact that donor-acceptor interactions within polymer network will tailor not only optical, but also electronic properties of the desired materials. As seen in the UV-Vis study, protonated triazine-containing SNPs have more localized charges -presumably in the form of Cl-salts stabilized by strong D-A interactions -that do not contribute much to overall bulk conductivity, whereas SP-BTT experiences a higher degree of charge-delocalization and thus showing higher charge carrier mobility.
In the end, we monitored the change in paramagnetic behavior of prepared polymers upon protonation using electron paramagnetic resonance (EPR) spectroscopy (Figure 3b, S47  To compare charge transfer properties of SP-BTT we performed temperature dependent EPR measurements taking SNP-NDT1 -the most strongly interacting D-A polymer -as a reference. Computational simulations were based on the assumption that one to two protons are present per D-A dyad after HCl exposure ( Figure S48 and Table S12), and they correlate well with the observed EPR spectra. The g-factor exhibits a hysteresis upon heating and cooling ( Figure S49).
These observations indicate that the variations of the g-factor are not related to the increased structural mobility of the heated network, but rather to the delocalization of unpaired electrons. 46 The g-factor of both polymers increases upon heating, and it increases further upon cooling for SNP-NDT1. Here, both polymers are switched to a "more localized" spin state. However, SP-BTT is better at delocalizing radical paramagnetic centers along the polymeric chain in comparison to SNP-NDT1 ( Figure S50).

CONCLUSION
In summary, we present a comprehensive study that correlates optical and electronic effects in weakly and strongly interacting donor-acceptor systems based on the family of highly modular, X-ray photoelectron spectroscopy (XPS) measurements were performed using a ThermoScientific K-Alpha + X-ray Photoelectron Spectrometer. All samples were analysed using a microfocused, monochromated Al K α X-ray source (1486.68 eV; 400 μm spot size). The analyser had a pass energy of 200 eV (survey), and 50 eV (high resolution spectra), respectively.
To prevent any localized charge buildup during analysis the K-Alpha + charge compensation S7 system was employed at all measurements. The samples were mounted on conductive carbon tape the resulting spectra analysed using the Avantage software from ThermoScientific.
Scanning electron microscopy (SEM) was made on Nova NanoSEM 450 microscope from FEI.
Energy-dispersive X-ray spectroscopy (EDX) was measured at 20.00 kV accelerating voltage were mixed in dry chlorobenzene (300 mL). TFMSA (1.25 mL, 14.27) was added dropwise under room temperature and the reaction mixture was refluxed than for 6 h. A solid started to appear in the reaction flask during the increase of temperature, but afterwards it was gradually dissolved.
The reaction was cooled down to room temperature and neutralized with 5% NaOH (mL).
Subsequently the reaction mixture was extracted with CH 2 Cl 2 (3x mL). Combined extracts were S10 washed with distilled water (3x mL), dried over anhydrous Na 2 SO 4 and evaporated to dryness.
Crude product was purified by silica gel column chromatography using Hexane:CH 2 Cl 2 2:1 as an eluent to provide compound (2) as a white solid ( 0.06 g, 10% yield). 1  After 30 min the cooling bath was removed, and the reaction mixture was stirred for more 2 h at room temperature. The reaction was quenched with diethyl ether (50 mL), washed with an aqueous sodium bicarbonate, washed with water (3x20 mL), and dried over anhydrous MgSO 4 .
The solvent was removed under reduced pressure, and the crude solid was subjected for recrystallisation from acetonitrile to provide pure product as an off-white powder (1.12 g, 75 % yield

General procedure for Stille-coupling polymerisation
Overview of all prepared materials could be found in Table S1.  Table S2.
Overview of prepared materials S14 Figure S1. Photographs of prepared materials before (above) and after (below) exposure to HCl                  Figure S15. XPS C1s, N1s and S2p signals in SNP-BDT1 network.    For HCl detection limit samples of SNP-NDT1 polymer were exposed to vapours of hydrochloric acid in temperature-controlled environment by keeping the reaction vial in the oil bath (25 o C monitored with a thermometer). Smaller vial with sample was introduced inside the reaction vial containing necessary amount of HCl. Samples were exposed for 30 s and further subjected to solid-state UV-Vis measurements without any delays.

S30
HCl vapour concentration in ppm was calculated by following equation: Molar mass of the air inside the reaction vial was determined using ideal gas law: n (air ) = P( atm) * V vial (L) R ( L * atm/ l * mol ) * T (K ) = 1 * 0.03 0.082 * 298 =1.23 mmol were V vial -is the volume the reaction vial and equals to 30 mL or 0.03 L.
Mass of the air inside the reaction vial was determined as follows:   The current-voltage characteristics of SNPs and SP-BTT were studied by a two-probe method.
Powder samples were loaded in a plastic cylinder (diameter: 8 mm) and compressed into a pellet between two stainless rods with pressure of ~50 bar ( Figure S45). In a typical experiment, a bias sweep of -10 to 10 V was applied using a Keithley 2612 A source meter, and the current through the rods and the sample was recorded. Minimum triplicates for each sample were conducted, and the average was taken for estimation of the conductivity. The conductivity ( ρ ) was calculated based on the following equation: where l is the sample thickness (determined by optical microscope imaging) as the conduction path length and A is the cross-sectional area of the cylinder. The freshly exposed to HCl vapours (35% aqueous solution) and NH 3 vapours (24% aqueous solution) samples were tested right away without any delays.
S57 Figure S38. I-V curve recorded after three current cycles for pristine (right) and protonated (left) forms of SNP-NDT1.      Figure S47. EPR spectra of pristine (black) and HCl treated (red) polymers.

Additional temperature-dependent EPR study for SNP-NDT1 and SP-BTT networks
The temperature variable experiments in the region of 303 -403 K were controlled by a liquid/gas nitrogen unit ER4141VT-U and the Win-EPR acquisition software (both from Bruker).
The EPR tube with the powder-sample was stabilized at each temperature step, subsequently the spectrum was recorded, and the next temperature was adjusted. The EPR spectra were acquired for one temperature increase -decrease cycle Simulations of the EPR spectra were performed in MATLAB toolbox EasySpin (v. 5.2.20) by least-squares fitting to an experimental spectrum using a combination of Nelder-Mead simplex and Particle swarm algorithms. 9 Instrumental parameters S64 such as microwave frequency, central field, sweep width, number of points and modulation amplitude were included in the simulation. For the simulation of paramagnetic/radical centres within the SP-BTT polymer one or two equivalent protons were considered to interact with the unpaired electron. The temperature dependence of the g-factor and the linewidth ( Δ B pp ) for both samples are presented in Figure S47 and S48. Due to the anisotropy the EPR linewidth was determined as Δ B pp of the "global" maximum and minimum, therefore it is denoted as Δ B pp max . Figure S48. Simulation of the SP-BTT EPR spectra considering interaction with a) one or b) two equivalents of protons 1 H.