Inspiration struck during one of the most critical rituals of university life: a coffee break. “We need coffee to boost our energy,” Rui Wang told Jingjing Xue, a fellow graduate student in the engineering department of the University of California, Los Angeles. Maybe, Wang suggested jokingly, we should caffeinate our experimental solar cells to make them work better, too.

Xue’s response: That might actually work.

It was a moment of “pure luck,” says U.C.L.A. engineer Yang Yang, Wang and Xue’s graduate advisor. Yang’s lab has been trying to improve the lifespan of a promising but unstable type of solar panel, made from a material called perovskite, by lacing panels with certain stabilizing compounds. “We needed some kind of molecule with lone electron pairs,” Yang says. Such isolated duos of electrons at a molecule’s edge (a feature caffeine actually has) could interact with or bind to other materials like perovskite.

The term perovskite in this case refers to any crystal with a specific kind of structure. It is often composed of cheap, common elements such as iodine, lead and bromine, and has been the darling of solar energy research for the past 10 years. “This material is considered to be a miracle,” Yang says. In the last decade, perovskite research panels have greatly improved in efficiency, going from harvesting 1 percent of available solar energy to 20 percent. And unlike silicon (the material at the heart of most commercial solar panels today), perovskite is easy to grow into active layers that generate electricity when light touches them. “A high school kid could make a good perovskite solar cell in our lab,” Yang says.

A caffeine-treated perovskite solar cell in the lab. Credit: Jingjing Xue

But this material is also notoriously finicky. Between each individual perovskite crystal in a solar cell exists a miniscule border called a “grain boundary.” “Those are the troublemakers,” Yang says. If the crystals are exposed to air, moisture and oxygen attack the boundaries and destroy the solar cell. As a result, Yang says, the solar cell “can degrade in one day.” If perovskite is to provide future solar energy, researchers will need a way to stabilize the cells for the long term.

This is where caffeine comes in. The world’s most widely used psychoactive drug just happens to have two carbon-oxygen groups that carry lone electron pairs. “That can lock onto the lead in perovskite,” Yang says. “When [the caffeine] locks onto the perovskite crystal, it stabilizes the grain boundaries and prevents the material from degrading—and the solar cell has much better stability.”

To test this idea, Yang and his students built a perovskite solar panel with caffeine added to the crystals. “For perovskite, we just buy chemicals and blend them in our lab in a beaker. It’s like cooking,” Yang says. “Then we put a little bit of caffeine into the liquid, and blend it all evenly.” Finally, the scientific baristas pour the liquid over glass to form a layer of perovskite crystal, the foundation for a thumbnail-sized solar cell.

The researchers ran a molecular analysis on that cell, and found caffeine bound to the perovskite’s lead atoms. They tested it and found it was able to run stably for over 1,300 hours—and had better efficiency than the decaf panel to boot. “It has run for several thousand hours now, and it’s still going,” Yang says. “And [the caffeine] increased the efficiency from around 16 percent to 20 percent.” The team reported the findings in Joule on Thursday.

While 20 percent is not the highest efficiency ever achieved for perovskite solar panels, the findings suggest the compound might help stabilize other perovskite systems that have reached much higher efficiencies, Yang says. Tandem or hybrid solar cells, made with two different types of perovskite, have been able to reach nearly 30 percent efficiency before any caffeine boost. “Tandem solar cells are just like a double-decker bus,” Yang says. “Anything that helps the single-layer bus can help the double-decker.”

Caffeine seems to enable perovskite crystals to form without as much “disorder” as those grown without the drug, says Joseph Berry, a physicist at the National Renewable Energy Lab in Golden, Colorado, who did not work on the study. “Generally, the perspective is, ‘If you make the material more perfect, you get one that does better.’ The caffeine, at the local level, ensures you get a material that’s a bit more well-structured,” he says. “That results in a more stable device.”

The study is impressive, says Jinsong Huang, a physicist at the University of North Carolina, Chapel Hill, who also was not involved with the work. He suggests it might push perovskite solar cells closer to commercial sale. “Stability is the last hurdle we need to overcome [for perovskite cells] to enter the market,” Huang says. “You can make solar cells more efficient and more stable in other ways. But this is a very good result, and it opens our minds about different materials that you never thought would work.”

Berry thinks the study could also help researchers figure out how to manipulate and engineer perovskite in ways that might guide future research. “Fundamentally, these perovskite materials offer a functionality that can’t be matched. We are only just beginning to understand them well enough to begin engineering them,” he says. “That’s why these results from Yang are so compelling.” Insights from the new research might help scientists discover or design new molecules that stabilize perovskite solar cells even better than caffeine does.

Then again, Berry suggests, maybe there is simply nothing better out there. “Is it the best solution? That’s hard to tell. There’s still so much more to know,” he says. “But I mean, we all love caffeine—so there’s that, too.”