An electric motor is a device that converts electrical energy into mechanical energy by utilizing the force received by a conductor through which a current flows in a magnetic field. Electric motors are used in many fields, from small motors to power plants in factories.
The above simulation shows the principle of a simple DC motor.
When current is applied to the coil, the direction of the current flowing in the left and right parts of the coil is opposite to each other. Therefore, the direction of the force which the coil receives is reversed and the coil rotates.
At this time, the direction of the current is changed by the commutator every half turn of the coil, so the coil continues to rotate in the same direction.