Image copyright Wenbin Wang Image caption How a combined solar panel and water purifier might look

Researchers have found a way to purify water and produce electricity from a single device powered by sunlight.

The scientists adapted a solar panel that not only generated power, but used some of the heat energy to distil and purify sea water.

They believe the idea could make a major difference in sunny climates with limited water supplies.

The lead author expects that a commercial device could be available in five years.

Clean energy and clean water are among the major challenges for sustainable development especially in emerging countries. But traditional approaches to electricity generation consume huge amounts of water. In the US and Europe about 50% of water withdrawals are for energy production.

Similarly, producing water for humans via desalination in countries with water scarcity is a huge consumer of energy. It's estimated that in Arab countries around 15% of electricity production is used to produce drinking water.

Now, researchers believe they have found a way to combine these actions in a single device.

Image copyright Getty Images Image caption Desalination plants have grown in popularity in recent years but they are heavy users of energy

Existing state-of-the-art solar panels face physical limits on the amount of sunlight they can actually turn into electricity. Normally about 10-20% of the sun that hits the panel becomes power. The rest of this heat is considered as waste.

In this experiment, the scientists designed a three stage membrane distillation unit and attached it to the back of the photovoltaic (PV) panel.

The membrane essentially evaporates seawater at relatively low temperatures. The researchers were able to produce three times more water than conventional solar stills while also generating electricity with an efficiency greater than 11%. This meant the device was generating nine times more power than had been achieved in previously published research.

"The waste heat from PV panels has really been ignored, no one has thought about it as a resource," said lead author Prof Peng Wang from King Abdullah University of Science and Technology in Saudi Arabia.

"We use the heat to generate water vapour that gets transported across the membrane and then it condenses on the other side."

Image copyright Getty Images Image caption There is a growing trend towards installing solar panels on bodies of water

"Because it is a multiple stage distillation device, it also allows the latent heat in the condensation to be utilised to drive the second cycle of water evaporation. So that is why we can get a very high fresh water production rate by this device."

According to the authors if the technology was scaled up and used globally, it could, in theory, produce 10% of the total amount of drinking water consumed in 2017.

However there are many tricky steps to go through to develop and commercialise this type of device. There are some inherent drawbacks in that it needs a large area of land to collect enough solar light to be effective at producing water.

"It can be used for coastal areas as long as you are not talking about delivering drinking water for a city of over one million people," said Prof Wang.

"It is a suitable technology to deliver drinking water at the small to medium scale," he explained.

The study has been published in the journal Nature Communications.

Follow Matt on Twitter @mattmcgrathbbc.