The human body is home to some potent chemicals. Contained within a sack the size of your hands tucked just under your diaphragm, your stomach acid helps break down your food so your small intestine can pull out the nutrients from it. It’s so corrosive that without a thick lining of protective mucus, it would burn through your stomach walls.

Scientists at the Massachusetts Institute of Technology and Brigham and Women’s Hospital got to thinking: what if they could use this acid to do other kinds of work?

In a paper published Feb. 6, a team of these researchers describes how it found a way to use stomach acid—in this case, a pig’s—to power a swallowable thermometer and transmitter for an entire week. This longer-term power source paves the way for developing tools that could help doctors more easily diagnose gut or intestinal conditions.

Normally, batteries work because of their ability to shuttle ions with a positive charge from one place to another through a solution called an electrolyte. This electrolyte has both positive and negative charged particles. The flowing positive-charged ions force negative-charged electrons to progress through an external circuit to do work, like powering a lightbulb. (Charging a device reverses the system by forcing electrons to flow through it backwards where they’re stored for later use.)

But in this case, the MIT researchers tweaked the system a little. They used zinc and copper and the animal’s own gastric acid as an electrolyte solution. They connected this power system to a swallowable transmitter within a capsule that sat in the pig’s stomach and small intestine. In some cases, the transmitter was able to check the pigs’ temperature every 12 seconds and send the information to an external device two meters (6.5 feet) away for up to a week, and didn’t seem to cause the pigs any harm.

The device didn’t work every time; in two pigs, it stopped recording because the stomach acid wore it away too much, and sometimes it passed through the pigs too quickly. (The point of the digestive tract is, of course, to push food through within a day or so.) But, the instances where it did work beyond a week show the potential to greatly improve existing technology. Camera capsules, which doctors sometimes give patients to view their gut activity, last only about a day and a half. Additionally, they use watch batteries, which can become quickly toxic if they accidentally become stuck inside the patient.