Boronic acid, which can bind chemo-selectively and reversibly to diols, could be used for the early detection of bacteria through its affinity-binding reaction with diol groups on the bacterial cell wall. Herein, we describe the use of a diol-modified fluorescent probe (DYE) conjugated to a nanosensor consisting of phenylboronic acid-functionalized fluorescent carbon dot (FCD) to allow quenching via the Förster resonance energy transfer (FRET) process. Phenylboronic acid is well-known for its preferential affinity for diol-containing molecules through cyclic ester bond formation. Therefore, in the presence of glucose-containing bacteria, the DYE in the cyclic ester form will be released from the FCD and replaced by the bacterial cell forming a new cyclic boronate ester bond with the nanoparticle, inducing recovery of the fluorescence. Quantitatively, the system's detection performance at various bacterial concentrations (101–107 CFU/mL) reached ˜100% after 60 min, indicating that the high binding affinity of the diol moeity on the peptidoglycan (sugar)-rich bacteria was enough to displace the DYE from the boronic acid-functionalized FCD platform. Our facile and tunable fluorescence switch-on system was tested for its ability to detect bacteria in water from a contaminated river. Incredibly, the system was most successful in detecting bacteria in the contaminated river water, thus proving it to be a less expensive and more robust affinity biosensor for the detection of contaminating pathogens in various chemoselective ligand-based environments.