I came across this page that displays the basics of electric motors and generators are explained using animations and schematics. This is a resource page from Physclips, a multi-level multimedia introduction to physics. For example, a DC motor is explained:
A simple DC motor has a coil of wire that can rotate in a magnetic field. The current in the coil is supplied via two brushes that make moving contact with a split ring. The coil lies in a steady magnetic field. The forces exerted on the current-carrying wires create a torque on the coil.
The force F on a wire of length L carrying a current i in a magnetic field B is iLB times the sine of the angle between B and i, which would be 90° if the field were uniformly vertical. The direction of F comes from the right hand rule*, as shown here. The two forces shown here are equal and opposite, but they are displaced vertically, so they exert a torque. (The forces on the other two sides of the coil act along the same line and so exert no torque.)
* A number of different nmemonics are used to remember the direction of the force. Some use the right hand, some the left. For students who know vector multiplication, it is easy to use the Lorentz force directly: F = q v X B , whence F = i dL X B . That is the origin of the diagram shown here.
The coil can also be considered as a magnetic dipole, or a little electromagnet, as indicated by the arrow SN: curl the fingers of your right hand in the direction of the current, and your thumb is the North pole. In the sketch at right, the electromagnet formed by the coil of the rotor is represented as a permanent magnet, and the same torque (North attracts South) is seen to be that acting to align the central magnet.
Note the effect of the brushes on the split ring. When the plane of the rotating coil reaches horizontal, the brushes will break contact (not much is lost, because this is the point of zero torque anyway – the forces act inwards). The angular momentum of the coil carries it past this break point and the current then flows in the opposite direction, which reverses the magnetic dipole. So, after passing the break point, the rotor continues to turn anticlockwise and starts to align in the opposite direction. In the following text, I shall largely use the ‘torque on a magnet’ picture, but be aware that the use of brushes or of AC current can cause the poles of the electromagnet in question to swap position when the current changes direction.
The torque generated over a cycle varies with the vertical separation of the two forces. It therefore depends on the sine of the angle between the axis of the coil and field. However, because of the split ring, it is always in the same sense. The animation below shows its variation in time, and you can stop it at any stage and check the direction by applying the right hand rule.
It’s a pretty neat resource giving a simplistic rendering of how things work.
What's Happening Recommended by Hashcore