Scientists have created a device that can generate electricity by using the power of the cold night sky.