After Alessandro Volta (1745-1827) in this highly unlikely fashion with Galvani's bioassay had gotten his clue as to how to build the first battery, a device was now in place for discovering one of the now known four forces in nature--electromagnetism.
It did not take that long time. In 1820 Hans Christian Oersted (1777-1851), a Danish physicist and chemist, was preparing for a lecture when he found by chance that the magnetic needle on a compass moved when he turned on and off a battery. He had discovered that there is a circular magnetic field around a conductor carrying a current.
Apparently mariners had known that compass needles moved when there was lightning in storms and an Italian legal scholar, Gian Dominico Romagnosi, had discovered something similar and published it in a local Italian newspaper in 1802. However, Oersted was the person that made it a scientific issue. He is credited by giving name for the CGS unit for magnetic H-field strength Oersted (Oe).
Oersted had during his early years met with Johan Wilhelm Ritter, a German physicist who thought there was some connection between magnetism and electricity. He was also influenced by Kantian ideas concerning the possible existence of deep relations between natural phenomena. Oersted became a professor at the University of Copenhagen in 1806.
A leader of the so called Danish golden age, Oersted was a friend of Hans Christian Andersen and a brother of politician and jurist Anders Sandoee Oersted who served as prime minister of Denmark 1853-54.
An intense activity of research was initiated by the finding and André-Marie Ampère (1775-1836), a French physicist and mathematician, that set up a single mathematical form to represent the magnetic forces between current carrying conductors. The SI unit ampère (A) used to be defined as the current that gives a certain force, 2 dynes, between two parallel wires distanced 1 cm apart.
Data from Wikipedia