We’ve seen breweries turn wastewater into drinkable beer but now scientists have turned one brewery’s dirty wastewater into energy.

Engineers at University of Colorado Boulder have created an eco-friendly way to re-use the dirty water that results as a byproduct of brewing beer by converting it into an organic material that can be used to power batteries.

“This could be game-changing,” CU researcher and engineer Justin Whiteley told FOX 31. “We’re looking to replace the unsustainable materials that are in our batteries right now--mainly being graphite. Graphite is mined in the ground, mostly in China.”

Whiteley and his research partner Tyler Huggins teamed up with Boulder’s Avery Brewing to use the beermaker’s wastewater to improve the cultivation of chemicals used in making lithium-ion battery components.

“Within this wastewater, we have things like nutrients, and energy that can be extracted from it,” Huggins told FOX 31.

The team then added a fungus--Neurospora crassa-- which grows quickly feeding off the sugar-rich beer wastewater. Once the fungus grew into a large enough mass, they dried it out, then baked it.

“Out pops this carbon, and that goes right into the battery, that will be one-half of your lithium-ion battery,” said Whiteley.

The engineers say this new material is not only more sustainable than traditional battery materials that have to be mined but less expensive to create—plus the fungus cleans the brewery’s wastewater. Currently, all breweries must thoroughly filter their wastewater before it can be pumped back into cities’ municipal systems—a time intensive and expensive process. It takes about seven barrels of water to produce one barrel of beer, according to the scientists, so there’s plenty of waste left over to use.

“Right now we call it wastewater and we put a ton of energy into cleaning it. But what we want to do in the future and as environmental engineers, we hope to extract value from the process,” said Huggins.

The two researchers have filed a patent on the process and are now exploring how to apply using the technology in other areas, like water and gas filtration. They’re also working with Avery Brewing to launch a larger beer wastewater energy recycling program.

Details of the Colorado researchers’ study can be found in the American Chemical Society journal Applied Materials & Interfaces.

More from FOX 31.