The AC generator works on the principle of electromagnetic induction to convert mechanical energy into electrical energy. It consists of a coil that rotates inside a stationary magnetic field. As the coil arms move up and down through the magnetic field, it causes induced currents that change direction periodically in the coil and external circuit, producing an alternating current. The Fleming's right hand rule determines the direction of the induced currents in the coil arms as they rotate.