Sensors and Perception

What Is a Magnetometer? How Robots Measure Magnetic Fields.

By Rodolfo Garcia Calderoni, CFA ·

On this pageWhat Is a Magnetometer?Key TakeawaysHow Does a Magnetometer Work?Why Do Robots Use Magnetometers?What Are Hard-Iron and Soft-Iron Distortion?Magnetometer vs. GyroscopeFrequently Asked QuestionsThe Bottom LineSourcesRelated terms

What Is a Magnetometer?

A magnetometer is a sensor that measures magnetic fields.

In robotics, magnetometers are often used to help estimate orientation relative to Earth's magnetic field.

They can function as part of an electronic compass and are sometimes included in inertial measurement systems.

For example, a mobile robot may combine magnetometer readings with gyroscope and accelerometer measurements to help estimate its heading.

However, magnetometers can be unreliable near steel structures, electric motors, and other sources of magnetic interference.

Key Takeaways

  • Magnetometers measure magnetic field strength and, in multi-axis designs, direction.
  • They can provide information useful for estimating orientation or heading.
  • Magnetic interference and calibration errors can significantly affect measurement accuracy.

How Does a Magnetometer Work?

A magnetometer measures magnetic fields using a sensing element and electronic circuitry.

Different sensors use different physical mechanisms, including Hall-effect and magnetoresistive technologies.

A three-axis magnetometer measures magnetic field components along three perpendicular directions.

Software can use these measurements to estimate the direction of a magnetic field relative to the sensor.

When Earth's magnetic field provides a suitable reference, this information can contribute to a compass heading.

However, a reliable heading estimate also requires accounting for sensor orientation and calibration.

Why Do Robots Use Magnetometers?

Imagine an outdoor mobile robot moving across a large open area.

Its gyroscope provides information about how quickly it turns.

However, integrating gyroscope measurements causes orientation error to accumulate over time.

A magnetometer can provide an additional heading reference.

Combined through sensor fusion, these measurements may help reduce accumulated heading drift.

The usefulness of the magnetometer depends on the surrounding environment.

What Are Hard-Iron and Soft-Iron Distortion?

Magnetometer measurements can be affected by nearby materials and magnetic sources.

Hard-iron effects introduce an approximately fixed magnetic bias in the sensor's coordinate system.

Soft-iron effects distort the measured magnetic field because nearby materials influence its shape or direction.

For example, metal structures and electrical equipment inside a robot can affect its magnetic measurements.

Calibration methods can compensate for some predictable distortions.

However, changing magnetic interference can still create errors.

Magnetometer vs. Gyroscope

A gyroscope measures angular velocity.

A magnetometer measures magnetic fields.

The gyroscope provides information about how quickly the robot rotates.

The magnetometer may provide a directional reference.

Together with accelerometer measurements, they can support orientation estimation.

Frequently Asked Questions

Can magnetometers work indoors?

Yes, but accuracy can suffer near steel beams, machinery, and electrical equipment.

Does a magnetometer directly measure true north?

No. It measures magnetic fields. Converting a magnetic heading to true north requires additional information, including local magnetic declination.

The Bottom Line

Magnetometers provide information about magnetic fields and can support robot heading estimation. Their value depends heavily on calibration and the magnetic conditions of the operating environment.

Sources

  1. Analog Devices AN-1157: Tuning the extended Kalman filter in the ADIS16480, magnetometer influences

Black Scarab Weekly

Follow the physical AI economy

Get Black Scarab news, deep research, and practical analysis in one clear Thursday briefing.

Weekly reporting and deep dives. Unsubscribe anytime. See our privacy notice.