It will see biogas waste converted into hydrogen fuel, which can be used to power zero-emission vehicles.
Sewage sludge is a by-product of the wastewater treatment process - producing microbe-rich solid sewage, which can then be used as biogas fuel.
The Make Your Poo "Work For You" project has been awarded £60,000 by Innovate UK.
Biogas is produced by bacteria breaking down sewage sludge in large tanks and turning it into biosolids (compost type material) and biogas.
Welsh Water, which runs the project in collaboration with technology company Costain and local authorities in south Wales, said most of the energy will be used to produce clean energy.
It is also hoped the technology could be used to power the water company's entire fleet of vehicles with hydrogen fuel - saving around 9,000 tonnes of carbon being released into the environment.
The project will also explore demand for hydrogen vehicles, particularly for council waste collection vehicles, HGV tractors and buses.
Welsh Water's director of environment, Tony Harrington, said their renewable energy projects will help the company become a carbon-neutral business and "one which produces its own energy using renewable sources".