A generator is an electric rotary machine that transforms mechanical energy into electrical energy.
It achieves this thanks to the interaction of the two main elements that make it up: the moving part called the rotor, and the static part called the stator. When an electric generator is in operation, one of the two parts generates a magnetic flux (acts as inductor) for the other to transform it into electricity (acts as induced). Electric generators differ according to the type of current they produce. Thus, we find two large groups of rotary electric machines: the alternators and the dynamos.
Alternators generate electricity in alternating current. The inductor element is the rotor and the inductor is the stator. Generators of power plants, which transform mechanical energy into electrical energy
The dynamos generate electricity in current with direct current. The inductor element is the stator and the inductor is the rotor. An example would be found in the light that has a bicycle, which works through pedaling.