A generator is a device that transforms mechanical energy into electrical energy, typically by electromagnetic induction via Faraday’s Law. For example, a generator might consist of a gasoline engine ...A generator is a device that transforms mechanical energy into electrical energy, typically by electromagnetic induction via Faraday’s Law. For example, a generator might consist of a gasoline engine that turns a crankshaft to which is attached a system of coils and/or magnets. This rotation changes the relative orientations of the coils with respect to the magnetic field in a time-varying manner, resulting in a time-varying magnetic flux and subsequently induced electric potential.