Current in a coil produces a magnetic field which causes a needle inside the coil to twist. The amount of twist is the measure of the current. A second needle placed outside the coil allows the device to account for earth's magnetic field. The electromagnet proved a critical element in most major electrical inventions of the 19th century. Motors, generators, telegraphs and telephones were the major examples.
Any electric current produces a magnetic effect.
William Sturgeon made an electromagnet in 1825 by passing a current through a bare wire wrapped around an iron rod. Joseph Henry constructed powerful electromagnets by using many windings of insulated wires. The iron core shown here is from Henry's experiments of 1827. Henry later became the Smithsonian's first secretary, due mainly to his international scientific reputation. His experiments, powered by banks of batteries, did not result in practical lighting devices.