A dynamo is an electrical generator that creates direct current using a commutator. Simply put, a device that makes direct current electric power using electromagnetism. It is basically a DC generator, i.e. an electrical machine which converts mechanical power into direct current electrical power.
Dynamo with a coil made from conducting wire which is placed between the North and the South poles of two permanent magnets. No voltage is induced when the coil is stationary. As the coil rotates, there is a change in the magnetic field which induces a voltage within the coil.
In the first half of the rotation, the left side of the coil moves from the North pole of the left magnet. In the second half of the rotation, the coil moves from the South pole of the right magnet. During these rotations, there are two polarities that is possible: positive and negative. The change between these polarities is known as alternating voltage.