what do you call the device that converts mechanical movement into electricity