Andre-Marie Ampere realized that the deflection of a compass needle caused by an electric current flowing through could be use to measure the magnitude of the current. This concept led to the development of the galvanometer.
Galvanometer is an instrument utilizing a free moving needle to measure the flow of electricity, where a free pivoting coil and an attached needle are placed in the magnetic field of a permanent magnet. When an electric current passes through the coil, it experiences a torque due to the interaction of the current with the magnetic field. As a result the coil pivots and the needle is deflected proportionally to the current passing through the coil.
Here’s a video to show you how the moving coil galvanometer works. Enjoy!