Introduction

Low-grade heat, defined as heat below 100 °C, is an abundant but underutilized resource, emanating from both industrial processes and natural environments. It accounts for more than 30% of global primary energy consumption, with approximately 85 PWh/year of energy lost worldwide1,2,3,4. Harnessing this abundant low-grade heat presents a viable solution to the energy crisis and the reduction of carbon emissions, thereby generating significant interest in exploiting these extensive heat reservoirs. Recent developments in ionic thermoelectrics, including thermo-ionic capacitors and thermogalvanic cells, have spurred research into using ions as carriers for thermal energy conversion5,6,7,8. According to the second law of thermodynamics, ions naturally migrate across temperature gradients from cooler to warmer areas. By incorporating permselective membranes that selectively permit the passage of anions or cations, a net electric flux is established, which can be harnessed through appropriate electrodes and discharged through an external resistor9,10,11,12,13,14,15,16,17,18,19,20,21,22. This ionic movement, propelled by temperature differentials, can thus be transformed into electrical energy, whereby the output power density is proportional to the system’s conductance and the generated voltage (Fig. 1). To maximize the efficiency of thermoelectric conversion, it is essential to develop membranes with high permselectivity, especially in high-salinity conditions.

Fig. 1: Schematic representation of energy extraction from low-grade heat utilizing a permselective membrane.
figure 1

The diagram illustrates how the permselective membrane enables selective ionic migration from the cooler reservoir on the left to the warmer reservoir on the right, resulting in a net ionic current. Specifically, a cation-selective membrane is depicted, allowing cations to pass preferentially over anions. Redox Ag/AgCl electrodes facilitate the conversion of this ionic current into electrical current through redox reactions, thus converting heat energy into electric energy.

Electrically charged covalent-organic-framework (COF) membranes stand out for their exceptional ionic conductivity and selectivity, largely due to their densely interconnected networks of nanopores that enhance ion transport and screening23,24,25,26,27,28,29,30,31,32. These membranes harness long-range Coulomb forces to effectively screen ions at relatively low salt concentrations ( < 0.1 M) by exploiting the overlapping electric double layers (EDLs) across the pore channels, which repel co-ions while allowing counter-ions to permeate. However, as salt concentrations increase, the thickness of the EDL, determined by the Debye length (\({\lambda }_{D}\)), decreases (Supplementary Table 1). At elevated salt concentrations, a reduced \({\lambda }_{D}\) fails to cover the entire width of the channel, enabling both cations and anions to traverse the nanochannels. For instance, at a 1 M KCl concentration, \({\lambda }_{D}\) decreases to 0.3 nm—smaller than the pore sizes of most ionic COF materials—posing a challenge to maintaining high selectivity under such circumstances33. Thus, developing alternative ionic screening mechanisms is imperative to achieve high permselectivity in high salinity environments. Ion screening in nature primarily relies on short-range interactions driven by forces that operate over distances comparable to the sizes of the particles or molecular structures involved. These interactions encompass van der Waals forces, hydrogen bonding, ion-dipole interactions, and other similar mechanisms. For example, protein ion channels utilize specific configurations of NH and CO groups to selectively bind either anions or metal cations, effectively screening charged species34. Expanding on this principle, Park et al. recently engineered a charged-neutral 2D nanoporous polymer membrane that preferentially transports K+ over Cl under a KCl concentration gradient of 1 M | | 0.1 M35. This selectivity is attributed to the preferential attraction of Cl ions to the −OH groups on the linkers of the COF membrane. Drawing inspiration from this innovation, we propose that the diverse linkages in COF chemistry could similarly engage in various short-range interactions with ions36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57. Despite its potential, the use of short-range interactions between ions and linkages for ionic screening in COF membranes remains largely unexplored.

To validate our hypothesis, we synthesized three COF membranes employing β-ketoenamine, hydrazone, and imine linkages, commonly utilized in COF synthesis58,59,60,61,62,63,64,65. Despite their charge-neutral structures, the COF membranes featuring β-ketoenamine and hydrazone linkages exhibited exceptional permselectivity. Particularly, the β-ketoenamine-linked COF membrane demonstrated excellent ionic selectivity even under a 3 M KCl solution and a 10 K temperature gradient, achieving an impressive thermoelectric power density of 0.5 W m−2. Molecular dynamics (MD) simulations revealed that this enhanced permselectivity stems from synergistic interactions between Cl ions and partially positively charged NH groups, as well as CH moieties in the phenyl rings, facilitating K+ transport. This selective ion screening, driven by short-range interactions, introduces additional functionalities beyond long-range Coulomb interactions, enabling the adjustment of pore surface charge properties, such as polarity and intensity, through targeted ion adsorption. These modifications significantly enhance the membrane permselectivity and thermoelectric conversion efficiency. Remarkably, treating the membrane with K3PO4 resulted in an extraordinary power density of 20.22 W m−2 at a 50 K temperature gradient, highlighting its substantial potential for thermoelectric conversion

Results

Design and fabrication of membranes

Before initiating the experiment, we conducted preliminary computational investigations to evaluate the electrostatic potentials (ESP) of three distinct COFs characterized by different linkages. To maintain control over variables such as functionalities, pore size, and structure in the context of membrane ion screening, we selected specific pairs: triformylphloroglucinol (Tp) with p-phenylenediamine (Pa) for COF-TpPa, terephthalaldehyde (Ta) with benzene-1,3,5-tricarbohydrazide (Bt) for COF-TaBt, and 1,3,5-triformylbenzene (Tb) with Pa for COF-TbPa. These pairings ensured that each COF shared an identical topology and comparable pore sizes (1.8–2.2 nm), while differing in their β-ketoenamine, hydrazone, and imine linkages. The ESP analyzes revealed that, across all COFs, the benzene rings displayed a consistent behavior, featuring a partial negative charge across the π system and a partial positive charge around the ring’s periphery, characteristic of a quadrupole moment66. However, variations in the distribution and magnitude of the electrostatic potentials were evident among the COFs with different linkages, suggesting distinct short-range interactions with ions (Fig. 2).

Fig. 2: Depiction of the chemical structures for COF-TpPa, COF-TaBt, and COF-TbPa, coupled with the ESP mapped onto their van der Waals surfaces.
figure 2

The figure illustrates the percentage of the surface area within specific ESP ranges. Critical local minima and maxima on the surface are indicated by red and blue spheres, respectively, with corresponding colored labels for clarity.

Given their potential in ionic selectivity, we undertook their synthesis using a liquid-solid-liquid interfacial condensation technique. This method entailed growing COF active layers on polyacrylonitrile (PAN) ultrafiltration membranes with a molecular weight cut-off of 50,000 Da (Supplementary Fig. 1). PAN was selected due to its nanoscale and relatively uniform pore size, facilitating the formation of compact COF active layers (Supplementary Fig. 2). During this process, we applied an aqueous solution of acetic acid containing either Bt or Pa, along with an organic aldehyde solution (Tp, Ta, or Tb), to opposite sides of the PAN membrane. This reaction induced noticeable color changes on the PAN surface, signaling successful COF layer formation. Specifically, the color transitioned from white to vermilion for COF-TpPa/PAN, dark yellow for COF-TaBt/PAN, and light yellow for COF-TbPa/PAN (Supplementary Fig. 3). Zeta-potential measurements of these membranes revealed values of −26.8 mV for COF-TpPa/PAN, −16.3 mV for COF-TaBt/PAN, and −13.9 mV for COF-TbPa/PAN, all lower than that of the pristine PAN membrane ( − 11.5 mV) when tested under 1 mM KCl at a pH of 6.5. These findings confirm the influence of different linkages on the ion affinity of the resulting membranes.

Membrane characterization

Subsequently, we present a comprehensive characterization focusing on the COF-TpPa/PAN membrane (Supplementary Figs. 410), while details on the other two membranes are provided in the Supplementary Information (Supplementary Figs. 1122). The formation of the β-ketoenamine-linked COF was confirmed through Fourier transform infrared (FT-IR) and solid-state 13C nuclear magnetic resonance (NMR) spectroscopies. FT-IR analysis revealed the disappearance of N − H (3197 − 3298 cm−1) and C = O (1637 cm−1) stretching bands, characteristic of Pa and Tp monomers, alongside the emergence of a new C − N stretch at 1280 cm−1, indicative of β-ketoenamine bond formation (Supplementary Fig. 4). Solid-state 13C NMR displayed a carbonyl carbon peak at 184.2 ppm, supporting the chemical structure (Supplementary Fig. 5)67. Scanning electron microscopy (SEM) depicted the morphology of the COF-TpPa/PAN membrane, showing a continuous COF layer approximately 235 nm thick on the PAN substrate (Fig. 3a and Supplementary Fig. 6). Transmission electron microscopy (TEM) showcased distinct lattice fringes within the membrane, indicating its crystalline nature (Supplementary Fig. 7). The crystallinity was further evidenced by small-angle X-ray scattering (SAXS), where distinct diffraction peaks were observed despite the thinness of the COF layers, highlighting their high crystallinity (Fig. 3b). Additionally, two-dimensional grazing incidence wide-angle X-ray scattering (GIWAXS) revealed distinct in-plane and out-of-plane reflections (Fig. 3c), suggesting a slight preferential alignment of the COF-TpPa layers parallel to the transport pathway, as inferred from the incomplete ring formations in the pattern. To analyze the pore structure of the COF-TpPa/PAN membrane, we contrasted the SAXS profile with the simulated X-ray diffraction pattern based on an AA eclipsed stacking configuration of COF-TpPa, noting a pronounced similarity (Supplementary Fig. 8 and Fig. 9, and Supplementary Tables 24). The porosity of the COF-TpPa membrane was evaluated by obtaining N2 sorption isotherms at 77 K, which demonstrated type-I behavior indicative of microporous materials. The Brunauer−Emmett−Teller (BET) surface area and pore volume of the membrane were determined to be 237 m2 g−1 and 0.18 cm3 g−1, respectively. Further, pore size distribution analysis using the non-local density functional theory (NLDFT) model indicated that the pore size of the membrane peaks at 1.8 nm, consistent with calculations using Zeo + + software based on the eclipsed AA stacking structure of COF-TpPa (Supplementary Fig. 10).

Fig. 3: Characterization of the COF-TpPa/PAN membrane.
figure 3

a Cross-sectional SEM image depicting the COF-TpPa/PAN membrane, with inset showing the membrane thickness. b 2D SAXS image and the corresponding projection of the SAXS pattern. c 2D GIWAXS pattern.

Having obtained the COF membranes with various linkages, we began exploring their permselectivity, quantified by the cation (\({t}_{+}\)) or anion (\({t}_{-}\)) transference numbers (Supplementary Eqs. 1 and 2). These values were determined potentiometrically through the use of nanofluidic devices incorporating the membranes, where two chambers were filled with the same salt solution but with a concentration gradient. Current-voltage (I − V) curves were recorded using Ag/AgCl electrodes (Fig. 4a). In the chamber adjacent to the COF active layer, the KCl concentration was fixed at 0.1 mM, while in the opposite chamber, it varied between 0.5 mM and 1 M, creating a gradient range from 5 to 104. By analyzing these I − V profiles, we were able to read both the short-circuit current (\({I}_{{sc}}\)) and the open-circuit potential (\({V}_{{oc}}\)). Notably, the \({V}_{{oc}}\) consistently exceeded the redox potential of the Ag/AgCl electrodes, signifying a cation preferential passage through the membrane (Supplementary Fig. 23). An increase in both potential and current was observed with higher concentration gradients across the COF-TpPa/PAN membrane, underscoring its significant permselectivity (Fig. 4b and Supplementary Fig. 24). Specifically, at a concentration difference of 104 (1 M | | 0.1 mM), the COF-TpPa/PAN membrane demonstrated a \({t}_{+}\) for K+ of 0.95, setting a benchmark for membrane permselectivity at such high concentration disparities (Supplementary Table 5). In contrast to the typical decrease in permselectivity observed in ionic membranes with larger concentration gradients, our results demonstrated an initial increase in permselectivity within a gradient range of 5 to 103, followed by a plateau at higher gradients. The \({t}_{+}\) values for the COF-TaBt/PAN membrane also initially increased within lower concentration gradients but declined upon reaching a gradient of 500. Meanwhile, the COF-TbPa/PAN membrane exhibited limited permselectivity across various KCl concentration gradients (Fig. 4c).

Fig. 4: Investigation of transmembrane ion behavior.
figure 4

a Schematic of the setup utilized for transmembrane ionic transport experiments. b Graphs depicting variations in \({V}_{{oc}}\) and \({I}_{{sc}}\) with various KCl concentration differences. KCl was chosen due to the similar mobilities of K+ and Cl ions. c Plots demonstrating the variation of \({t}_{+}\) with varying KCl concentration differences across the COF membranes. d Plots depicting the correlation between conductance and KCl concentration across the COF membranes. e Conceptual schematic illustrating how the membrane’s ion affinity influences its permselectivity. Error bars represent standard deviation of three different measurements.

To elucidate the variance in permselectivity among COF membranes with distinct linkages, we conducted an analysis on their conductance across a spectrum of KCl concentrations, aiming to ascertain ion concentration within their pore channels. This involved recording I–V curves with both chambers containing identical KCl solutions ranging from 0.01 mM to 3 M (Supplementary Fig. 25). By applying Ohm’s law, we could deduce ion conductance from the slopes of the linear I–V curves. Our findings revealed a decrease in ion conductance in the order of COF-TpPa/PAN > COF-TaBt/PAN > COF-TbPa/PAN (Fig. 4d). This order reflects the ion concentration within the membrane, underscoring the superior ion affinity of the COF-TpPa/PAN membrane. Further investigations showed that membrane conductance decreased progressively with increasing ion concentration, exhibiting a linear reduction after 10 mM and a sublinear decrease at lower concentrations. Contrary to the expected behavior of an electrically charged membrane, which would maintain constant conductivity at low salt concentrations due to prevailing ionic conductance from surface charges, our findings align with a variable surface charge model (Supplementary Eq.3)68. This confirms the adsorption of ions onto charge-neutral surfaces, consistent with the compositions of these membranes (Supplementary Fig. 26).

These findings reveal that the ion affinities of COF membranes significantly influence their permselectivity. The COF-TbPa/PAN membrane, which possesses weak ion adsorption sites, exhibits minimal selectivity. In contrast, the COF-TpPa/PAN and COF-TaBt/PAN membranes demonstrate concentration-dependent ionic adsorption within their pore channels, resulting in a charged surface. At lower ion concentrations, insufficient ionic adsorption produces a weak EDL, ineffective in ion screening. As the KCl concentration rises, leading to increased ion adsorption, the EDL becomes thinner, necessitating a careful balance of these effects. The COF-TpPa/PAN membrane, with its high-affinity ionic binding sites, sees enhanced ion adsorption with increased ion concentration, which reduces pore size and elevates surface charge. This strengthens the intensity and overlap of EDLs, thereby enhancing ion screening effectiveness. Conversely, the COF-TaBt/PAN membrane, possessing moderate ionic binding sites, fails to offset the decreased overlap of EDLs once the ion concentration surpasses a specific threshold. Consequently, this leads to a reduction in ion screening efficiency (Fig. 4e).

Molecular dynamics (MD) simulations

To deepen our understanding of ionic screening mechanisms, we conducted MD simulations to investigate the transmembrane behavior of KCl across COF-TpPa (Supplementary Fig. 27). The analysis of simulation trajectories unveiled a pronounced propensity for K+ ions traversing the COF-TpPa channels (Fig. 5a). Further scrutiny into the number density distribution of K+ and Cl ions along the z-direction indicated a notable increase in Cl ion accumulation within the membrane, alongside a greater translocation of K+ ions to the permeation side (Fig. 5b). Spatial analysis of the ion distribution within the xy plane of the pore channels highlighted clustering of Cl ions around the COF channel edges, forming a circular pattern (Fig. 5c). In contrast, K+ ions were more uniformly distributed within this arrangement. This pattern was corroborated by the atomic charges listed in Supplementary Table 6, indicating that the H atoms in the COF membrane have a partial positive charge, which enhances electrostatic interactions with the negatively charged Cl ions (Fig. 5c). Additionally, radial distribution function (RDF) analyzes concerning the H atoms in the COF revealed a significant clustering of Cl ions near these atoms, indicating stronger interactions between Cl ions and the COF membrane (Fig. 5d). The potential of mean force (PMF) profiles for K+ and Cl ions traversing the COF membrane revealed higher energy barriers faced by Cl ions during transmembrane migration (Fig. 5e). These findings suggest that the excellent permselectivity of the COF-TpPa/PAN membrane is attributed to robust short-range interactions between Cl ions and the membrane, thereby facilitating K+ ion transport concurrently. Furthermore, RDF analyzes of the interactions between H atoms in the COF and both K+ and Cl ions exhibited significant disparities. The COF-TpPa demonstrated the most pronounced differences in interactions between K+ and Cl ions, followed by COF-TaBt. In contrast, COF-TbPa exhibited minimal interactions with both ion types. The trajectory profiles from the MD simulations corroborated that COF-TpPa achieves the highest separation ratio of K+ to Cl ions, followed by COF-TaBt, whereas COF-TbPa shows negligible separation (Supplementary Figs. 2830). These findings are consistent with the experimental data, confirming the efficacy of COF-TpPa in ion separation.

Fig. 5: MD simulations and thermoelectric conversion.
figure 5

a Snapshots showing the transmembrane migration of K+ (in pink) and Cl (in green) ions through the COF layers (colored in blue). b Profiles of ion density along the z-axis within the COF, with orange dashed lines marking the membrane boundaries. c A two-dimensional density map that illustrates the spatial distribution of Cl and K+ ions across the xy plane of the membrane. d RDF plots for Cl and K+ ions in relation to H atoms within the COF. e PMF profiles depicting the energy landscape encountered by Cl and K+ ions during their transit through the COF membrane. f I–V curves for varying KCl concentrations under a 10 K temperature gradient; inset shows a schematic of the experimental setup. g Plots of output power density and membrane resistance as functions of KCl concentration, under a constant 10 K temperature differential. h Relationship between output power density and temperature gradient in the thermoelectric generator equipped with the COF-TpPa/PAN membrane. Error bars indicate standard deviations from three independent experiments. Error bars represent standard deviation of three different measurements.

Thermoelectric conversion

The remarkable permselectivity of the COF-TpPa/PAN membrane spurred an investigation into its potential for thermoelectric conversion, focusing on harnessing waste heat. This exploration involved the integration of an external resistor (\({R}_{L}\)) to capitalize on the power generated. The experimental arrangement involved equilibrating both sides of the membrane with KCl solutions of varying concentrations, from 0.01 M to 4 M (approaching saturation). By applying a brief heat to the side of the membrane facing the PAN substrate, detailed insights were gained. Figure 5f depicts the I–V curves obtained from the COF-TpPa/PAN membrane when subjected to a 10 K temperature differential across various KCl concentrations. Each curve demonstrated a positive current at zero bias, confirming the membrane’s permselectivity and the generation of a net diffusion current. A consistent pattern was observed across all tested conditions, revealing a decline in diffusion current with increasing \({R}_{L}\) values. Moreover, the optimal output power density was observed at \({R}_{L}\) values of 57675, 10171, 1694, 1363, 1065, and 823 Ω for KCl concentrations of 0.01 M, 0.1 M, 1 M, 2 M, 3 M, and 4 M, respectively (Supplementary Fig. 31). Given that the maximum power density coincides with the point where \({R}_{L}\) is equivalent to the membrane internal resistance, a reduction in membrane resistance with higher KCl concentrations due to improved Cl adsorption. The output power densities, calculated using the equation \(P=\frac{{{I}_{{sc}}V}_{{oc}}}{4S}\), were found to be 0.027, 0.115, 0.293, 0.399, 0.50, and 0.63 W m−2 for KCl concentrations of 0.01 M, 0.1 M, 1 M, 2 M, 3 M, and 4 M, respectively (Fig. 5g). This indicates an increased thermoelectric conversion efficiency as the KCl concentration increases. To ensure complete dissolution of KCl, we used 3 M KCl as the highest concentration for the following studies. Crucially, the power conversion of the membrane is stable, with a sustained output power density for at least 10 days, maintaining its morphology and crystallinity even after prolonged usage (Supplementary Figs. 3234). Increasing the temperature difference significantly boosted \({V}_{{oc}}\) and \({I}_{{sc}}\), thereby markedly enhancing the output power density. Raising the temperature gradient from 10 K to 50 K of the 3 M KCl solution resulted in an increase of \({V}_{{oc}}\) from 3.5 to 8.9 mV and \({I}_{{sc}}\) from 5.1 to 22.2 µA, as a result the output power density surged from 0.50 to 5.70 W m−2 (Fig. 5h and Supplementary Fig. 35).

The findings underscore the efficacy of short-range interactions in achieving exceptional permselectivity, even in high ionic concentration environments. Unlike long-range Coulombic interactions, short-range interactions are governed by relative strengths, dictating the disparate movement of ions across the membrane and potentially offering the membrane new functionalities. To validate this assertion, we explored the transmembrane mobility ratio (\({\mu }^{+}/{\mu }^{-}\)) of cations (\({\mu }^{+}\)) and anions (\({\mu }^{-}\)) across a spectrum of ionic charges and hydrated sizes, to evaluate their affinities towards the COF membrane. This investigation involved creating a tenfold concentration gradient for an electrolyte on either side of the membrane and measuring the resulting diffusion potential caused by the differing migration speeds of cations and anions. To negate any redox potential difference between electrodes, standard Ag/AgCl electrodes in saturated KCl solution, housed within a glass cell featuring a porous frit for a salt bridge, were employed. Utilizing the Goldman−Hodgkin−Katz (GHK) equation led to several noteworthy findings (Supplementary Eq. 4)69: (1) For ions with identical charges, the membrane shows a stronger attraction towards anions but preferentially allows cations to pass through. Additionally, the \({\mu }^{+}/{\mu }^{-}\) diminishes as the hydrated cation radius increases; (2) In cases where the ionic charges of cations and anions are unequal, the membrane shows a preference for adsorbing ions with a higher valent and, consequently, selectively permits the passage of counterions (Fig. 6a and Supplementary Fig. 36). This permselectivity for either cations or anions intensifies with an increasing disparity in their charge states. These experimental insights indicate that manipulating the electrolyte composition can adjust the charge polarity and density on the membrane pore surfaces, thereby exhibiting a characteristic of gatable ion transport.

Fig. 6: Effect of COF-TpPa/PAN permselectivity under various ionic conditions.
figure 6

a Graph depicting the mobility ratio of cations and anions through the COF-TpPa/PAN membrane, as calculated by the GHK equation. b I − V characteristics observed under a KCl concentration gradient (3 M | | 0.3 M). c Schematic representation illustrating the regulation of the membrane’s surface charge by selective ion adsorption, including polarity and intensity. d Plots showing the electricity delivered to an external circuit with a load resistance under a KCl concentration of 3 M.

To validate this hypothesis, we examined the permselectivity of the membrane after treatment with various ionic conditions to selectively adsorb ions and regulate the polarity and intensity of the membrane channel surface. Referring to our experimental data indicating a higher affinity of high-valent ions for the membrane, we specifically examined the changes in permselectivity following treatments with AlCl3 and K3PO4. Analysis of FT-IR spectra confirmed the presence of Al3+ and PO43− ions within the membrane, as indicated by alterations in the C = O stretching vibration and the emergence of a new peak at 1016 cm−1, attributed to P − O stretching (Supplementary Fig. 37)70. The pristine COF-TpPa/PAN membrane exhibited a \({V}_{{oc}}\) of 17.2 mV across a KCl gradient (3 M | | 0.3 M). Upon treatment with 0.5 M AlCl3, \({V}_{{oc}}\) decreased to −12.0 mV, whereas treatment with 0.5 M K3PO4 increased it to 24.0 mV (Fig. 6b). These results confirm that the charge of the membrane pore walls can be manipulated by ion adsorption, demonstrating a gateable ion transport behavior. Specifically, Al3+ adsorption renders the membrane pore channels positively charged, facilitating Cl transport due to Coulombic attraction with Al3+. Conversely, PO43− adsorption not only reduces pore size but also increases negative charge upon exposure to KCl solution, thereby enhancing permselectivity (Fig. 6c). Similar patterns were observed in the membrane treated with Mg2+ and SO42−, analogous to the effects seen with Al3+ and PO43− treatment, although the changes were more subtle (Supplementary Fig. 38). Crucially, Al3+ ions can be removed through disodium ethylenediamine tetraacetate (EDTA-2Na) chelation, while PO43− ions can be eliminated by rinsing with water, restoring the membrane’s initial functionality and demonstrating the reversibility of this process (Fig. 6b). Considering that PO43− treatment can greatly enhance membrane permselectivity, we further assessed the thermoelectric conversion efficiency of the membrane post-PO43− adsorption. When exposed to temperature differentials of 10 K and 50 K across 3 M KCl solutions, the output power densities of the thermoelectric generator, constructed using the K3PO43− treated COF-TpPa/PAN membrane reach 1.19 W m−2 and 20.22 W m−2, respectively. These figures represent a 2.4- and 3.6-fold increase compared to the untreated membrane, thus establishing a benchmark in low-grade heat conversion (Fig. 6d, Supplementary Fig. 39, and Supplementary Table 7). Moreover, the stability of interactions involving PO43− ions within the COF membrane is demonstrated by the consistent thermoelectric conversion efficiency of our thermoelectric generator assembled using the PO43− treated COF-TpPa/PAN membrane over at least four cycles (Supplementary Fig. 40).

Discussion

This study highlights the considerable potential that can be unlocked by manipulating linkages within COF membranes to enhance ionic screening via the regulation of short-range interactions between ions and membranes. These interactions, often overlooked, are highly effective in bestowing exceptional permselectivity on membranes. The charge-neutral COF-TpPa/PAN membrane showcased in this research demonstrates remarkable permselectivity under high salinity conditions, driven by temperature differentials. This finding opens up promising avenues for efficiently converting low-grade heat into electricity. Additionally, the flexibility of these short-range interactions allows for enhanced permselectivity through precise ion adsorption. Notably, membranes treated with K3PO4 displayed a significant boost in power density output, reaching 20.22 W m−2 in a 3 M KCl solution under a 50 K temperature gradient—a substantial 3.6-fold increase compared to untreated membranes. This progress marks a significant advance in low-grade energy conversion technologies. Overall, our research not only presents a method to achieve high permselectivity but also introduces a approach to effectively utilize low-grade waste heat, emphasizing the potential of COF membranes in advancing sustainable energy conversion.

Methods

Materials

This study did not produce any new unique reagents. Chemicals for monomer synthesis were purchased from Aladdin, with all compounds having a purity of over 99.5%, and were used directly without further purification unless otherwise stated. The asymmetric polyacrylonitrile (PAN) ultrafiltration membrane was obtained from Sepro Membranes Inc. (Carlsbad, CA, USA) with a molecular weight cut off of 50,000 Da.

Material synthesis

COF-TpPa/PAN

The COF-TpPa/PAN composite was prepared by interfacial polymerization, where the COF active layers were formed on the surface of a PAN support. The PAN support was positioned vertically in a homemade diffusion cell, with each cell having a volume of 7 cm3. A 3 M acetic acid aqueous solution (7 mL) containing p-phenylenediamine (Pa, 7.6 mg, 0.070 mmol) was added to one side of the diffusion cell, while a mixture of ethyl acetate and mesitylene (V/V = 1/5, 7 mL) containing triformylphloroglucinol (Tp, 9.9 mg, 0.047 mmol) was added to the other side. The reaction mixture was incubated at 35 °C for 10 days. Subsequently, the resulting membrane was sequentially rinsed with ethanol, methanol, and water to eliminate any residual monomers, catalysts, and organic solvents prior to testing.

COF-TaBt/PAN

The COF-TaBt/PAN composite was prepared by interfacial polymerization, where the COF active layers were formed on the surface of a PAN support. The PAN support was positioned vertically in a homemade diffusion cell, with each cell having a volume of 7 cm3. A 3 M acetic acid aqueous solution (7 mL) containing benzene-1,3,5-tricarbohydrazide (Bt, 18.0 mg, 0.071 mmol) was added to one side of the diffusion cell, while a mixture of ethyl acetate and mesitylene (V/V = 1/5, 7 mL) containing terephthalaldehyde (Ta, 14.0 mg, 0.11 mmol) was added to the other side. The reaction mixture was incubated at 35 °C for 10 days. Subsequently, the resulting membrane was sequentially rinsed with ethanol, methanol, and water to eliminate any residual monomers, catalysts, and organic solvents prior to testing.

COF-TbPa/PAN

The COF-TbPa/PAN composite was prepared by interfacial polymerization, where the COF active layers were formed on the surface of a PAN support. The PAN support was positioned vertically in a homemade diffusion cell, with each cell having a volume of 7 cm3. A 1 M acetic acid aqueous solution (7 mL) containing Pa (53.9 mg, 0.498 mmol) was added to one side of the diffusion cell, while a mixture of ethyl acetate and mesitylene (V/V = 1/5, 7 mL) containing 1,3,5-triformylbenzene (Tb, 26.8 mg, 0.165 mmol) was added to the other side. The reaction mixture was incubated at 35 °C for 10 days. Subsequently, the resulting membrane was sequentially rinsed with ethanol, methanol, and water to eliminate any residual monomers, catalysts, and organic solvents prior to testing.

Characterization

FT-IR spectra were obtained using a BURKER ALPHA II FTIR spectrometer. 13C (100.5 MHz) CP-MAS spectra were captured on a Varian infinity plus 400 spectrometer, utilizing a magic-angle spinning probe within a 4-mm ZrO2 rotor. N2 sorption isotherms were measured at 77 K using the BSD-660 Specific Surface Area and Pore Size Analyzer. Zeta potential investigations for surface charge distribution on the membranes were conducted. Composite membrane surface zeta potentials were measured using a SurPASS streaming potential analyzer (Anton Paar, Austria). Membrane samples were prepared in dimensions of 1 cm × 2 cm, affixed to the measurement cell with adhesive tape, and examined with 1.0 mmol L−1 KCl aqueous solution at 25.0 ± 1.0 °C, pH 6.5, collecting data over four cycles at each point. The surface zeta potential was determined using the Helmholtz–Smoluchowski equation. Scanning electron microscopy (SEM) was conducted using a Hitachi SU 8000, and a JEM-2100F was used for high-resolution transmission electron microscopy (HR-TEM). GIWAXS measurements took place at the BL14B1 beamline of the Shanghai Synchrotron Radiation Facility (SSRF) using an X-ray wavelength of 1.238 Å at an incident angle of 0.2°. Membrane samples for these measurements were prepared in 1 × 1 cm pieces. Small-angle X-ray scattering (SAXS) experiments were conducted on the XEUSS 3.0* instrument with an X-ray wavelength of 0.135 nm and a sample-to-detector distance of 100 mm.

Molecular dynamics simulations

Molecular dynamics simulations were conducted using the GROMACS 2021.7 program, with subsequent analysis performed using VMD 1.9.171,72. LJ parameters for the COF atoms were derived from the GAFF force field73, while ions were modeled using the OPLS-AA force field74. For carbon atoms on graphene, LJ potential parameters were sourced from the CHARMM27 force field75. Water was described using the SPC/E model. The structure of COFs was optimized by Gaussian 09 package76 with the implicit solvent model (SMD) by using B3LYP-D3/def2-tzvp basis set. The atomic partial charges of COF were represented by Restrained Electro Static Potential (RESP) charges by Multiwfn (Supplementary Table 6)77. The simulation system for K+ and Cl ions passing through the COF membrane was depicted in Supplementary Fig. 27, with two chambers serving as the feed and permeate sides, and the COF membrane situated in the center. The feed side was filled with a 0.25 M KCl solution comprising 28 Cl and 28 K+ ions and 5195 water molecules, while the permeate side contained water (4719 water molecules). Periodic boundary conditions were applied in the x and y directions. The membranes were assumed to be rigid, as observed in many experiments78,79, and the tortuosity of the membranes was not considered as an influencing factor on separation.

During the simulation, energy minimization was initially performed using the steepest descent method, followed by pre-equilibration for 200 ps at 300 K. Subsequently, equilibrium simulations ran for 7 ns in the canonical ensemble (NVT), with the simulation system temperature controlled at 300 K using the Nose-Hoover method. Cut-off distances were set to 1.2 nm, and the PME method was employed to calculate long-range electrostatic interactions80. Periodic boundary conditions (PBC) were imposed in two dimensions to minimize edge effects. Radial distribution functions (RDFs) between K+ or Cl ions and the nitrogen and hydrogen atoms in the frameworks were calculated from MD trajectories when these ions were trapped within the pore channel of the COF membrane. Potentials of mean force (PMFs) for ions passing through the COF membrane were determined using umbrella sampling81, with 60 windows evenly divided along the z-axis ranging from 1 nm to 4 nm for ions. A simulation run of 4.0 ns was conducted for each window, and the weight histogram analysis method (WHAM) was utilized to calculate the PMF along the Z axis82.

Electrostatic potential simulation

Density functional theory (DFT) calculations were performed at the B3LYP level using Gaussian16 software with a 6–311 G(d,p) basis set83. The molecular structure was optimized to its ground state to obtain the electrostatic potential (ESP). The search for the lowest energy configurations of a singular hexagonal macrocycle within the COF structure was conducted through the Molclus program combined with the MOPAC program84,85. Charge population and interaction analysis were carried out using Multiwfn, while visual molecular dynamics (VMD) software was employed for plotting the corresponding molecular structure72,77.