A new high-tech pill could diagnose your digestive issues through your farts. Well, more like your pre-farts. The new smart pill developed by researchers at RMIT University in Australia can send data on the types of gases in your gut straight to a smartphone.  

The smart capsule contains a sensor to detect hydrogen, methane, and carbon dioxide, as well as a wireless transmitter and a battery. It’s bigger than many pills—but not any more so than a large vitamin—and can be swallowed safely. It sends out data to a phone every 5 minutes, and in tests, can transmit information for up to 25 hours. After it moves through the digestive system and leaves the body—which takes 24 to 48 hours, depending on what has been eaten—it can be flushed down the toilet. 

In the first animal trials with the new tech, described in a recent proof-of-concept paper in the journal Gastroenterology, researchers studied how levels of dietary fiber can change the makeup of gases in the digestive system in pigs. The smart pill can identify where in the digestive system gases are produced, giving scientists a better understanding of the digestive microbiome and the bacteria that produce gases as a byproduct of digestion.

They found that the pills could identify different concentrations of gases in the large and small intestines. High-fiber diets produced more methane in the large intestine, while low-fiber diets produced more hydrogen in the small intestine. Knowing the concentration of gases produced by certain diets and where those gases build up could help create better diets to treat irritable bowel syndrome, for one, as well as give us a better picture of how different diets interact with the microbes in our gut. 

It’s very hard to study the composition of farts, because there’s no good way to capture them. Scientists have tried to capture cow farts via special backpacks, but the gas-collecting mechanism requires inserting a tube into the animal’s digestive system under the skin. Because you can’t exactly do that to a human patient, studying flatulence in people requires sticking catheters up people’s butts—obviously not the most natural or comfortable process. And so, as silly as it may sound to swallow a fart-sensing pill, it’s actually a pretty good advance from the alternatives.