Real-time chemical sensing is crucial for applications in environmental and health monitoring1. Biosensors can detect a variety of molecules through genetic circuits that use these chemicals to trigger the synthesis of a coloured protein, thereby producing an optical signal2-4. However, the process of protein expression limits the speed of this sensing to approximately half an hour, and optical signals are often difficult to detect in situ5-8. Here we combine synthetic biology and materials engineering to develop biosensors that produce electrical readouts and have detection times of minutes. We programmed Escherichia coli to produce an electrical current in response to specific chemicals using a modular, eight-component, synthetic electron transport chain. As designed, this strain produced current following exposure to thiosulfate, an anion that causes microbial blooms, within 2 min. This amperometric sensor was then modified to detect an endocrine disruptor. The incorporation of a protein switch into the synthetic pathway and encapsulation of the bacteria with conductive nanomaterials enabled the detection of the endocrine disruptor in urban waterway samples within 3 min. Our results provide design rules to sense various chemicals with mass-transport-limited detection times and a new platform for miniature, low-power bioelectronic sensors that safeguard ecological and human health.