A commutator is a moving part of a rotary electrical switch in certain types of electric motors and electrical generators that periodically reverses the current direction between the rotor and the external circuit. It consists of a cylinder composed of multiple metal contact segments on the rotating armature of the machine. Two or more electrical contacts called "brushes" made of a soft conductive material like carbon press against the commutator, making sliding contact with successive segments of the commutator as it rotates. The windings (coils of wire) on the armature are connected to the commutator segments.
Commutators are used in direct current (DC) machines: dynamos (DC generators) and many DC motors as well as universal motors. In a motor the commutator applies electric current to the windings. By reversing the current direction in the rotating windings each half turn, a steady rotating force (torque) is produced. In a generator the commutator picks off the current generated in the windings, reversing the direction of the current with each half turn, serving as a mechanical rectifier to convert the alternating current from the windings to unidirectional direct current in the external load circuit. The first direct current commutator-type machine, the dynamo, was built by Hippolyte Pixii in 1832, based on a suggestion by André-Marie Ampère.