Each prototype was required to run on around five cents (3p) a day, and ideally generate energy. One design used microwave power to turn human waste into electricity, while another used urine for flushing.

A team from the California Institute of Technology led by professor Michael Hoffman came up with the winning design, a solar-powered loo that produces hydrogen gas and electricity. The group won a $100,000 prize.

The Gates foundation held the event with the long-term goal of improving sanitation in the developing world, where diarrhoeal disease is responsible for the deaths of around 1.5 million children.

"We couldn't be happier with the response that we've gotten," Bill said. "If we do it right, there's every possibility that some of these designs would also be solutions for rich and middle-income countries."

Another noteworthy design on show used black soldier fly larvae to turn waste into animal feed. This model, designed by Walter Gibson and his team from the London School of Hygiene and Tropical Medicine, is already being field tested in South Africa.

The Gates Foundation has invested $370m (£235m) into toilet technology and hopes to have a working prototype ready within three years.