Magnetic sensors (magnetometers) are measurement instruments used for two general purposes: to measure the magnetization of a magnetic material like a ferromagnet, or to measure the strength and, in some cases, the direction of the magnetic field at a point in space.
The first magnetometer was invented by Carl Friedrich Gauss in 1833 and notable developments in the 19th century included the Hall Effect which is still widely used.
Magnetic sensors are widely used for measuring the Earth's magnetic field and in geophysical surveys to detect magnetic anomalies of various types. They are also used militarily to detect submarines.
Magnetic sensors can be used as metal detectors: they can detect only magnetic (ferrous) metals, but can detect such metals at a much larger depth than conventional metal detectors; they are capable of detecting large objects, such as cars, at tens of metres, while a metal detector's range is rarely more than 2 metres.
In recent years magnetometers have been miniaturized to the extent that they can be incorporated in integrated circuits at very low cost and are finding increasing use as compasses in consumer devices such as mobile phones and tablet computers.