I hate to say it, but doctors have something of a flatulence problem: at the moment, they know embarrassingly little about the bubbles brewing in your bowels.

“What comes out of the backside only tells us about the last 20cm of the gut,” says Peter Gibson at Monash University in Victoria, Australia. Gibson wants to know what’s happening in the previous 130cm of the digestive tract, leading up to that final explosion.

Digestion depends on the subtle interactions between your genes, diet, metabolism, and the myriad micro-organisms inhabiting your body, each of which may leave its signature in gaseous by-products. A noticeable change in your farts’ peculiar recipe might therefore be a sign of serious diseases affecting any part of that process.

 “We know bits and pieces about it, but it’s been very difficult to get to the crux of what is happening,” Gibson says. To this end, his team are working on a probe that would work its way through your gut, measuring your gas at every stage of digestion.

The precious little we know so far would certainly indicate that flatulence is a rich topic for investigation. Excess production of hydrogen and methane seems to suggest there may be a problem with the way your gut is absorbing carbohydrates, for instance – allowing the starches and sugars to instead ferment in the gut. Excess methane may also interrupt your bowel movements, meaning that it could be a cause of constipation for people with irritable bowel syndrome. Unfortunately, we can’t be certain exactly where that methane arises. “The dogma is that it is produced in the lower parts of the large bowel, but we don’t know,” Gibson says.

Hydrogen sulphide, meanwhile, is the chemical that gives our farts that full-bodied odour of rotten eggs. Besides the discomfort it may cause in confined spaces, chronically high levels of the gas may be the sign of a damaged gut lining, inflammatory bowel disease or even colon cancer. “It’s one example of a gas that could be incredibly instructive,” says Gibson.

Strangely enough, the most popular method to measure flatulence has been a breath test

Until now, current techniques to measure flatulence are somewhat indirect. Strangely enough, the most popular option to date has been a breath test. Since some gases will be absorbed by the blood and released in your lungs, it is possible to find traces of your flatulence coming out of your mouth. Unfortunately, that can’t tell you where the gases originated. In any case, the reading might be skewed by other elements of body odour, such as the gases brewed by bacteria between your teeth. Another option is to ferment faecal samples – the gases produced should resemble your own flatulence, although again, it can’t reveal the problems in the early stages of digestion.

Gibson’s team think they have the answer with a tiny sensor that can be swallowed like a medical pill. As it passes through the body, the capsule samples the gases at regular intervals and relays them to a tablet computer; it will also measure things like the ambient temperature and acidity, which can provide further information about its position in the gut. This is particularly important at the end of its voyage. “You want to know if it’s passed out of the backside, but you wouldn’t know because it’s just part of the stool” says Gibson. The temperature sensor, however, could offer an instant warning. “When the temperature falls, that’s when it’s gone outside.”

In this way, a doctor can collect real-time data at each stage of the pill’s journey. So far, the team have tested an early prototype on a couple of pigs, and they hope to begin human trials within the next few months.

Once the sensor has proven itself to be safe and effective, he plans to build up a library profiling the gases associated with different diseases and lifestyles. From there, it may be possible to see the direct effects of different treatments for some of the related ailments.

Since methane is thought to be linked to constipation Gibson hopes to understand where and when it is produced. “What you’d like is something that reduces methanogenesis – a simple dietary change or drug that improves constipation, which is a major problem across the world,” he says. “But we can’t know until we measure it.”

Gibson certainly can’t be faulted for his enthusiasm on this subject. “It’s very exciting – the more we get into [the subject] the more we see the potential,” he says. Let’s just hope his probe delivers on that promise, and that the excitement doesn’t just turn out to be a load of hot air.

--

David Robson is BBC Future’s feature writer. He is @d_a_robson on twitter. Olivia Howitt is BBC Future’s picture editor. She is @oliviahowitt on Twitter.

Join 500,000+ Future fans by liking us on Facebook, or follow us on Twitter, Google+, LinkedIn and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.