One day, rooftop solar panels could pull double-duty: harvesting energy from the Sun while also cooling the house below. Scientists have created a device that combines two technologies to do exactly that. And while it’s an early prototype, it’s a promising step toward solving the world’s many energy needs.

Most people are familiar with the concept of solar harvesting, or absorbing energy from the Sun and converting it into power. There is also a reverse process called radiative cooling, which happens when heat escapes back into the Universe.

All objects lose heat in the form of infrared radiation, which is invisible to the human eye. The atmosphere usually reflects this heat back, but a certain infrared wavelength can escape into space instead of heading back toward us. This means that materials that emit this wavelength become cooler than the temperature of the surrounding air. In nature, this is why frost forms even when it’s not freezing. In the world of engineering, scientists hope this method can one day be used to cool buildings without creating the harmful greenhouse gases caused by air conditioning.

The findings are a promising solution to the growing demand for air conditioning as temperatures rise worldwide

In a paper published recently in the journal Joule, scientists created a two-part device that’s a solar harvester on top and radiative cooler on the bottom. The tricky part was maintaining an object that is hot and cold at the same time, so they built a vacuum chamber that surrounds the radiative cooler to make sure the two don’t get crossed. “The bottom panel can radiate its heat out without being impeded by the top panel,” says Shanhui Fan, a professor of engineering at Stanford University and an author of the study. “And that allows the bottom panel to drop to a temperature substantially below ambient.”

The solar part of the device can be heated up to 42 degrees Fahrenheit above the normal temperature, while the cooler part can reach 54 degrees Fahrenheit below the ambient temperature. Those numbers are impressive, and the findings are a promising solution to the growing demand for air conditioning as temperatures rise worldwide.

Still, the device is small and would be hard to scale up, as many of the materials are very expensive. Fan notes that the goal isn’t necessarily to commercialize and sell this exact device. Instead, the goal is to figure out how to make solar cells more efficient so it’s easier for the two technologies to share roof space.