A device that converts mechanical energy into electrical energy, often using an engine or turbine.