An electric motor converts electrical energy into mechanical energy, usually as rotational motion. There are two types of electric motors based on the type of current they use, the coil design, and the magnetic field created.
The DC motor works by direct current flowing to the commutator, which is connected to the electromagnets. The electromagnets rotate as the polarity changes due to the current and are surrounded by permanent magnets.
DC motors are of two types: brushed motor and brushless motor.
Brushed motors have brushes that are connected to the current. These brushes stay in contact with the rotating part (armature).
In brushless motors, a sensor is needed to determine the orientation of the rotating motor poles. It also needs a driver to supply current.