Farts are a natural, healthy byproduct of your digestive system, and everyone has them from time to time, but as funny as flatulence is, how, when and why gas forms in you can reveal a lot about your body’s inner workings. Now, researchers from RMIT University and Monash University have published a new paper revealing the invention of an electronic fart tracker that you can swallow like a pill. Isn’t the future great?

The scientists developed the pill — which was created as a more versatile and comfortable alternative to sticking a tube where the sun don’t shine — to be able to detect and track the production of gasses in a human digestive tract. The idea being that if science can pinpoint where and why gas is forming it could paint a more detailed picture of how our organs process foods, and even detect issues with certain diets. The research was published in Nature Electronics.

After first testing prototypes of their gas-detecting pills in pigs (whose digestive system is a lot like that of a human), the researchers pushed on with a pilot program using human volunteers. The pill itself about the size of a large fish oil capsule or vitamin, and contains a wireless transmitter, antennas, batteries, and a gas sensor that detects whatever gasses pass through the membrane casing.

For their tests, the scientists asked volunteers to swallow the pill while maintaining a specific diet that varied from test to test. High fiber prompted a spike in oxygen levels in the colon and abdominal pain in the volunteer, and followup testing of the subject’s feces revealed bacteria that have been previously linked to unhealthy digestion. By contrast, an extremely low-fiber diet resulted in the pill remaining in the subject’s body for over three full days (compared to 23 hours in the high-fiber test) and the gas levels were starkly different.

The research is still ongoing, but the team has already set up a company in the hopes of commercializing the invention. Modern medicine already leans so heavily on technology that it’s not hard to imagine tiny swallowable gadgets becoming commonplace, but that may still be many years out.