Microbes used to treat human waste might also generate enough electricity to power whole sewage plants, scientists hope.
The technology is based on the relatively new science of electro-microbiology that is finding uses for the discovery that certain microbes can generate an electrical current outside their own cells.
In the context of sewage treatment, they would purify waste water by consuming the organic matter in it and use that energy to generate a current that can be harvested and stored.
Co-author of the research, published in the U.S. journal Science, Bruce Logan of Pennsylvania State University, compared the process he is developing to the movie The Matrix, where humans are hooked up to machines to provide electrical power.
"In our article we describe a process which is somewhat like that but what we do is use certain micro-organisms which can be connected to devices to generate an electrical current that can be used to generate power," Logan said.
An estimated 3 percent of the electricity generated in the United States is used to run waste water treatment plants and at least 5 percent goes into the whole water infrastructure, said Logan, adding: "That's clearly not sustainable."
Logan says the technique, still in its infancy, has sparked interest from companies including Siemens and General Electric, as well as a number of small startup firms.
There are some major hurdles, including the high cost of making the devices needed and improving their efficiency and power capacity.
"Right now it's a bit expensive," Logan said.
"What we really need to do is get the cost of the materials down and start putting the technology out into practice and that takes other things than just science and engineering. It takes political will and funding."
The same technique could see microbes used to generate biofuels, hydrogen gas, methane and other valuable chemicals from the cheap and abundant product of our trips to the bathroom, say Logan and fellow researcher Korneel Rabaey from the University of Ghent in Belgium.
(Reporting by Chris Wickham; Editing by Robin Pomeroy)