A universal bacterial sensor created by integrating a light modulating aptamer complex with photoelectrochemical signal readout.