A genetically engineered bacterium is generated to create a biosensor (Panel A). The bacterium is capable of detecting a signal, in this case heme. The signal induces transcription of a genetic locus that encodes a luminescent protein. This portion of the system is essentially modular and can be engineered to sense a variety of individual signals and to produce a luminescent signal. Specifically, chuA encodes a membrane protein that allows heme to be trafficked into the bioengineered E. coli. Heme then inhibits the transcriptional repressor protein HrtR, which results in the derepression, or turning on, of the luxCDABE operon. The luxAB portion of the operon encodes the luciferase reporter gene, and the luxDEC portion of the operon encodes a fatty acid reductase complex. A simplified cross section of the ingestible micro-bio-electronic device (IMBED), which is approximately 3.5 cm in length, is shown (Panel B). The device consists of a chamber in which the bacteria are placed. The chamber has a semipermeable membrane that allows entry of small-molecule signals. When heme comes in contact with the bacteria, the bacteria generate light, which is detected by the photodetector. The light signals are converted into a digital code, which is then transmitted and detected wirelessly, in real time, by an external device, in this case an Android cell phone with a customized application for data analysis (Panel C).