Rui Wei, Yanbiao Liu, Changyong Zhang, Peng Xu, Nanqi Ren, Shijie You
Ammonium-containing wastewater represents both an environmental burden and a recoverable nitrogen resource. Here we develop an electrochromic self-perception recovery (ECSPR) system that integrates selective intercalation, intrinsic electrochromism and data-driven control for recovering ammonium to produce value-added fertilizer in a smart manner. The system employs a copper hexacyanoferrate (CuHCF) electrode capable of selective NH4+ intercalation (selectivity coefficient of 5-38 versus other cations) with high capacity (2.2-2.7 mmol g-1). Fe-dominated redox conversion with secondary Cu valence modulation couples charge transfer with reversible color switching, enabling visible self-perception of adsorption-desorption states. Image recognition and machine learning convert electrode images into quantitative adsorption states, which are used as the decision variable to schedule adsorption-desorption and route flows in real time. In continuous-flow operation with actual swine wastewater, the ECSPR system achieves cumulative recovery efficiency of 90.2% over 10 cycles with self-feedback regulation at energy consumption of 4.9 kWh kg-1 N on average. Liquid ammonium sulfate fertilizer is produced directly with comparable agronomic performance to commercial products. Life-cycle and techno-economic analyses further indicate environmental benefits and economic feasibility. Overall, this study provides an intelligent strategy for ammonium recovery and fertilizer production from wastewater, making wastewater treatment more economical and more sustainable.