A generator is a mechanical device that converts kinetic energy into electricity. There are two major kinds of generators, the dynamo and the alternator. The dynamo produces direct current whereas the alternator produces alternating current.