a Schematic illustration of pH-sensitive duplex formation at the droplet periphery. In response to higher pH, the DNA triplex motif opens up and reversibly attaches to the cholesterol-tagged DNA handles at the compartment periphery. b Normalized fluorescence intensity of triplex-forming DNA inside the droplet (excluding the periphery) dependent on the pH (mean ± s.d., n = 20). The sigmoidal fit (red curve) has a turning point at pH 6.05. The insets depict confocal fluorescence images of Cy5-labeled triplex-forming DNA (λex = 633 nm, 1 μM) inside a water-in-oil droplet (containing 1.5 μM cholesterol-tagged DNA) at pH 5 (bottom left) and pH 8 (top right). At pH 8, the triplex-forming DNA is located at the droplet periphery, whereas it is homogeneously distributed at pH 5. Scale bars: 20 μm. c Confocal images of microfluidic water-in-oil droplets containing the triplex-forming DNA (λex = 633 nm), cholesterol-tagged DNA and engineered E. coli before (0 min) and after (60 min) illumination with white light. Scale bars: 100 μm. d Fluorescence intensity ratio Iperi/Iin (mean ± s.d., n = 20) of the triplex-forming DNA over time. The ratio increases during light illumination due to binding of the triplex-forming DNA to the droplet periphery. The time period of illumination is indicated in yellow. e Confocal images of microfluidic water-in-oil droplets containing the triplex-forming DNA (λex = 633 nm) and cholesterol-tagged DNA produced at pH 5 (left image). Flushing of the proton acceptor propylamine (1 vol% in HFE) led to a pH increase of the aqueous solution inside the droplets and hence attachment of the triplex-forming DNA (middle). Subsequent flushing of the proton donor trifluoroacetic acid (1 vol% in HFE) decreased the pH and hence causes DNA detachment (right). The attachment of triplex-forming DNA to the droplet periphery is reversible. Scale bars: 30 μm. Source data is available for Fig. 3b, d.