Abstract
The widespread presence of cefixime (CFX) in the environment has raised concerns about potential risks to ecosystems and human health, including bronchitis, tonsillitis, and laryngitis. Therefore, developing an accurate and convenient on-site analysis device for CFX is crucial. Herein, a dual-mode fluorescence–spectrophotometric platform with smartphone and test-strip readouts was designed to detect CFX. A microwave method was demonstrated for synthesizing N-doped fluorescent Carbon dots (N-CDs) by using onion juice as a precursor, with optimization achieved through Box-Behnken Design (BBD). XPS, HRTEM, XRD, FTIR, TRF, UV-Vis spectrophotometry, and fluorescence were used to investigate the N-CDs structure and optical properties. N-CDs displayed satisfactory optical properties, an extraordinary quantum yield of 72.4%, an average particle size of 6.12 ± 0.5 nm, excellent water solubility, high ionic strength, and outstanding pH stability. The limits of detection (LOD) for the fluorescence, spectrophotometric, smartphone, and test strip were 5.16 nM, 138.08 nM, 0.56 µM, and 0.65 µM, respectively. Detection operates via a synergistic quenching mechanism (inner-filter effect plus dynamic quenching). In real samples (honey and tap water), recoveries of 94.21–108.83% with RSD ≤ 1.87% confirmed the accuracy of quantification. This developed platform provides a reliable, environmentally friendly, and efficient platform for on-site CFX monitoring in environmental applications. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1038/s41598-025-31426-y.