GY-271M compass module - 3-axis magnetic field sensor, I2C, 3-5 V
This goes with it
Description
Product overview
- 3-axis magnetic field sensor for compass measurements and direction determination
- I2C bus communication, multiple modules can be connected to one bus
- 3–5 V power supply, can be used directly with 3.3-V and 5-V systems
- Optional interrupt pin (DRDY) signals new measurement values
- 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, enabling the object's orientation to be calculated. The three axis values can therefore be used to create an electronic compass that indicates the cardinal direction.
Communication takes place via the I2C bus, which makes it possible to connect multiple modules to the same interface while using only two data lines (SDA and SCL) instead of separate pins for each module. An additional DRDY pin indicates via an interrupt when new measurement values are available, but this is optional and not necessary 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 as well as with 5-V boards such as the Arduino Uno, so no level shifter is required. For reliable measurements, the sensor must be calibrated in software before use to compensate for distortions caused by nearby magnetic fields or metal components.
Typical applications include robotics and navigation, where the compass function provides orientation in the horizontal plane, as well as projects for determining direction in general. Control software for the I2C bus and processing of the measurement values is required; corresponding libraries are available for various platforms.
Safety information
The module is intended exclusively for building prototypes and for testing and development purposes and is not suitable for installation in household power circuits. Work on or near electrical installations must be carried out by qualified electricians. If you are unsure about commissioning the module, consult a qualified electrician before connecting it to the power circuit.
Scope of delivery
- 1x GY-271M compass module / magnetic field sensor (replaces HMC5883L GY-271)