Trained laser-patterned carbon as high-performance mechanical sensors

We describe the mechanical properties of turbostratically graphitized carbon films obtained by carbon laser-patterning (CLaP) and their application as bending or mechanical pressure sensors. Stable conductive carbonized films were imprinted on a flexible polyethylene terephthalate (PET) substrate by laser-induced carbonization. After initial gentle bending, i.e. training, these sponge-like porous films show a quantitative and reversible change in resistance upon bending or application of pressure in normal loading direction. Maximum response values of ΔR/R0 = 388% upon positive bending (tensile stress) and −22.9% upon negative bending (compression) are implicit for their high sensitivity towards mechanical deformation. Normal mechanical loading in a range between 0 and 500 kPa causes a response between ΔR/R0 = 0 and −15%. The reversible increase or decrease in resistance is attributed to compression or tension of the turbostratically graphitized domains, respectively. This mechanism is supported by a detailed microstructural and chemical high-resolution transmission electron microscopic analysis of the cross-section of the laser-patterned carbon.


INTRODUCTION
With the advent of future applications in robotics, bionics, and smart textiles, flexible electronic devices are receiving an enormous scientific interest [1][2][3] . Besides charge storage, energy conversion, or light-emitting devices, flexible responsive materials-sensors-are being explored for health monitoring or human-machine interfaces [4][5][6] .
Typical functional (semi)conductive materials for flexible electronics include metal or semiconductor nanowires or nanoparticles (e.g., silver, gold, metal oxides) [7][8][9][10] . Their nanoscale morphologies and properties are decisive for their flexible performance and advantageous for their utilization in thin skinlike devices 1 . For the fabrication of reliable devices, methods such as chemical vapor deposition, photolithography, screen printing, polydimethylsiloxane (PDMS) transfer techniques, or transfer printing are commonly used 2 . In most cases, these nanomaterials are coupled with or processed into flexible and stretchable polymers such as PDMS matrices 11,12 . For film thicknesses on the micrometer scale inner material sheer forces typically cause cracking or delamination 13 .
A great potential is attributed to organic electronic materials based on conductive polymers, such as poly(3,4-ethylenedioxythiophene) polystyrene sulfonate (PEDOT:PSS), polyaniline, or polyacetylene due to their easy processability, structural tunability, and light-weight [14][15][16] . However, several drawbacks, such as poor environmental stability, poor repeatability, or low mechanical stability, arise with their utilization 17 . Great achievements in developing flexible electronic devices have been made with nanocarbons such as carbon nanotubes or graphene [18][19][20][21] . These materials are generally well-suited for thin-film flexible electronic devices due to their intrinsically low dimensions and tunable electronic properties, which have been demonstrated in a plethora of studies 22,23 . A broad overview of carbon-based materials used in flexible electronics is covered in a recent book on 'flexible carbon-based electronics' 17 . Among the greatest challenges for the production of flexible devices are long-term stability and large-scale production.
In general, carbonized natural materials with high-surface areas and high conductivities have the potential to replace currently used standards due to their abundance and environmental sustainability 24 . In fact, a trend towards using carbon-based semiconductor materials is observed in the past few years, due to undeniable advantages like tunable electronic properties or flexible morphology and above all: biodegradability and resource independence 25 . However, reproducible processing of carbonized materials into functional devices is often a challenge. Modern processing methods, such as 3D-printing or laser-processing have recently emerged as simple fabrication techniques 26,27 . The latter is particularly interesting as it allows for the variable printing of film-based electronics in various structures 28 . Laser patterning of electronically conductive carbon is investigated mostly in terms of laser-assisted reduction of graphene oxide (GO) into 3D-graphene films, which have been used for energy storage and sensing applications [28][29][30][31][32][33][34] . Major drawbacks are the high costs of GO production and the difficulties in tuning the properties of the resulting reduced GO films as it requires a multitude of synthesis steps. Another high potential material is laser-induced graphene (LIG) from polyimides (PI) which can be understood as a type of laser-induced carbonization [35][36][37][38][39][40][41] . Even more advantageous is the use of organic nanoparticle inks based on naturally abundant molecules as precursors. It provides transferability to different flexible substrates and a high degree of tunability of the properties of the final carbons 42,43 . These inks can be produced from a variety of molecular precursors 44 . Moreover, the porous, semi-crystalline structures are environmentally stable and their electrical properties are responsive to temperature and chemical environment 45,46 .
In this study, we utilize carbon laser-patterning (CLaP) to produce functional carbon-based films with an intrinsically flexible morphology as a transferable and inexpensive method to produce reliable mechano-sensor platforms. The laser-patterned carbon (LP-C) was obtained from simple molecular precursors, namely citric acid and urea, and forms a composite with the flexible substrate, namely polyethylene terephthalate (PET) or polyurethane (PU). Based on a comprehensive cross-sectional investigation by high-resolution transmission electron microscopy (HRTEM), scanning transmission electron microscopy (STEM), and electron energy loss spectroscopy (EELS) a mechanism for the change in resistance of the LP-C films is proposed. After gentle training, the mechano-sensor strips show reliable and stable performance for several hundred cycles. The impact on the electronic properties during quantitative bending and compression experiments was analyzed in depth. Reversible changes in resistance on the order of ΔR/R 0 = 388% upon positive bending and −22.9% upon negative bending are characteristic. Furthermore, quantitative reversible responses between ΔR/R 0 = 0 and −15% were measured for mechanical pressure in the normal loading direction.

Fabrication of the sensor strips
Laser-patterned carbon (LP-C) was fabricated according to a recently published protocol with small modifications 43 . In brief, a mixture of citric acid and urea was pre-carbonized at 300°C. The thus obtained carbon network-forming agent (CNFA) was processed to an ink using ethylene glycol as a solvent, polyvinylpyrrolidone (PVP) as a film forming agent (FFA), and sodium iodide as a porogen. The mixture was gently stirred for 24 h to obtain a homogeneous viscous ink, which was applied on polyethylene terephthalate substrates (PET), polyurethane (PU), or nitrile gloves by doctor blading. The ink was patterned with a CO 2laser engraver using the vector mode according to Fig. 1A (see "Experimental" section for details). Finally, the unexposed precursor film was rinsed off the substrate with H 2 O. The presence of an infrared-laser transparent porogen (NaI) supports the penetration of the laser energy into deeper layers and increases the carbonization yield. However, no residues were found after laser patterning by spectroscopic electron microscopy within the limitations of the applied techniques.

Characterization
Typical dimensions of LP-C patterns are 10 × 0.5 mm or 2 × 0.5 mm serving as a standard for the flexibility or compression tests, respectively. An optical micrograph of a representative printed pattern is presented in Fig. 1B. The thickness of the resulting laser-carbonized patterns was varied between 34 and 53 µm by adjusting the distance of the doctor blade during precursor film application ( Supplementary Fig. 1). The films generally show a high roughness due to the hierarchical porous structure generated during the laser carbonization as shown in the height profiles obtained by vertical interference topography measurements (Fig. 1C). The roughness arises with the formation of the foamy structure due to evaporating products during the carbonization process (Fig. 1D). The laser treatment imposes a rapid heating, through which carbonization is achieved 42 . The energy input takes place from top to bottom of the film resulting in gradual carbonization across the film. This foamy morphology provides a high degree of mechanical flexibility compared to purely crystalline materials.
As we have shown in previous studies, the penetration depth of the laser is dependent on the extinction coefficient of the precursor material 44 . A thickness of 15-50 µm allows for penetration throughout the precursor film. The electrical conductivities across the films were determined to be 7.2 ± 0.8 S cm −1 . The LP-C film appears to be resistant against bending and touching as shown in the photographs in Fig. 1E. After manual fast bending, however, the films showed an infinitely high resistance although upon inspection by eye the LP-C strip seems intact. Upon slow bending, only minor changes in resistivity were detected as in detail discussed in the following.

Bending sensor
To study the stress-strain characteristics of the LP-C strips, we monitored the resistance R upon quantitative bending using a specially designed movable electrode stage suited for periodic fatigue testing. In the photographs in Fig. 2A an LP-C strip on PET is mounted between two electrodes. One of the electrodes was moved with a defined speed to bend the LP-C strip in positive (upward) or negative (downward) direction. The maximum curvature of the bending is dependent on the distance between the two electrodes as shown in Fig. 2B and was quantified in a range between a minimum value of 0.07 and a maximum value of 0.4 mm −1 (see Supplementary Fig. 2 and "Experimental" section). The LP-C strip was placed in the center between the moveable electrode stage and the electronic response towards quantitative bending was recorded with a four-probe resistance measurement setup.
Initially, the LP-C strips were bent with a speed of 1 mm s −1 to reach the maximum curvature of 0.4 mm −1 within 10 s. After this first test, the electrical integrity of the LP-C strip is irreversibly destructed, i.e. the resistance of the LP-C strip responds indistinctly to a quantitative change in curvature ( Supplementary  Fig. 3). This is attributed to fractures of the material upon fast bending. A closer inspection by scanning electron microscopy (SEM) ( Supplementary Fig. 4) shows the emergence of cracks when looking at the LP-C pattern in a bent state. To avoid fracture, fresh LP-C strips were bent at a slow speed of only 10 µm s −1 starting at low curvatures of 0.07 mm −1 and slowly increasing to the maximum curvature of 0.4 mm −1 (three times for each curvature/amplitude) (Fig. 2C). Thereby, the electrical integrity of such LP-C strips was retained. This systematic training procedure was applied for both bending directions, positive and negative in a subsequent manner to each LP-C strip. The upper panel in Fig.  2C shows the applied curvature as a function of time (blue = positive bending, red = negative bending), while the center panel shows the corresponding response of R upon bending in the first run (training). The lower panel depicts the resulting response of R for operation. In the training of the positive bending, at low curvatures, the change in R is rather small but becomes larger with increasing curvatures. After the training, the response has changed in terms of ΔR and stabilizes for all subsequent cycles-in the operation mode. A closer look at the resistance curves during the first cycle in the inset of Fig. 2C shows two interesting aspects: (1) ΔR behaves non-linear to the change in curvature and (2) each time the curvature is increased, a step in the ΔR curve is observed. This response is attributed to a slowly induced structural change in the material. This sustainable change is finally reflected in a subtle increase of the resistance at rest (R r )-in the flat state-in the particular case from 1.02 before to 1.29 Ω after the bending experiment. Nevertheless, the structural integrity of the LP-C film in the bent state is largely retained and only minor cracks in the material are observed ( Fig. 2D and Supplementary Fig. 4).
The asymmetric top-to-bottom geometry of the LP-C sensor strips, i.e. the placement of the active layer on one side of the substrate, is an advantage for the differentiation between positive and negative bending. As shown in the red curves in Fig. 2C, a decrease in resistance is observed upon negative bending. Although, the extent of ΔR is significantly smaller (ΔR max ≈ −183 Ω) than for positive bending, a quantitative and reversible signal is obtained.
After finishing the training, the LP-C strips can be cycled at any speed (max: 400 mm s −1 ) to any indicated curvature giving a stable response (lower panel in Fig. 2C). For example, 600 bending cycles to a fixed curvature show a stable quantitative response The response is systematically dependent on the film thickness. In Supplementary Fig. 5 the resistance response of four samples with different thicknesses-34, 41, 48, and 53 µm-is shown. Notably, the general response behavior is the same for all tested samples. In the low curvature regime (<0.10 mm −1 ), the response of thicker films is weaker, while in the high curvature regime (>0.15 mm −1 ), the response of thicker films is significantly higher. For example, at maximum curvature we find ΔR/R = 451% for a 48 µm thick film in the positive training cycle, whereas for 41 and 34 µm thick films we measure ΔR/R values of 302% and 259%. A mean film thickness of 53 µm leads to a non-quantitative response at high curvatures ( Supplementary Fig. 5B). Therefore, we consider the mean thickness of 48 µm to be the upper threshold for producing stable quantitative sensors. These films are characterized by maximum operating ΔR/R values of 388% and −22.9% for maximum curvature in the positive and negative bending mode, respectively. (Supplementary Fig. 5C, D).

Strain sensor
To test the flexibility with regard to stretching and their applicability as strain sensors, LP-C films were printed on stretchable polyurethane (PU) substrates. The printing pattern was slightly adopted to provide a better integrity upon substrate deformation ( Supplementary Fig. 6). Quantitative response was observed upon stretching the LP-C film to 1.1 or 2.2% giving ΔR/R values of 13 or 73%, respectively. Up to a strain of 3.3%, a reversible behavior was measured giving ΔR/R values of around 425%, but the signal is indistinct quantitative. Strain higher than 3.3% results in irreversible rupture of the LP-C film.

Mechanical pressure sensors
The flexibility of the electrically conductive LP-C on PET and, in particular, the porous foamy morphology induced by the laser carbonization also facilitates the application as mechanical pressure sensors (normal loading direction). A force gauge with a flat tip (diameter 1.5 mm, mounted on a manual test bench) was employed to quantitatively apply pressure on an LP-C strip (0.5 × 2 mm) to test the electrical response upon normal mechanical loading (Fig. 3A, B). As in the previous bending experiments an initial training step was applied to bring the sensor into a reversible state, i.e. stabilizing the resistance at rest (R r ). The training is visualized in the upper panel of Fig. 3C. First, a maximum pressure of 924 kPa was applied which caused an increase in R r from 136 to 171 Ω. This procedure was repeated with different pressure until the R r after application of pressure was stabilized. After each pressure exertion a temporary decrease in resistance is noted, however, the R r increases slightly until it stabilizes at 181 Ω.
Once the R r is stable, the sensor strip was tested for different pressure settings. Every subsequent pressure exertion quantitatively translates to a decrease in resistance. The center panel of Fig. 3C shows the resistance of an LP-C sensor strip upon subsequent application of different pressures as indicated in the graph. Notably, during operation the R r is stable. In the lower panel of the graph, the quantitative response in terms of ΔR/R 0 is shown. The change in resistance scales in a bi-linear fashion with the applied pressure as shown in the lower panel of Fig. 3C. In the low-pressure regime <60 kPa, a steeper slope is observed with ΔR/ R 0 values of up to −5%. The high-pressure regime >60 kPa is characterized by a resistance response of ΔR/R 0 in the range of −5 to −10%. The overall morphology of the LP-C strip after the application of pressure appears still porous. However, obvious compression effects are noted. The SEM images in Fig. 3D show the same spot of the LP-C strip before and after exertion of pressure. Apparently, the porous structure is plastically compressed, which leads to a temporary increase in conductivity, as additional connections within the conductive material are established. Upon release of the mechanical pressure, these temporarily established connections are disconnected.
Like with the bending sensors, the response of LP-C as pressure sensors changes with the thickness of the LP-C. As demonstrated in Fig. 3E, four different mean film thicknesses of 34, 41, 48, and 53 µm were tested and a higher response was found for thicker LP-C films. The 53 µm thick film gives a response with maximum values of ΔR/R 0 = −15%. A lower mean thickness of 34 µm results in ΔR/R 0 of only −5%. One intriguing aspect about the employed laser carbonization technique is its versatility regarding the choice of substrates. For example, the LP-C sensors can be printed directly onto nitrile gloves (Fig. 3F).

Cross-sectional characterization
To obtain a deeper understanding of the functional principle of the electronically responsive LP-C sensors, we conducted a detailed cross-sectional analysis. To preserve the film morphology and to generate cross-sectional samples for optical microscopy (OM) and TEM by ultramicrotomy, the LP-C films were infiltrated and thus completely embedded in a resin (see "Experimental" section).
The optical micrograph in Fig. 4A shows that the LP-C film is literally imprinted into the PET substrate. Under the applied laser illumination, the upper layer of approximately 40 µm of the PET substrate appears lighter with respect to the rest of the substrate. In this region, the LP-C penetrates into the PET and vice versa providing the overall stability of the LP-C films against delamination. This effect stems from the heat induced by the laser, which causes the PET to melt (mp = 260°C) and merge with the LP-C. The molten PET becomes visible after removing the LP-C film with the aid of ultrasonication in 0.1 M KOH/H 2 O (Supplementary Fig.  7). Furthermore, the optical micrograph shows a color/reflectance gradient from dark gray to shiny from the top to bottom of the film. This is correlated to chemical and structural variations across the film, which were analyzed in detail by (S)TEM.
Throughout the whole film, the LP-C patterns appear highly porous with a sponge-like structure as demonstrated by the STEM micrograph of a representative thin section Fig. 4B. The analysis corroborates a high degree of open porosity as almost all pores are well infiltrated with the resin throughout the films with a few local exceptions mostly on the substrate side (also confirmed by OM). Those residual voids appear black in the detailed analysis and do not show any signals (Fig. 4B, C, E). The pore diameters typically range from a few tens of nanometers up to a few micrometers throughout the functional film (Fig. 4A, B). The thickness of the pore walls varies from only a few nanometers at the top of the film and up to a few 100 nm towards the PET substrate (cf. STEM overview image in Fig. 4B and corresponding chemical-bond mapping in Fig. 4E). Moreover, at the substrate side, pockets between the pores are found, which are more evident in the chemical-bond mapping in Fig. 4E. Those pockets appear to be filled with less converted precursor material.
The cross-sectional TEM investigation allows for a detailed chemical and structural analysis across the whole LP-C film. A clear gradient with respect to the local chemical composition and consequently the bonding of carbon was found and confirms our previous interpretations 44 . The EELS elemental distributions in Fig.  4C show the compositional gradients of carbon, nitrogen, and oxygen across the film. As expected from the laser treatment with the highest process temperature at the upper half of the film, the top part appears to be converted to mostly graphitic carbon explaining the thin pore walls. In contrast, high nitrogen and oxygen contents close to the composition of the reactants are determined in the lower half of the film. Unfortunately, the local concentration of hydrogen is not directly accessible by the employed techniques. The chemical-bond analysis (Fig. 4D, E, details in Experimental Section) clearly confirms the almost exclusive presence of graphitic carbon in the upper part (cf. obtained reference spectrum of graphite in Fig. 4D), while two components, i.e. amorphous pore walls and the less affected pocket regions in-between are clearly distinguished in the lower part of the film. Although the pockets between the porestowards the substrate sideand the adjacent pore walls show similar compositions and are thus hardly separable in the elemental distributions (Fig. 4C), they clearly show different bonding character (Fig. 4E). Representative HRTEM images of the upper and the lower part of the films are presented in Fig. 4F. These images in conjunction with corresponding selected-area electron diffraction (SAED) patterns in Fig. 4G confirm a high degree of crystallinity of turbostratic graphitic carbon in the upper LP-C film regions while the lower regions still consist of predominantly amorphous pore walls and pockets. The crystal structure of graphite is clearly confirmed by comparing the radial SAED intensity distribution from the upper film region with a kinetic simulation presented in Fig. 4H; the differences in intensities, in particular the lower intensities of the (002), (004) and related reflections are attributed to the geometry of the crosssectional TEM sample with presumably less basal planes of the graphite in diffraction condition.

DISCUSSION
Taking all information from the cross-sectional analysis into consideration, we draw the following conclusions. The overall mechanical stability against delamination is provided by penetration of molten PET into the LP-C film. Furthermore, we observe systematic chemical and structural gradients across the films due to the depth-dependent energy input during the laser-induced carbonization, resulting in a gradual graphitization. Around 10-15 µm below the film surface a clear and considerably abrupt transition region from crystalline turbostratic graphite to amorphous oxygen and nitrogen containing carbon is found.
This observation supports previous results 44 . During laser carbonization, heat induced by the laser causes the decomposition of the precursor. The subsequent rapid release of gases causes the formation of pores, while the remaining material (pore walls) carbonizes and partly graphitizes. A lower degree of graphitization in the lower regions results in thicker pore walls. The expansion of the material during the laser-induced evaporation of the precursors causes some of the unreacted precursor material to be trapped in pockets between the pores.
It seems likely, that the turbostratically graphitized material is responsible for the electronic conductivity, however, morphological variations throughout the film impede a detailed microelectrical analysis. As the overall porous morphology stays intact after mechanical training as well as during operation, the origin of the change in resistivity is attributed to nanoscopic changes of the local microstructure while preserving the mechanical integrity. The conductive part, i.e. the pore walls, is of turbostratic graphitic nature, i.e. nanocrystalline carbon and is best compared to activated carbons 44 . According to the electric contact theory 47 , the conductivity of activated carbons depends on the distance between conductive particles and their average size 48 . Application of mechanical stress such as positive bending of the LP-C sensor effectively results in the release of mechanical pressure from the carbon network while application of mechanical pressure (negative bending) compresses the graphitized domains in the carbon network. In the same manner, the conductivity in activated carbons changes upon variation of the pressure 49,50 . In LP-C, maximum bending results in a response of ΔR/R 0 ≈ 400% or −15% for positive or negative bending, respectively. Most stand-alone (binder-free) flexible carbon materials are based on graphene, carbon nanotubes, or carbon fibers. These carbon materials are genuinely advantageous due to their extremely high conductivities and their chemical inertness. However, their high conductivities limit their response for resistive sensing. For example, a graphene/carbon nanotube composite gives a ΔR/R 0 = 2% at maximum bending. Pure carbon nanotube (CNT) networks give an even lower response 51 . Motion sensors based on carbon blacks are typically composited with conductive metallic nanoparticles to form conductive networks. Such motion sensors give a reasonable response of up to ΔR/R 0 ≈ 80% 52 . However, in these scenarios, the response it not sensitive to the bending direction. In comparison, the herein discussed conductive foamy turbostratic carbon networks produced by CLaP are an extremely simple and costeffective method and show excellent performance as mechanical sensors. Yet, the main drawback is the limited performance when applied as strain sensors.
We presented a comprehensive study on the mechanical properties of turbostratically graphitized carbon films obtained by CLaP. After slow training, the porous films show a stable and reproducible change in resistance of ΔR/R 0 = 388% and −22.9% upon bending in positive or negative direction, respectively, with a quantitative response to any curvature. The films are environmentally stable and can be operated for several thousand cycles. A quantitative response is also obtained upon compression at normal loading. These properties make laser-patterned carbon films applicable as mechanical motion and pressure sensors envisioning their utilization in robotics and bionics. An in-depth microscopic and spectroscopic cross-sectional analysis provides unprecedented insights into the microstructure and local chemistry of laser-patterned carbon. A compositional and structural gradient across the film due to the unidirectional laser impact was visualized by HRSTEM and EELS analyses. The sponge-like morphology of the turbostratic crystalline carbon provides a high degree of flexibility for reversible resistance changes. These properties make laser-patterned carbon interesting as a novel sustainable material for mechanical sensors with excellent mechanical properties and durability.
Preparation of carbon network-forming agent (CNFA) and the precursor films Citric acid and urea were thoroughly mixed in a quartz crucible. The vessel was covered with a lid to avoid spilling of the foaming reaction product and to allow evaporation of evolving gases a small opening was placed under the lid. The mixtures were annealed at 300°C in a tube furnace for 2 h under constant flux of N 2 (0.1 L min −1 ). After annealing, the black reaction product was retained and grinded in a ball mill to obtain a fine black powder (CNFA).
Polyvinylpyrrolidone (200 mg mL −1 ) was dissolved in ethylene glycol (EtGly) to obtain a 0.2 g mL −1 solution (PVP/EtGly). Sodium iodide was dissolved in the mixture at a concentration of 0.4 mg mL −1 . The CNFA was then added and stirred for 24 h to obtain a 1 g mL −1 dispersion. The resulting ink was was doctor bladed on the PET substrates to obtain uniform films. Ethylene glycol was then evaporated at 80°C on a precision hotplate (PZ2860-SR, Gestigkeit GmbH) to obtain the precursor films.

Laser-assisted carbonization
Laser carbonization was conducted with a high-precision laser engraver setup (Speedy 100, Trotec) equipped with a 60 W CO 2 laser. Focusing was achieved with a 2.5 inch focus lens providing a focal depth of~3 mm and a focus diameter of 170 µm. The center wavelength of the laser is 10.6 ± 0.03 µm. The scanning speed υ′, generically given in %, was converted into s·m −1 . The effective output power P of the laser was measured with a Solo 2 (Gentec Electro-Optics) power meter. The resulting energy input per distance (or fluence) F in J m −1 in the vector mode onto the film is given by For the experiments, the laser settings were adjusted to meet the requirements of the films. After laser carbonization the unexposed zones of the precursor films were rinsed off the substrate with H 2 O.

Mechano-resistance measurements
Bending experiments were performed with a home-made force table. The sample strip was clamped by two opposing copper electrode clips at a distance of 25 mm, of which one was connected to a movable table. To provide a better electrical contact both ends of the carbon strip were connected with silver paint to the copper electrodes. The curvature of the bending was determined by translating the shapes from photographs into x-y data using the freeware Engauge Digitizer 53 . The curvature is defined as the inverse radius at the maximum point of bending.
Compression experiments were conducted with a digital force gauge with a flat tip with a diameter of 1.5 cm mounted on a manual test bench. Sensor strips with dimensions 0.5 × 2 mm were patterned on PET substrates. At the two ends of the pattern silver ink was applied to provide proper contact to the electrodes. Reference measurements were conducted to ensure that the silver ink did not affect the performance of the sensor.
In all experiments, the resistance was monitored in four-point geometry using a RS PRO RSDM3055A digital multimeter controlled by Matlab-based software.

Preparation of resin infiltrated films for cross-sectional TEM analysis
Cross-sectional preparation of electron transparent TEM samples was conducted by ultramicrotomy using a Leica EM UC7 microtome. To conserve the film morphology, individual patterned samples on PET were extracted by doctor-blade cutting and embedded in epoxy (Epofix, Struers, Germany). A self-built vacuum tool was employed to infiltrate the highly open-porous samples. Curing of the epoxy was achieved by annealing at 60°C for 4 h. The sample regions, potentially damaged by blade cutting, were removed by trimming (DiATOME 45°trim knife) a truncated pyramide with a trapezoid-shaped block face. Cross-sectional TEM samples were cut with a DiATOME 45°histo diamond knife and were subsequently transferred onto Lacey carbon TEM grids (TedPella/Plano) for enhanced support.

Characterization
Scanning electron microscopy was performed on a Zeiss LEO 1550 Gemini microscope at acceleration voltages in the range of 3-10 kV.
Vertical scanning interferometry was performed with a vertical scanning interferometer smartWLI compact (GBS mbH, Germany) with the software smartVIS3D 2.28 Tango and visualized with MountainsMap 8.
Transmission electron microscopy was performed utilizing a Thermo Fisher FEI Talos F200X operated at 200 kV. The instrument is equipped with a XFEG high-brightness gun, a large-area Super-X EDXS detector and a Gatan Continuum ER spectrometer (with high-speed DualEELS, dispersion 0.3 eV/channel, DigiScan, EDXS integration, GMS 3.4x) for electron energyloss spectroscopy. For morphological and structural analyses, bright-/darkfield (BF/DF) imaging, selected-area electron diffraction (respective selected-area diameter on sample corresponding to almost 1 µm), highresolution TEM and high-angle annular dark-field scanning TEM were conducted, while advanced electron energy-loss spectroscopy was employed for detailed compositional and chemical-bond analyses. Owing the relative thickness of the prepared cross-sections (around 0.4-1.2 meanfree paths for inelastic scattering depending on the local material), Dual EELS was used to simultaneously record core-loss as well as corresponding low-loss spectra for systematic energy-loss recalibration and the removal of multiple scattering from the element-specific core-loss spectra by deconvolution. The core-loss spectra in the energy-loss range of 200-800 eV covered all interested ionization edges of C, N, and O at around 285 eV, 400 eV and 532 eV, respectively. The elemental distributions of C, N, and O were quantified using the theoretical ionization crosssections as implemented in the Gatan software suite because the results from the used epoxy as internal reference closely correspond to its given composition. The presented atomic concentrations exclude hydrogen because it is not measurable by EELS, thus c C + c N + c O in Fig. 4B equals 100 at%. For detailed chemical-bond analyses, four major components, namely the epoxy, graphitic carbon (upper sample regions), pore walls in the lower regions and less reacted pockets, were identified and reference spectra were obtained from the mapping itself. Therefore, individual spectra from such well characterized regions (match with STEM/HRTEM data) were thoroughly selected, summarized and finally normalized. To distinguish between the different components, each individual spectrum of a mapping was evaluated by fitting (multiple least-squares minimization) those references to the carbon ionization edge (energy-loss range 280-310 eV). The evaluation implied the thorough verification of the corresponding intensities of the N and O ionization edges.

DATA AVAILABILITY
All data needed to evaluate the conclusions in the paper are present in the paper and/or the Supplementary Materials. Additional datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.

FUNDING
Open Access funding enabled and organized by Projekt DEAL.