Nitrite plays a critical role in a variety of nitrification and denitrification processes in the nitrogen cycle. Due to the high surface energy, tendency to aggregate, and poor conductivity, current nitrite ZnS-based sensing platform could not meet the need of on-site nitrite detection in smart agriculture. In order to address these issues, the carboxylated carbon nanotube (CNT) was introduced to reduce the surface energy and prevented aggregation of ZnS, while ZnS-carboxylated CNT (ZnS-CNT) composite also provided excellent electrochemical conductivity. Furthermore, the introduction of phase transition BSA (PTB) created a three-dimensional porous conductive matrix without interfering with the mass transfer process of nitrite. The resulting sensing platform exhibited a linear detection range of 10 nM to 0.4 mM for nitrite, with a detection limit of 0.73 nM. And this sensing platform had the excellent antifouling ability to direct detection nitrite in real soil suspension. In addition, the sensing platform demonstrated remarkable resistance to interferences from pH variations, microbial presence, and organic pollutants that usually present in soil environment. Therefore, on-site detection of nitrite ions in soil environment was realized no needing complex pretreatments.