robotics//sensor//magnetometer

A magnetometer is a sensor that measures a magnetic field, and its most common job is the compass of a phone, a drone or a robot: the Earth's field gives a heading that does not drift, which the gyroscope alone cannot. Other magnetometers find buried metal, check that a door or a valve is closed, count wheel turns, and at the extreme of sensitivity record the magnetic fields of the brain.


A magnetometer is a sensor that measures a magnetic field, and its most common job is the compass of a phone, a drone or a robot: the Earth's field gives a heading that does not drift, which the gyroscope alone cannot. Other magnetometers find buried metal, check that a door or a valve is closed, count wheel turns, and at the extreme of sensitivity record the magnetic fields of the brain.

A vector magnetometer reports the field's components along its axes; a scalar one reports only the magnitude. The Earth's field is between about 20 and 80 µT depending on place, and the technologies differ by orders of magnitude in what they can resolve below that:

Hall-effect sensors give a voltage proportional to the field; they are cheap and coarse, and suit switching and position sensing (a magnet near a wheel, a lid that closes).

Magnetoresistive sensors use thin films whose resistance changes with the field; three-axis versions cost under a dollar and are the compass in most phones.

Fluxgates drive a soft magnetic core into saturation and read the asymmetry the outside field adds; they serve in navigation, geophysics and spacecraft.

SQUIDs reach a few femtotesla per root hertz but must be cooled with liquid helium; the optically pumped magnetometer approaches them at room temperature.

A compass is only as good as its calibration.

The magnetometer sees every field around it, so the metal and the currents of the device itself must be measured and subtracted before the Earth's field means north.

Magnetized parts near the sensor add a constant offset, the hard-iron error, a kind of sensor bias; soft iron nearby bends the field, the soft-iron error, so that turning the device traces an ellipsoid instead of a sphere. Rotating the device through many orientations and fitting that ellipsoid is the standard sensor calibration.

Indoors, near motors, steel beams or power cables, the local field is no longer the Earth's; fusing the magnetometer with the gyroscope in a Kalman filter keeps the heading while the magnetic reading is disturbed.

The brain's fields are of the order of 10 fT for cortical activity, billions of times weaker than the Earth's, which is why recording them needs both the most sensitive sensors and a shielded room.