Creation of a Magnetic Field by an Electric Current
Magnetic fields exist on all sides of a wire carrying an electric current (here only one magnetic field line is shown). The compass needle always deflects in the direction of the magnetic field lines of force when the current is switched on. When the direction of the current is inverted, the direction of the magnetic field is inverted too, as the arrows show. This can be remembered using the "right-hand rule".