An alternator is a small electric generator that works on the same principles as power plants and other generators. When a magnetic field moves through a conductor, it produces an electric field. The direction of the motion determines the direction of the field. By moving back and forth very quickly, a generator can produce an alternating current that switches from positive to negative many times every second.
An alternator creates a current by spinning a magnet around very quickly. The magnet is on an axle, which is driven by a belt from the engine. Surrounding the magnet are three coils of wire. As the alternator moves towards a coil, it produces a powerful current. As it comes near, the field is not changing as quickly, so the current decreases. As the magnetic field moves away from the coil, it produces a negative current. The end result is a sine wave as in the picture below.
Charging the Battery and Powering the Car
The power from the alternator is run through a current rectifier. A rectifier changes alternating current (AC) into direct current (DC). It does this through an electronic one-way valve called a diode. One diode will send the positive half of the current cycle to the positive terminal of the battery, but won't let the negative cycle through. Another diode will send the negative part of the cycle to the negative terminal of the battery, but won't let the positive part through. Because there are three coils spread around the alternator, a relatively constant current flows out of it. At any point, at least one coil is producing negative power and one coil is producing positive power. The alternator produces consistent enough power to run all the electronics in the car and charge the battery.