In this study, systematic development of a portable sensor for the rapid detection ofEscherichia coli(E. coli) andExiguobacterium aurantiacum(E. aurantiacum) was reported. A conductive glass was utilized as a substrate and developed the electrode patterns on it. Trisodium citrate (TSC) and chitosan-stabilized gold nanoparticles (AuNPs) (CHI-AuNP-TSC) and chitosan-stabilized AuNPs (CHI-AuNP) were synthesized and utilized as a sensing interface. The morphology, crystallinity, optical properties, chemical structures, and surface properties of immobilized AuNPs on the sensing electrodes were investigated. The sensing performance of the fabricated sensor was evaluated by using an electrochemical method to observe the current changes in cyclic voltammetric responses. The CHI-AuNP-TSC electrode has higher sensitivity towardE. colithan CHI-AuNP with a limit of detection (LOD) of 1.07 CFU/mL. TSC in the AuNPs synthesis process played a vital role in the particle size, the interparticle spacing, the sensor’s effective surface area, and the presence of CHI around AuNPs, thus enhancing the sensing performance. Moreover, post-analysis of the fabricated sensor surface exhibited the sensor stability and the interaction between bacteria and the sensor surface. The sensing results showed a promising potential for rapid detection using a portable sensor for various water and food-borne pathogenic diseases.Supplementary InformationThe online version contains supplementary material available at 10.1186/s11671-023-03826-4.