GY-271M compass module - 3-axis magnetic field sensor, I2C, 3-5 V
This goes with it
incl. VAT, plus shipping
Description
Product overview
- 3-axis magnetic field sensor for compass measurements and direction finding
- I2C bus communication; multiple modules can be connected to one bus
- 3–5 V power supply, compatible with 3.3 V and 5 V systems
- Optional interrupt pin (DRDY) signals when new readings are available
- Software calibration required to compensate for ambient magnetic fields
Product description
The magnetic field sensor measures the Earth's magnetic field components in three spatial directions, making it possible to calculate an object's orientation. The three axis values can be used to create an electronic compass that indicates the cardinal direction.
Communication uses the I2C bus, which saves connections when multiple modules share the same interface: the sensor uses only two data lines (SDA and SCL) instead of separate pins for each module. An additional DRDY pin signals via an interrupt when new readings are available, but this is optional and not required for simple applications.
Since the module operates with supply voltages from 3 to 5 V, it works directly with 3.3 V systems such as the Raspberry Pi and with 5 V boards such as the Arduino Uno; no level shifter is needed. For reliable measurements, the sensor must be calibrated in software before use to compensate for interference from nearby magnetic fields or metal parts.
Typical applications include robotics and navigation, where the compass function provides orientation in a plane, as well as projects involving direction finding in general. These applications require software to control the I2C bus and process the readings; suitable libraries are available for various platforms.
Safety notice
The module is intended exclusively for building prototypes and for testing and development purposes. It is not suitable for installation in household electrical circuits. Work on or near electrical installations must be carried out by qualified electricians. If you are unsure about commissioning, consult a qualified electrician before connecting it to the electrical circuit.
Package contents
- 1x GY-271M compass module / magnetic field sensor (replaces HMC5883L GY-271)