Swansea University will receive £36m to develop building materials which generate power, Chancellor Philip Hammond has announced.
The technology, using heat and light to make electricity, could replace conventional walls, roofs and windows.
The power could be used in homes, workplaces, schools and hospitals, with the energy stored and released by “smart energy systems”.
Mr Hammond said the aim was to cut energy bills and carbon emissions.
Excess power could be sold back to the National Grid.