Every so often, from California to Germany, there’s news of “negative electricity prices,” a peculiar side effect of global efforts to generate clean energy. Solar farms and wind turbines produce varying amounts of power based on the vagaries of the weather. So we build electrical grids to handle only the power levels we expect in a given location. But in some cases, there’s more sun or wind than expected, and these renewable energy sources pump in more power than the grid can handle. The producers of that power then have to pay customers to use up the excess electricity; otherwise, the grid would be overloaded and fail.

As we build more and more renewable-power capacity in efforts to meet the emissions-reduction goals of the Paris climate agreement, these situations will become more common. Startups led by entrepreneurs who see this future on the horizon are now looking for ways to make money off the inevitable excess clean electricity.

On a mildly chilly day in April, with the smell of poo in the air, I met one of these startups at a sewage-water treatment plant in Copenhagen, Denmark. Electrochaea takes carbon dioxide produced during the process of cleaning wastewater, and converts it into natural gas. That alone would be impressive enough; if we want to stop global warming in its tracks, we need to do everything we can to keep CO2 from entering the atmosphere. But Electrochaea has also figured out a way to power the whole enterprise with the excess green energy produced during particularly sunny and windy days that otherwise would have gone to waste, because there would have been no way to store it.

In other words, when scaled up, Electrochaea’s process could be an answer to one of the biggest problems of the 21st century: energy storage, while also making a dent in cutting emissions.

The biggest problem with wind and solar energy is that they’re intermittent. There might be violent winds one day, and calm skies the next; broiling sunshine on Monday and 100% cloud cover on Tuesday. Some argue this problem is easily overcome by storing any excess energy in batteries until it’s needed at a later time. Further, battery advocates say, even though the bookcase-sized batteries required to store solar energy for a small home are expensive today, prices are falling and will continue to fall for some time.

Except it’s not that easy. The batteries on the market for these applications are, essentially, large versions of the lithium-ion batteries found in mobile phones. They can only store energy for a certain amount of time—weeks, at most. As soon as the charging source is removed, they start to lose the charge.

That’s not a problem if the batteries are for ironing out the peaks and troughs of daily use. The trouble is that humanity’s energy demand is skewed based on local seasons, which requires sometimes drawing on every available source, and sometimes not using much energy at all. Mumbai’s peak energy demand is during the hottest days of summer, when people run air conditioners to survive. London’s peak energy demand comes during the coldest days of winters, when people burn natural gas to heat their homes and offices.

Peak energy demand, whether for heating or cooling, can be as much as 20 times the energy consumed on an average day. Today, we shovel more coal or pump more natural gas into fossil-fuel power plants on those high-demand days. Some places, like Bridgeport in Connecticut, have old fossil-fuel plants, often coal, that they keep shut down most of the year and fire up only during peak demand. Obviously, that won’t work in a future powered by renewable energy.

There are two solutions on the table for inter-seasonal energy storage, and they both involve massive investment in infrastructure: First, you could build so many solar panel fields or so many wind turbines that you could produce much more than 20 times the power of an average day. The upshot: you’d have much more excess energy on a low-demand day, but would at least be able to fill demand on peak-demand days. The second option is to get so many batteries that they can store up enough excess energy that, even as they lose their charge, there’s still enough power to get the grid through peak-demand days.

Even if both renewable generation and storage were affordable enough for these plans—and they’re not, yet—there’s still another economic wall that might be impossible to traverse: Most of the time, your new gigantic power plant and fleet of batteries would be useless, because peak demand happens only a few times each year. No government can waste the money needed to build something with so little utility.

Beyond batteries, there are other mechanical ways to store energy. One is to pump water into elevated lakes. Another is to compress air with excess energy. Yet another is to store energy in the form of a high-speed rotating disk. But, like batteries, none of these options can store energy between seasons.

There is one option for the inter-seasonal problem called underground thermal-energy storage. It works on a simple principle: no matter the temperature above ground, at a depth of about 15 meters, temperature in most places on Earth is about the same: 10°C (or 55°F). The planet’s soil provides natural insulation, and, in theory, we could use that insulation to store energy.

There have been successful pilot projects around the world showing you can set up solar panels that, after filling the grid, use any excess electricity to heat gravel, heat-carrying chemicals, or water stored in tanks deep underground. With enough insulation, the heat could be stored for months, until it’s needed in homes nearby, and delivered to them via pipes and heat pumps. (This heat energy can also be converted to run air conditioners, where cooling is needed instead of heating.)

There are just two problems when it comes to scaling up: First, it’s expensive to build. Even if the cost of construction and management were to come down, if cities and towns haven’t already planned for underground reservoirs (and most haven’t), then it can be prohibitively exorbitant to find and secure the space. Second, the solution only works at a local scale, because transporting heat comes with natural losses. So the farther you need to move it from the storage site, the more loss you have to deal with.

If you don’t mind the smell, wastewater treatment plants are fascinating. The Copenhagen plant takes in all the water sent down toilets, bathrooms, and kitchen sinks, and puts out H2O that’s nearly clean enough to drink—just one more step would be required, the plant operator told me. But since the city has no shortage of water, the treatment plant dumps its clean, but non-potable water into the North Sea.

Before that, the water goes through dozens of steps, including one where organic matter is allowed to settled to the bottom of large, open tanks. This sludge, rich in carbon-containing molecules, is transferred to a sealed bioreactor where microbes filtered from local soil are added. If this were done in the open tanks, the microbes would break the matter down slowly to produce carbon dioxide. But, in the bioreactor, in the absence of oxygen, a different set of microbes springs into action. They produce methane—the primary component of natural gas—instead.

The facility takes the methane (and any remaining sludge that can’t be broken down) and then burns it in a biomass power plant. “We produce more energy than we consume to clean up the water coming into our plant,” says Dines Thornberg, a manager at Biofos, the part-government-owned company that operates the treatment plant.

That may be true. But the process still does pollute, since some chemical degradation happens independent of microbes and creates carbon dioxide. To help Denmark hit its Paris agreement goals, Biofos wants to cut its own carbon footprint. That’s why the company gave Electrochaea valuable space at its plant to build the pilot-scale chemical plant that completes the job that Biofos’s microbes couldn’t do: convert the carbon dioxide released in the bioreactor into methane. To achieve this amazing transformation, Electrochaea gets help from microbial life called archaea.

Archaea are the oldest of the three branches of life, which include bacteria and eukaryotes (consisting of all other more advanced organisms including humans). Their ancient survival skills include one that us humans now can put to good use: an ability to naturally take in CO2 and turn it into methane.

Most scientists believe life on Earth was formed in hydrothermal vents, created by underwater volcanoes. The temperatures there can reach 400°C (750°F), far higher than that of boiling water. But the water in the vents doesn’t boil and the gases the vents release—including carbon dioxide and hydrogen—don’t explode thanks to the tremendous pressure applied by miles of seawater above. Some archaea that live in the vents have learned to use carbon dioxide as food, combining the carbon (C) from carbon dioxide (CO2) with hydrogen (H2) to form and release methane (CH4). Humans do the reverse, consuming carbon-rich food and combining it with oxygen—both readily available on land—to make and expel carbon dioxide.

Electrochaea’s pilot plant on Biofos’s premises takes up an area the size of a tennis court. As usual for a chemical factory, there’s a tangle of stainless steel pipes with sensors and control valves. The pipes all lead to a big cylindrical bioreactor, about 10 meters (30 ft) tall, kept at 60°C (140°F) and eight times the atmospheric pressure. Through a small glass window at the bottom of the bioreactor, I can see a bubbling mixture the color of an avocado milkshake. That’s Electrochaea’s proprietary species of archaea, cultured and bred to efficiently combine carbon dioxide and hydrogen to produce methane.

The gases injected into the bioreactor come from two sources. The wastewater-treatment plant sends a mixture of carbon dioxide and methane. Meanwhile, two shipping container-sized electrolyzers use renewable electricity to split water into hydrogen and oxygen. The oxygen is sent off into the atmosphere, and the hydrogen to the Electrochaea bioreactor.

The microbes are so effective that in the time the mixture of gases travels from the bottom of the bioreactor to its top, 99 out of every 100 molecules of carbon dioxide and hydrogen are converted into methane, water, and heat. The heat is useful: it helps keep the temperature inside the reactor steady. Meanwhile, as the archaea consume the CO2 and H2, they multiply. Because they are naturally occurring species, extra archaea can be simply dumped into sewers, flushed out by the water also created in the process.

The valuable product from the reaction is methane. In fact, the stuff created through this process is even more valuable than typical methane. It’s “renewable methane” or “biomethane,” because the gas was produced from non-fossil-fuel sources and without any fossil-fuel power. This methane can be used to run boilers in homes, power plants, and even cars or buses. It’s a cleaner fuel than coal and oil, producing the fewest emissions for each unit of energy released. Methane can also be very easily stored. In fact, across Europe, there are large underground stores, connected by pipes that can safely transport the gas.

When the system runs at full capacity, the archaea produce about 50 cubic meters of natural gas per hour. For every unit of energy of electricity fed into the system, it produces about 0.75 units of energy stored in the form of methane, according to Doris Hafenbradl, Electrochaea’s chief scientist. That’s not as good as lithium-ion batteries, which can reach near 100% efficiency. But unlike the energy stored in batteries, once methane is produced it can be stored indefinitely, because it doesn’t spontaneously degrade into other chemicals. If this process could be scaled up, it could solve renewable energy’s inter-seasonal storage problem.

Electrochaea’s plant does not need to be close to solar farms or wind turbines, because excess electricity can be extracted from anywhere on the grid. The limitations on location come based on access to CO2. Water treatment plants are fair game and so are ethanol producers (such as beer and liquor factories). Exhaust gases from power plants could be used, but they will need to be cleaned to remove sulfur and particulate emissions, which could harm archaea.

The Copenhagen plant is one of three where Electrochaea has successfully installed its technology. The US National Renewable Energy Laboratory has one installation on its campus in Boulder, Colorado, and the last is part of a European Commission-funded project in Solothurn, Switzerland. Ultimately, Electrochaea’s core business model is to license the technology. The company is currently courting a Hungarian power company that wants to build a plant 10 times the size of the one in Copenhagen. It would be the startup’s biggest yet. And the carmaker Audi has shown interest in Electrochaea’s technology as a way to use biomethane in its natural-gas-powered cars.

Electrochaea is one of a growing number of players in the “power-to-gas” industry. ITM Power and Hydrogenics, for example, make electrolyzers that convert excess renewable energy into storable hydrogen. But hydrogen is not as widely used as natural gas. That’s why companies such as Electrochaea, MicrobEnergy, and ETOGas are betting that it’s worth the extra step of turning that hydrogen into methane. MicrobEnergy, as the name suggests, uses microbes for the conversion, just like Electrochaea. ETOGas, a Hitachi-supported startup, uses metal catalysts.

Doing it this way also gives these companies a potential second business model: Because these processes all involve injecting carbon dioxide into the system, it could turn out to be the case that they are hired to install their power-to-gas systems simply to reduce a facility’s CO2 emissions, whether it has an excess of renewable energy or not.

Electrochaea hasn’t secured a carbon-capture customer yet. And to be sure, its technology is carbon-capture and recycling—not storage or removal. The methane produced in the process will eventually be burned again, and that will put carbon dioxide into the atmosphere. In other words, it simply delays the production of greenhouse gases, instead of eliminating them.

That said, there is some value in delaying emissions. Every CO2 molecule not dumped in the atmosphere right now is a CO2 molecule that doesn’t absorb and retain sun’s heat. If nothing else, Electrochaea and companies like it may do their part in saving the planet simply by helping change the conversation around carbon dioxide, from treating it as a byproduct to considering it as a feedstock.

You can sign up to our newsletter for more stories on the challenges and opportunities of low-emissions technology. The reporting was supported by a fellowship from the McGraw Center for Business Journalism at the City University of New York Graduate School of Journalism.