Main

Chemical doping has a pivotal role in optimizing the performance of various OSC-based devices, including light-emitting diodes11, photovoltaics12,13, thermoelectrics14,15, field-effect transistors16 and electrochemical devices17,18. Although numerous doping methods exist that can achieve efficient chemical doping, they typically rely on the use of strong oxidizing and reducing agents (dopants) to alter the redox state of the OSC through direct electron-transfer processes19,20,21,22,23,24,25,26,27. However, the high chemical reactivity of these strong dopants may produce by-products and render them less stable, particularly for n-dopants5,10,14,15, presenting a challenge to their widespread adoption. Furthermore, some of the most-studied dopants are synthesized ad hoc and are expensive. The use of widely available, inexpensive and weak or inefficient dopants could address these issues, but they often require either thermal28,29,30,31 or radiation32,33,34,35 activation or metal-catalysed bond cleavage36 to activate them. Moreover, there is currently no dopant that is capable of carrying out both the oxidation (p-doping) and reduction (n-doping) of OSCs. Therefore, developing a doping strategy that uses widely available dopants is crucial to enhance compatibility with semiconductor devices.

Photocatalysts (PCs) function as electron shuttles, oxidizing or reducing aromatic compounds on the basis of the presence of sacrificial weak oxidants37,38 or reductants39,40. Owing to their remarkable selectivity and efficiency in facilitating redox-based reactions, PCs are extensively used in organic synthesis41,42,43,44. Thus, intriguing questions arise regarding whether PCs can mediate the oxidation (p-doping) or reduction (n-doping) of OSCs, the efficiency and generalizability of this process, and its potential technological implications.

Here, to demonstrate the general concept, we explore the photocatalytic doping process in quaternary systems comprising a dopant, a PC that was primarily an acridinium derivative, an organic salt and one of various π-conjugated p-type or n-type OSC polymers. We show that neither the dopant nor the PC in the ground state can extract or donate electrons from or to the OSCs (Fig. 1a,b). However, when photoexcitation occurs, the PC can oxidize or reduce the OSC and be regenerated by the dopant (Fig. 1c–e). Extended Data Fig. 1 provides a breakdown of the photocatalytic p-doping and n-doping cycles. Acridinium-based PCs are used because of their commercial availability, air stability and strong oxidizing or reducing character in their excited or radical reduced state40,45,46. We chose three different acridinium derivatives to carry out the photocatalytic doping study: Acr-Me+ (10-methylacridinium perchlorate), Mes-Acr-Me+ (9-mesityl-10-methylacridinium tetrafluoroborate) and Mes-Acr-Ph+ (9-mesityl-3,6-di-tert-butyl-10-phenylacridinium tetrafluoroborate). We compared their activity with that of other air-stable organic PCs, such as perylene diimide39 (PDI-C6C7) and eosin Y47,48 (2′,4′,5′,7′-tetrabromofluorescein disodium salt) (Fig. 1f). Salts such as LiTFSI and [EMIM][TFSI] are used as redox-inert counterions to stabilize charges on the doped conjugated polymer backbones27. We used oxidants (p-dopants) that are typically weak or inefficient, such as dioxygen (O2) in the air or diphenyl disulfide49 ((PhS)2), and weak reductants (n-dopants), such as triethylamine (Et3N), to regenerate the PCs.

Fig. 1: Photocatalytic doping concept.
figure 1

ad, Schematics of the photocatalytic doping process: weak dopants cannot oxidize or reduce the OSCs (a); PCs in the ground state cannot oxidize or reduce the OSCs (b); PCs in the excited state can oxidize or reduce the OSCs and be regenerated by the weak dopants (c and d). This photocatalytic doping process occurs in thin films and ensures that the molecular packing of the OSCs is preserved after doping. e,f, Proposed photocatalytic oxidation or p-doping (right) and reduction or n-doping (left) cycle (e); chemical structures of the PCs, weak dopants, salts (counterions) and OSCs (f).

Photocatalytic p-doping of PBTTT

The photocatalytic p-doping methodology is straightforward and efficient, as demonstrated in Fig. 2 and Supplementary Video 1 for the case-study oxidation of PBTTT by Acr-Me+. Acr-Me+ (0.01 M) was dissolved in a mixture of n-butyl acetate and acetonitrile, together with the salt LiTFSI (0.1 M). This solvent mixture was chosen for its orthogonality to PBTTT and the good solubility of Acr-Me+ and LiTFSI, which show no substantial interactions in solution (Supplementary Figs. 1 and 2). PBTTT thin films were immersed in the Acr-Me:LiTFSI solution and irradiated with a 455 nm blue light for up to 12 min to photoactivate Acr-Me+ to its excited state (Acr-Me+*; ref. 37) in the presence of O2 (in air), which acts as the weak p-dopant. The p-doped PBTTT films were then removed from the PC solution, washed and dried, as depicted in Fig. 2a, and the Acr-Me:LiTFSI solution was recovered and could be reused multiple times (Supplementary Fig. 3a). The ultraviolet–visible–near-infrared absorption spectra of PBTTT films show that O2 cannot dope PBTTT in the absence of Acr-Me+ or with Acr-Me+ in the dark (Fig. 2b), but a strong polaronic absorption extending in the near-infrared region was observed upon blue light irradiation.

Fig. 2: Photocatalytic p-doping of PBTTT.
figure 2

a, Schematic of the photocatalytic p-doping method: the OSC film is immersed in the PC solution, which also contains TFSI counterions, and irradiated with light in the presence of O2, which acts as the weak p-dopant. The PC solution is recovered and the OSC film is washed with clean solvent and dried in N2. [CLiTFSI] and [CPC] are the concentrations of the LiTFSI and PC solutions, respectively. b, Absorption spectra of undoped and photocatalytically doped PBTTT films. Photocatalytic doping requires both PC and light. c, XPS analysis of undoped and photocatalytically doped PBTTT films reveals a distinct TFSI signal in the photocatalytically doped samples. d, S(2p) and F(1s) XPS analysis of undoped and photocatalytically doped PBTTT films. The TFSI signal increases with light irradiation time. e, Ultraviolet photoelectron spectroscopy of undoped and photocatalytically doped PBTTT films. The work function of photocatalytically doped PBTTT films increases with light irradiation time. f, Electrical conductivity of undoped and photocatalytically doped PBTTT films demonstrates that photocatalytic doping can happen only when both PC and light are present. Points, mean; error bars, s.d. (not visible); n = 10 independent samples.

Source Data

X-ray photoelectron spectroscopy (XPS) shows that TFSI anions do not penetrate the PBTTT layer without Acr-Me+ or with Acr-Me+ in the dark. However, when irradiated with light, strong fluorine F(1s) and oxygen O(1s) XPS core level signals originating from TFSI are observed (Fig. 2c). Further analysis of the sulfur S(2p), F(1s) and nitrogen N(1s) XPS core level peaks (Fig. 2d and Supplementary Fig. 4) indicates an increase in TFSI anion content with increasing irradiation time, leading to a positively charged PBTTT polymer backbone. Grazing-incidence wide-angle X-ray scattering (GIWAXS) measurements reveal that the penetration of TFSI anions does not disrupt the orientation of the PBTTT chains but instead leads to a reduction in the π–π stacking distance and an increase in the lamellar packing distance, indicating that TFSI anions are located mainly in the side-chain region (Extended Data Figs. 2, and 3 and Supplementary Figs. 57). This result is consistent with the oxidation of PBTTT19. Furthermore, ultraviolet photoelectron spectroscopy (UPS) analysis reveals a partial depopulation of the PBTTT frontier occupied density of states and a substantial increase in work function following light irradiation (Fig. 2e and Supplementary Fig. 8).

The electrical conductivity of PBTTT greatly increases from 10−5 S cm−1 to more than 700 S cm−1 after 10 min of light irradiation (Fig. 2f) and remains stable after 30 days of storage (Supplementary Fig. 3b). By contrast, no major changes in electrical conductivity are observed either without Acr-Me+ or with Acr-Me+ in the dark. Notably, the observed conductivity values are typical for chemically p-doped PBTTT27. We also noticed that PBTTT films, spanning a thickness range of 16 nm to 60 nm, exhibited similar maximum conductivity and polaronic absorption intensity, with the thinner films being doped faster (Extended Data Fig. 4a,b). These results indicate that doping occurs throughout the entire bulk of the OSC layer. Moreover, the degree of doping depends on the light irradiation dose (Extended Data Fig. 4c,d) and wavelength (Supplementary Fig. 9).

Mechanism of photocatalytic p-doping

To understand the charge-transfer mechanism involved in the photocatalytic p-doping process, we performed transient absorption spectroscopy and related photoluminescence and absorption spectroscopy experiments. Analysis of the Acr-Me+ and PBTTT excited-state lifetimes (Supplementary Figs. 1017) and quantitative fluorescence-quenching experiments (Supplementary Figs. 1820) indicates that the photo-induced electron transfer (PET) process is probably dominated by the PC excited state, with electrons predominately transferring from the OSC ground state to the PC excited state. We used Et3N as an optically transparent reductant39 to study the PET process in situ (Fig. 3a–d). Mes-Acr-Me+ and Mes-Acr-Ph+ were selected as representative PCs because of their excellent stability in the presence of Et3N (Supplementary Fig. 21). PET between Mes-Acr-Me+* (or Mes-Acr-Ph+*) and Et3N induces the formation of reduced Mes-Acr-Me (or Mes-Acr-Ph)40,46, as revealed by the absorption spectra shown in Supplementary Figs. 21 and 22. Subsequently, Mes-Acr-Me (or Mes-Acr-Ph) is oxidized by O2 (ref. 37) (or (PhS)2; ref. 49), affording reduced species (Supplementary Figs. 23 and 24). In situ photoluminescence studies demonstrate the reduction and regeneration of Mes-Acr-Me+ and Mes-Acr-Ph+ (Supplementary Fig. 25). Moreover, in situ transient absorption spectra acquired during the reduction or regeneration process reveal that Mes-Acr-Me+ initially forms an intramolecular-charge-transfer excited state (Mes-Acr-Me+*)38,50 as a result of light irradiation (Fig. 3a,b and Extended Data Figs. 5 and 6). Subsequently, Mes-Acr-Me+* transitions to the reduced Mes-Acr-Me in the presence of Et3N. A notable photoinduced absorption at 658 nm indicates the formation of an excited reduced state for Mes-Acr-Me after a laser pump pulse (Fig. 3c). Oxidation in air leads to Mes-Acr-Me+ being fully regenerated (Fig. 3d, Extended Data Fig. 6 and Supplementary Video 2). This result demonstrates that the PET process requires only the photoexcitation of PCs and that PCs can be regenerated in air, thereby closing the photocatalytic oxidation cycle. The Gibbs free-energy profiles computed using density functional theory (DFT) for the photocatalytic doping of PBTTT by Acr-Me+ in air indicate that both the reduced and excited reduced forms of Acr-Me can be oxidized by O2, with Acr-Me•* being favoured (Extended Data Fig. 7).

Fig. 3: Mechanism and generality of the photocatalytic p-doping process.
figure 3

a, Schematic diagram of the transition of the ground state, excited state, reduced state and excited reduced state of Mes-Acr-Me+ in the presence of the optically transparent Et3N in 455 nm irradiation, followed by regeneration in air. bd, False-colour plots of the in situ transient absorption spectra of Mes-Acr-Me+ + 10 equivalents Et3N, as a function of detector wavelength and delay time: initial state in N2 atmosphere (b); after 455 nm light irradiation for 120 s in N2 (c); and regeneration in air (d). Two strong photoinduced absorption peaks (477 nm and 551 nm, b and d) indicate the formation of the excited state of the PC (Mes-Acr-Me+*). The photoinduced absorption peak at 658 nm (c) indicates the formation of the PC excited reduced state (Mes-Acr-Me•*). e,f, Electrical conductivity of PBTTT (e) and P(g42T-T) (f) photocatalytically doped by different PCs in air. The photocatalytic p-doping conditions are the same as in Fig. 2a. Points, mean; error bars, s.d. (not visible); n = 10 independent samples. g, Electrical conductivity enhancement of OSCs (compared with the undoped films) plotted against the energy barrier of single-electron transfer from OSCs to excited PCs.

Source Data

Generality of photocatalytic p-doping

Next, we investigated the generality of the photocatalytic p-doping process for a range of conjugated polymers with different ionization-potential values and hydrophilic or hydrophobic side chains (such as P(g42T-T), P(g42T-TT), gDPP-g2T, P3HT, PBTTT and PTQ1) and PCs with different electron affinity (EA) values, including Acr-Me+, Mes-Acr-Me+, Mes-Acr-Ph+, perylene diimide and eosin Y (Fig. 1d). The ionization potentials of the semiconducting polymers and the EA values of the PCs used here, as well as the EA values of conventional molecular p-dopants such as F4TCNQ, F6TCNNQ, magic blue, CN6-CP and NOPF6 used for comparative analysis, are reported in Supplementary Fig. 26. In the ground state, all PCs exhibit low EAs, ranging from 3.6 to 4.2 eV, which are insufficient to thermodynamically drive the p-doping of the OSCs with ionization potentials ranging from 4.3 to 5.3 eV. However, when photoactivated, the EAs of the PC in the excited state (EA*) are estimated to be in the range 5.9–6.9 eV, thereby enabling p-doping of the aforementioned OSCs. The absorption spectra of the photocatalytically doped polymer films demonstrate that all the semiconducting polymers investigated in this study, including the high-ionization-potential polymer PTQ1, can be photocatalytically doped by Acr-Me+ (Extended Data Fig. 8). These data indicate that Acr-Me+ serves as a strong oxidant, at least comparable in strength to Mo(tfd)3 (EA of around 5.5 eV)51, although the calculated EA* indicates that its oxidizing capability is probably much stronger.

The electrical conductivity of the photocatalytically doped polymeric thin films was investigated for the different PCs and as a function of the light-irradiation time (Fig. 3e,f, Extended Data Fig. 9 and Supplementary Table 1). P(g42T-T), P(g42T-TT), gDPP-g2T and PBTTT were doped by all five PCs in the presence of O2, with P(g42T-T), which has an ionization potential of around 4.3 eV (ref. 21), exhibiting a high electrical conductivity of up to 3,000 S cm−1. Comparable results were obtained using (PhS)2 as the weak oxidant to regenerate the PC (Supplementary Fig. 27). The photoexcitation of eosin Y under blue (a wavelength of 455 nm) and green (525 nm) light yields similar conductivity values (Supplementary Fig. 28). Similar to our observations of PBTTT, the photocatalytic doping of P(g42T-T) is a bulk process (Supplementary Fig. 29), resulting in a strong π–π stacking peak and an increase in the lamellar packing distance of the doped films, relative to the undoped films (Supplementary Figs. 3032). Moreover, in contrast to other doping methods, photocatalytic doping yields P(g42T-T) films with the highest crystallinity (Supplementary Figs. 33 and 34), accounting for the greater conductivity measured in this study. P3HT (which has an ionization potential of around 4.8 eV) was photocatalytically doped by Acr-Me+, Mes-Acr-Me+, Mes-Acr-Ph+ and perylene diimide, whereas the high-ionization-potential PTQ1 (ionization potential of around 5.3 eV) could be doped slightly by Acr-Me+, Mes-Acr-Me+ and Mes-Acr-Ph+ (Extended Data Fig. 9). The electrical-conductivity enhancement (with respect to the undoped state) for the six OSCs strongly depends on the energy difference between the ionization potential of the OSC and the EA* of the PCs. As the energy difference decreases, the electrical-conductivity enhancement increases by several orders of magnitude (Fig. 3g).

Photocatalytic n-doping and simultaneous p-doping and n-doping

Finally, we investigated the photocatalytic reduction (n-doping) and simultaneous photocatalytic p-doping and n-doping of OSCs (Fig. 4a,b). To achieve this, the PC was first photoactivated to generate an excited-state PC that can oxidize weak n-dopants. When the latter were oxidized, the PC was converted to its reduced form, which was subsequently photoactivated to obtain an excited reduced state capable of n-doping OSCs (Fig. 4c). In this process, the n-type OSC accepts an electron from the reduced or excited reduced state of the PC, enabling the regeneration of the ground-state PC.

Fig. 4: Photocatalytic n-doping and simultaneous photocatalytic p-doping and n-doping.
figure 4

a,b, Schematics of the photocatalytic n-doping process: BBL films are covered by the PC solution (0.01 M Mes-Acr-Me+ in 3:1 BuOAc:CH3CN) that also contains 0.1 M [EMIM][TFSI]. The weak n-dopant Et3N (0.1 M, a) or a physically separate p-type P(g42T-T) film immersed in the PC solution (b) is used to regenerate the PC. After irradiation in N2, the PC solution is recovered, and the OSC films are washed with clean 3:1 BuOAc:CH3CN solvent and dried in N2. c, Proposed catalytic cycle for simultaneous photocatalytic p-doping and n-doping of OSCs. The photoactivated PC extracts electrons from the p-type P(g42T-T) (or Et3N) and donates them to the n-type BBL. d, Differential absorption spectra of BBL films after photocatalytic n-doping by Mes-Acr-Me+ with Et3N or P(g42T-T). e, Electrical conductivity of undoped and photocatalytically n-doped BBL films. f, Electrical conductivity of simultaneous photocatalytic p-doped P(g42T-T) and n-doped BBL. Data in e and f: points, mean; error bars, s.d. (not visible); n = 10 independent samples.

Source Data

To test this approach, we selected poly(benzimidazobenzophenanthroline) (BBL) as a prototypical n-type OSC with a high EA (4.30 eV, Supplementary Fig. 26), high electrical conductivity after doping (greater than 1 S cm–1)30 and high ion permeability52. Et3N was used as the weak n-dopant and [EMIM][TFSI] was used as the organic salt to stabilize the negative polarons on the n-doped BBL chains. Our results show that without light or PC, Et3N is only marginally able to n-dope BBL (Fig. 4d and Supplementary Fig. 35). However, in the presence of light and PC, Et3N considerably n-dopes BBL, resulting in strong negative polaron absorption peaks at 400 nm, 720 nm and 865 nm, similar to those observed in chemically10,35 and electrochemically52 n-doped BBL films. After photocatalytic n-doping, the electrical conductivity of BBL increases by more than five orders of magnitude, from less than 10−5 S cm–1 for undoped BBL to more than 1 S cm−1 after only 2 min of light irradiation (Fig. 4e). DFT computations again indicate that both the reduced and the excited reduced PC can reduce BBL, with the latter being more favoured (Supplementary Fig. 36).

By replacing Et3N with the low-ionization-potential polymer P(g42T-T), we could couple the photocatalytic p-doping and n-doping of P(g42T-T) and BBL, respectively. The semiconductor thin films, which were kept physically apart to prevent ground-state electron transfer21, were both immersed in the same Mes-Acr-Me+ solution and exposed to light to activate the PC (Fig. 4b). The Mes-Acr-Me+ serves as a redox shuttle, transferring electrons from P(g42T-T) to BBL, as is evident from the distinctive polaronic features observed in the ultraviolet–visible spectra of both polymers (Fig. 4d and Supplementary Fig. 35). Photocatalytically p-doped P(g42T-T) displays a typical conductivity of 200 S cm−1, whereas photocatalytically n-doped BBL shows a typical conductivity of 0.1 S cm−1 (Fig. 4e), with only [EMIM][TFSI] being consumed during the process to maintain charge neutrality. Importantly, p-doping or n-doping was observed only in the presence of Mes-Acr-Me+ (Fig. 4f). Although the inevitable alignment of the electrochemical potentials of the polymers (Supplementary Fig. 37) could thermodynamically limit the maximum doping level achievable through simultaneous photocatalytic p-doping or n-doping, this approach enables the concurrent oxidation and reduction of OSCs, which would otherwise be difficult to attain using conventional doping methods. The potential technological effect of this approach is demonstrated by fabricating a thermoelectric generator in which both p-type and n-type legs can be cast on a 25-μm plastic substrate from a solution in ambient conditions and simultaneously doped by Mes-Acr-Me+ to yield power outputs comparable to state-of-the-art thermoelectric modules in which the p-legs and n-legs are doped individually using conventional methods (Extended Data Fig. 10).

Concluding remarks

We have reported a previously unpublished concept of photocatalytic doping for OSCs that offers a simple and efficient solution-based process at room temperature. The doping level can be easily controlled by adjusting the light irradiation dose. Compared with conventional doping methods that rely on highly reactive dopants that are consumed during the doping process, photocatalytic doping uses recyclable and air-stable PCs and consumes only TSFI-based salt and weak dopants, such as O2 (in air). This photocatalytic method is general and applicable to a wide range of OSCs, yielding p-doped, n-doped and simultaneously p-doped and n-doped OSCs with high electrical conductivity. Furthermore, it enables the direct insertion of redox-inert counterions into initially undoped OSC films without negatively affecting their microstructure. These results underscore the importance of photocatalytic doping for fundamental and applied research in organic electronics.

Methods

Materials

Acr-Me+ was purchased from TCI. Mes-Acr-Me+, Mes-Acr-Ph+, eosin Y, lithium bis(trifluoromethanesulfonyl)imide (LiTFSI), 1-ethyl-3-methylimidazolium bis(trifluoromethylsulfonyl)imide ([EMIM][TFSI]), diphenyl disulfide ((PhS)2), n-butyl acetate (BuOAc), acetonitrile (CH3CN), ether (Et2O), Et3N, 1,2-dichlorobenzene (ODCB), methanesulfonic acid (MSA) and dimethylformamide (DMF) were purchased from Sigma-Aldrich. Poly[2,3-bis(3-octyloxyphenyl)−5,8-quinoxalinediyl−2,5-thiophenediyl] (PTQ1) and poly(3-hexylthiophene-2,5-diyl) (P3HT) were purchased from Ossila. CH3CN was dried with a 3 Å molecular sieve before use. Acr-Me+, Mes-Acr-Me+ and Mes-Acr-Ph+ were recrystallized using a CH3CN/Et2O mixed solvent before use. All the other materials were used as received. Poly[2,5-bis(3-tetradecylthiophen-2-yl)thieno[3,2-b]thiophene] (PBTTT), alkylated perylene-diimide, glycolated poly-bithiophene-thiophene (P(g42T-T)), poly-bithiophene-thienothiophene (P(g42T-TT)) and poly-diketopyrrolopyrrole-thiophene (gDPP-g2T), as well as BBL, were synthesized using the procedure reported in refs. 20,21,53,54,55,56.

Sample preparation

PTQ1, PBTTT, P3HT, gDPP-g2T, P(g42T-TT) and P(g42T-T) were dissolved in ODCB and spin-coated onto glass substrates to obtain the corresponding thin films. BBL was dissolved in MSA and spin-coated onto glass substrates, then immersed in water to remove residual MSA and dried with N2 flow to obtain BBL thin films. Unless otherwise stated, the typical PC solutions were as follows: (1) for p-doping with O2 as the p-dopant: BuOAc:CH3CN = 3:1 (volume ratio), [CLiTFSI] = 0.1 M, [CPC] = 0.01 M; (2) for p-doping with (PhS)2 as the p-dopant: BuOAc:CH3CN = 3:1, [CLiTFSI] = 0.1 M, [C(PhS)2] = 0.1 M, [CPC] = 0.01 M; (3) for n-doping with Et3N as the n-dopant: BuOAc:CH3CN = 3:1, [C[EMEI][TFSI]] = 0.1 M, [CEt3N] = 0.1 M, [CPC] = 0.01 M; (4) for simultaneous p-type and n-type doping: BuOAc:CH3CN = 3:1, [C[EMEI][TFSI]] = 0.1 M, [CPC] = 0.01 M. Typical solution preparation process: Acr-Me+, Mes-Acr-Me+, Mes-Acr-Ph+, perylene diimide or eosin Y were dissolved in dried CH3CN, then BuOAc was added to reach BuOAc:CH3CN = 3:1. For eosin Y, 1 vol% DMF was used to aid dissolution. The counterions LiTFSI (or [EMIM][TFSI]) were then added, followed by (PhS)2 or Et3N as in (2) and (3). For (1), the solution was saturated with air (by air bubbling) before use. For (2–4), all the solutions were processed in N2.

Photocatalytic p-doping

OSC thin films were covered with PC solution and irradiated with 455 nm blue light. Unless otherwise stated, the light irradiation intensity was 50 mW cm–2. A heat sink was placed under the OSC films to avoid heating and to slow down solvent evaporation. In the case of O2, the photocatalytic doping process was performed in air. In the case of (PhS)2, the photocatalytic doping process was performed in N2. After light irradiation, the PC solution was recovered and the OSC films were washed with clean BuOAc:CH3CN = 3:1 mixed solvent and dried under N2 flow.

Photocatalytic n-doping

The photocatalytic n-doping and simultaneous p-type and n-type doping processes were conducted in an N2-filled glovebox. The OSC thin films were covered with the PC solution and irradiated with both 455 nm blue light and 390 nm ultraviolet light. The light irradiation intensities for both blue light and ultraviolet light were 50 mW cm−2. A heat sink was placed under the OSC films to avoid heating and to slow down solvent evaporation. After light irradiation, the PC solution was recovered and the OSC thin films were washed with clean BuOAc:CH3CN = 3:1 mixed solvent and dried under N2 flow.

Ultraviolet–visible–near-infrared absorption spectra

OSC thin films were prepared on glass substrates. Air-sensitive samples were placed in a sealed spectral cell filled with N2. Ultraviolet–visible–near-infrared absorption spectra of the films were measured using Perkin Elmer Lambda 900 with a resolution of 2 nm.

UPS and XPS

OSC films were prepared on ITO-coated glass substrates. The XPS experiment used a Scienta ESCA 200 system with a base pressure of 2 × 10–10 mbar equipped with an SES 200 electron analyser, a monochromatic Al Ka X-ray source (1,486.6 eV) and a helium discharge lamp (21.22 eV) for XPS and UPS, respectively. All spectra were collected at normal emission and were calibrated by a sputter-cleaned Au film with the Fermi level at 0 eV and the Au(4 f) peak at 84.0 eV. The work function was extracted from the edge of the secondary electron cut-off while applying a −3 V bias on the sample, and the values were confirmed using Kelvin Probe (KP6500 McAllister Digital Kelvin Probe).

Electrical characterization

Samples with high electrical conductivity (more than 1 S cm–1) were measured with a four-probe set-up (channel width/length was 10 mm/0.5 mm = 20). The results were validated using a smaller channel width/length ratio (0.5 mm/1 mm = 0.5; Supplementary Fig. 38). Samples with low electrical conductivity (less than 1 S cm−1) were measured using a two-probe setup with a channel width/length of 10 mm/0.5 mm = 20 or 200 μm/6 μm = 33.3. For channels with a width/length of 20, 5 nm of chromium as the adhesion layer and 50 nm of gold were thermally evaporated on cleaned glass substrates, the electrodes were patterned by photolithography and the OSC films were patterned by plastic tape. For channels with a width/length = 33.3, 5 nm of chromium as the adhesion layer and 50 nm of gold were thermally evaporated on cleaned glass substrates, the electrodes were patterned by photolithography and the OSC films were patterned using a double-layer of parylene C57. A layer of parylene C (1 μm) was deposited in the presence of 3-(trimethoxysilyl)propyl methacrylate (A-174 Silane) to increase adhesion. An antiadhesive layer of industrial surfactant (2% Micro-90) was spin-coated and a second layer of parylene C (sacrificial layer, 2 μm) was deposited. A 5-µm-thick AZ10XT520CP positive photoresist was then spin-coated on the second layer of parylene C. This protected the layers of parylene C from the following plasma reactive ion etching step (150 W, 500 standard cubic centimetres per minute O2, 100 standard cubic centimetres per minute CF4, 380 s). The contact pads and channel were defined by photolithography and AZ developer was applied to the photoresist. Plasma reactive ion etching removed the organic materials (photoresist and parylene C), exposing the channel area and the contact pads. The remaining surface was still covered with layers of parylene C. The OSC solution was spin-coated and the sacrificial layer of parylene C layer was then peeled off to remove the unwanted OSC film from outside the channel area. Electrical measurements used a Keithley 4200-SCS semiconductor characterization system. For n-doped OSCs, the conductivity measurements were conducted inside an N2-filled glovebox.

Cyclic voltammetry

Cyclic voltammetry was measured on a Potentiostat BioLogic SP-200. A 0.1 M solution of n-Bu4NPF6 in anhydrous cBuOAc:CH3CN (3:1), bubbled with N2 for 1 min to remove the dissolved O2 before measuring, was used for Acr-Me+, Mes-Acr-Me+, Mes-Acr-Ph+, perylene diimide and a standard ferrocene sample. For eosin Y, 1 vol% DMF was added to the above electrolyte to aid dissolution. Glassy carbon was used as the working electrode and platinum mesh was used as the counter electrode, and Ag/AgCl (saturated) was used as the reference electrode. The scan rate was 50 mV s–1.

Photoluminescence spectroscopy

The samples were excited at 3.1 eV (400 nm) using the second harmonic of a mode-locked Ti:sapphire laser (Mira 900, coherent) at a repetition rate of 76 MHz. The excitation beam was spatially limited by an iris and focused with a lens of focal length 150 mm. The fluence was adjusted using neutral density filters to 76 nJ cm–2. The excitation fluence per pulse was estimated assuming the diameter of the focused beam, dfocus, is equal to 1.27 × flens M2/D, where flens is the focal length, M is the quality factor (assumed to be 1) and D is the incident diameter of the excitation beam. The spectra were taken in reflection geometry. The photoluminescence was collected using an achromatic doublet, where 425 nm and 435 nm long-pass filters were used to block the scattered laser light. Steady-state spectra were recorded with a Hamamatsu EM-CCD camera that was spectrally calibrated with a spectrograph equipped with a 50 lines per mm grating. Time-resolved traces were taken with a Hamamatsu streak camera working in single-sweep mode. A pulse picker was used to vary the repetition rate of the exciting pulses. The absolute photoluminescence quantum yields were measured using a Horiba Scientific Jobin Yvon spectrometer equipped with a Quanta-φ integrating sphere.

Transient absorption spectroscopy

The differential transmission was measured by exciting the samples with an ultrafast laser source (100-fs laser pulses at 390 nm) obtained from a Ti:sapphire regenerative amplifier (Coherent Libra) with a repetition rate of 1 kHz and an optical parametric amplifier (Topas 800, Light Conversion). The pump pulses had a fluency of the order of 100 µJ cm–2 adjusted to have the best signal-to-noise ratio while avoiding sample degradation. ∆T/T measurements were performed by probing the samples with fs-supercontinuum white pulses (with a spectral range of 400–800 nm) at different time delays with respect to the excitation (pump) pulses, in a pump-probe configuration in which a transmitted beam and a reference beam were acquired with two CMOS grating spectrometers with 1 nm of spectral resolution (Ultrafast Systems Helios). The overall temporal resolution was always of the same order of magnitude as the excitation pulses (120 fs, full width at half maximum).

GIWAXS

OSC thin films were prepared on Si/SiO2 substrates with an SiO2 layer thickness of 200 nm. GIWAXS experiments were performed at Beamline 9A U-SAXS at the Pohang Accelerator Laboratory in South Korea. The X-ray energy was 11.09 eV and the incidence angle was 0.12°. The samples were measured in a vacuum and the total exposure time was 10 s. The scattered X-rays were recorded by a CCD detector located 222.1186 mm from the sample. All samples for GIWAXS measurements had a similar thickness of around 60 nm.

DFT

Calculations were done using the M06 hybrid meta-GGA functional58. The standard all-electron 6-311 G** basis was used for all atoms59. Molecular geometry optimization of stationary points was carried out without symmetry constraints and used analytical gradient techniques. Frequency analysis was done to obtain thermochemical information about the reaction pathways at 298 K using the harmonic approximation. A single-point calculation of the optimized structures was carried out by adopting the aug-cc-pVTZ basis set60. The diffuse function was necessary because of the presence of anionic species along the reaction mechanism. Finally, solvent effects were modelled at the aug-cc-pVTZ level within the polarized continuum model61 and the SMD variation62. The polymers were modelled by a simplified dimer structure. All calculations were performed using the G16 (ref. 63) code on Linux cluster systems.