This invention demonstrates thin-film devices made from electrically conductive protein nanowires (e-PNs) that can generate continuous electric power in ambient environment driven by the self-maintained moisture gradient that forms within the film when exposed to the humidity naturally present in the air. The devices can produce substantial voltages at relative humidity as low as 20%.