• The dual-functionalized Nb2CTx/SnS2 composite with amine and carboxyl groups enables highly selective and stable room-temperature NH3 detection.
• The sensor achieves a low detection threshold of 10 ppm with rapid response (32 s) and recovery (78 s) at 100 ppm NH3 under ambient conditions.
• Incorporation of amine and carboxyl groups enhances structural integrity and selectivity under harsh conditions, including high humidity, temperature fluctuations, and interfering gases.
• The sensor shows exceptional selectivity for NH3 against formaldehyde, acetone, ethanol, trimethylamine, and CO2, supporting real-world environmental monitoring and medical diagnosis.