A galvanometer is an instrument used to detect and measure small electrical currents. It works by using a coil of wire that is suspended in a magnetic field, and when a current flows through the coil, it experiences a torque that causes it to rotate. The amount of rotation is proportional to the strength of the current flowing through the coil.