an electromagnet of a spring is placed between the poles of a permanrnt magnet. when there is current in the coil, the resulting magnetic field lines up with the field of the permanent magnet, and indicates the strenght of the electric current by deflecting a needle on a dial.