Researchers have devised a new way to get a sneak peek into what’s going on deep in your digestive system, creating a swallowable sensor that, with the help of engineered bacteria and a tiny electrical circuit, can detect the presence of molecules that might be signs of disease and then beam the results to a smartphone app.

The device, which scientists validated in pigs, remains a prototype and needs to be refined before it could be used in people. But the researchers, who reported their work Thursday in the journal Science, combined innovations in synthetic biology and microelectronics to create a modular platform that could be adapted to identify a wide range of molecules.

“We want to try to illuminate and provide understanding into areas that are not easily accessible,” said Dr. Timothy Lu, a bioengineer at the Massachusetts Institute of Technology and senior author of the paper.

The GI tract houses a myriad of metabolites that scientists hope could shed light on what happens in the dark of the digestive system. These molecules could provide clues to when the system gets out of whack, for example, or perhaps open a new way to diagnose disease. But experts lack the tools to probe deep inside, particularly in the parts of the system that are beyond the reach of tools like scopes.

“A lot of important biology and health-related pathways are happening there, and we don’t have really good technologies to see inside the gut and measure chemicals there,” said Jeff Tabor, a bioengineer at Rice University, who was not involved in the study.

Researchers have been experimenting with engineering bacteria so that they are triggered in some way in the presence of their targeted molecules. But if the bacteria are deployed into the GI tract, they typically can’t signal to people outside what they’ve encountered. It would be like discovering the lost city of Atlantis only to realize you don’t have a way to tell anyone what you found or where you found it.

“Getting the data back out is a challenge, so having a convenient, really practical strategy for having the bacteria tell us what they see is important,” Tabor said about the new sensor system. “I think this is a really nice solution for that problem.”

The new tool—which the research team has dubbed an ingestible micro-bio-electronic device, or IMBED—tucks the engineered bacteria into wells that are covered by a semipermeable membrane, keeping the bacterial cells inside but welcoming metabolites.

If the molecules of choice filter in and meet the bacteria, the bacterial cells produce light that is picked up by photodetectors embedded in a small electrical chip. The electrical system can then shoot the signal out to a smartphone app, like a prospector screaming upon striking oil.

The device described in the paper is about 10 millimeters by 30 millimeters—about the length of two dimes next to each other—and the researchers, who have filed for a patent on the technology, said they hope to shrink it to about a third of its size for use in people. Experts noted that pills carrying cameras or monitoring temperatures are already in use, so this approach is not that sci-fi.

“This has the potential to unlock a wealth of information about the body’s structure and function, its relationship with the environment, and the impact of disease and therapeutic interventions,” Peter Gibson and Rebecca Burgell of Monash University in Australia wrote in an editorial accompanying the study.

As a proof of concept, the researchers showed the system could detect the molecule heme in the GI tracts of pigs in a model of GI bleeding. Within two hours of being deployed, the device was able to distinguish between pigs with modeled GI bleeding and a control group, with 100 percent accuracy.

The researchers envision tweaking the bacteria so they can recognize a range of metabolites. The device also has four wells, each with room for about a million bacterial cells, so it might be possible to put different bacterial biosensors in each well to detect different molecules.

“We could evolve these living systems to conceivably sense any biological marker,” said Mark Mimee, a graduate student at MIT and lead author of the study.

Researchers not involved with the work identified several improvements that are needed for the biosensor to be clinically useful. First, doctors need to be able to track the device so they can tell where exactly in the gut it is when it detects its targeted molecules. The sensor also needs to be able to pick up on the metabolites rapidly so it can send out its signal before it gets shuttled along to another part of the GI tract.

Gibson and Burgell, as well as Tabor, also pointed to another challenge: Scientists haven’t nailed down exactly what biomarkers they should be looking for as signposts for different diseases. So beyond honing this 21st century technology, researchers still need to unlock a greater understanding of our much older biology.

Republished with permission from STAT. This article originally appeared on May 24, 2018