Before 1800, people thought that electricity and magnetism were two different things. However, this changed during the 19th century when scientists like Hans Christian Ørsted and Michael Faraday proved that electricity and magnetism are actually connected. In 1820, Ørsted found that when he turned the electric current from a battery on and off, it moved the needle on a nearby compass. When he studied this effect more carefully, he discovered that the electric current was producing a magnetic field. That is, when electric charges are moving, they can produce a force that pushes on magnets. Ørsted had found one of the first connections between electricity and magnetism.