Using a unique hydrogel, scientists in Saudi Arabia have successfully drawn water out of the dry air for growing spinach—while producing electricity from the solar panels that power it all.

The system offers a sustainable, low-cost strategy to improve food and water security for people living in dry-climate regions.

“A fraction of the world’s population still doesn’t have access to clean water or green power, and many of them live in rural areas with arid or semi-arid climate,” says Peng Wang, a professor of environmental science and engineering at the King Abdullah University of Science and Technology. “Our design makes water out of air using clean energy that would’ve been wasted and is suitable for decentralized, small-scale farms in remote places like deserts and oceanic islands.”

The system, called WEC2P, is composed of a solar photovoltaic panel placed atop a layer of hydrogel, which is mounted on top of a large metal box to condense and collect water. Wang and his team developed the hydrogel in their prior research—a material that can effectively absorb water vapor from ambient air and release the water content when heated.