The are an increasing number of medical devices that treat us by going in through the mouth (think bariatric balloon or esophageal stents) - but the process of getting them out again can be a lot more painful then putting them in.

New research offers an alternative – devices that can break down in your stomach after you've swallowed a pill of light.

Yes, you read that right. The idea is that when medical devices inserted into the gastrointestinal tract reach the end of their life they could start to break down once they come into contact with certain kinds of light. They would then be processed through the body like any other kind of waste.

Thanks to newly developed light-sensitive hydrogel, devices could be easily removed if they weren't working or after the course of treatment had finished – all patients would have to do is take a glowing LED pill that would trigger the dissolving process in the gut.

"We are developing a set of systems that can reside in the gastrointestinal tract, and as part of that, we're looking to develop different ways in which we can trigger the disassembly of devices in the GI tract without the requirement for a major procedure," says gastroenterologist Giovanni Traverso, from MIT.

The researchers tested their hydrogel in pig guts, finding that a bariatric balloon (often used to reduce appetite and treat obesity) based on the gel could be dissolved in as little as 30 minutes using an LED. These balloons are typically deflated via surgery and then removed via the mouth.

To make their device material, the researchers started with a light-sensitive polymer that includes a chemical bond that breaks when exposed to certain wavelengths of light. That was linked with stronger materials including polyacrylamide.

The end result is something that's durable enough to last in the gut and yet still break down when exposed to light. By changing the mix of the hydrogel material, the researchers are able to vary the time it takes to break down.

The bariatric balloon developed by the researchers. (Ritu Raman)

"You're forming one polymer network and then forming another polymer network around it, so it's really entangled," says mechanical engineer Ritu Raman, from MIT. "That makes it very tough and stretchy."

As well as being much more convenient, quicker and less painful than surgery, swallowing an LED is a very effective way of targeting ingestible devices – no light makes it down to the gastrointestinal tract naturally, so the LED doesn't have to actually make contact with the device to start doing its work.

Different colours of light affect the degradation speed as well – ultraviolet light works faster than blue light, for example, but also carries a higher risk of causing damage to the cells in the body. All these factors will need to be tested in future research.

In the meantime, the technique shows a lot of future potential for a better way of removing devices from the body, from bariatric balloons to esophageal stents that can be used to help treat some types of cancer.

"We're really looking at different triggers and how they perform, and whether we can apply them to different settings," says Traverso.

"This study is a proof of concept that we can create this kind of material, and now we're thinking about what are the best applications for it."

The research has been published in Science Advances.