The working principle of an alternator or AC generator is similar to the basic working principle of a DC generator.
Below figure helps you understanding how an alternator or AC generator works. According to theFaraday's law of electromagnetic induction, whenever a conductor moves in a magnetic field EMF gets induced across the conductor. If the close path is provided to the conductor, induced emf causes current to flow in the circuit.Now, see the above figure. Let the conductor coil ABCD is placed in a magnetic field. The direction of magnetic flux will be form N pole to S pole. The coil is connected to slip rings, and the load is connected through brushes resting on the slip rings.Now, consider the case 1 from above figure. The coil is rotating clockwise, in this case the direction of induced current can be given by Fleming's right hand rule, and it will be along A-B-C-D.As the coil is rotating clockwise, after half of the time period, the position of the coil will be as in second case of above figure. In this case, the direction of the induced current according to Fleming's right hand rule will be along D-C-B-A. It shows that, the direction of the current changes after half of the time period, that means we get an alternating current.
the figure is in NCERT