After a few beers, you can find yourself needing to rush to the toilet to relieve yourself.

But there may soon be a way to reverse this process, using urine to relieve thirst.

Researchers have created a device that uses solar energy to turn urine into drinkable water, which can then be used to brew beer.

The team recently deployed the machine at a 10-day music and theatre festival in central Ghent. Quite fittingly, the water from the festival will now be used to make one of Belgium's most coveted specialities - beer

FROM SEWER TO BREWER The device collects urine in a large tank, heating it using a solar-powered boiler. The heated urine then passes through a membrane, which separates out the water, as well as nutrients such as potassium, nitrogen and phosphorous. The nutrients collected can then be used to make fertilisers. Water collected can be used to brew beer. Advertisement

The team of scientists at Ghent University say their technique could be applied in rural areas and developing countries.

While other options for treating waste water already exist, the researchers say their new system is more energy-efficient and could be applied in areas off the electricity grid.

Dr Sebastiaan Derese, who worked on the device, said: 'We're able to recover fertilizer and drinking water from urine using just a simple process and solar energy.'

The device collects urine in a large tank, heating it using a solar-powered boiler.

The heated urine then passes through a membrane, which separates out the water, as well as nutrients such as potassium, nitrogen and phosphorous.

The nutrients collected can then be used to make fertilisers.

Using the slogan #peeforscience, the team recently deployed the machine at a 10-day music and theatre festival in central Ghent.

There, they were able to recover 1,000 litres of water from the urine of revellers.

Quite fittingly, the water from the festival will now be used to make one of Belgium's most coveted specialities - beer.

Using the slogan #peeforscience, the team recently deployed the machine at a 10-day music and theatre festival in central Ghent (stock image)

Dr Derese said: 'We call it from sewer to brewer.'

While the device could be used in sports venues or even airports to transform collected urine into water, the researchers hope that it could have longer term uses.

Dr Derese added that the team hope to take the machine to rural communities in the developing world where fertilisers and reliable drinking water are short in supply.