Hans C. Oersted’s experiment proved that moving electric charges can generate a magnetic field. This fact gave rise to electromagnetism.
The inseparability of the magnetic poles in the face of the possibility of a single electric pole and the restricted attraction of materials by the magnet in the face of a greater number of elements attracted by an electrified body were the pillars of the idea that magnetism and electricity were completely different facts.
In 1820, the Dane Hans Christian Oersted (1777-1851) noticed that the magnetized needle of a compass suffered deflections when it was close to a conducting wire through which an electric current passed. Oersted noticed that the compass needle normally pointed toward geographic north when the circuit was off, but was deflected when electrical current flowed through the wire.
The only possibility for changing the direction of the compass needle was the presence of a magnetic field different from that caused by the Earth. Oersted’s conclusion was that moving electric charges were capable of creatingthe magnetic field . A wire carrying an electric current acts like a magnet !
Oersted’s experience paved the way for studies concerning the relationship between electricity and magnetism. With this, it was realized that these two phenomena are closely related: magnetism generates electricity and electricity generates magnetism. From that moment on, the era of electromagnetism was inaugurated, in which phenomena of an electrical and magnetic nature became responsible, for example, for the operation of electric motors and for the generation of electric energy .