Compass Sensor QMC5883L / HMC5883L GY-271 3-Axis Digital Magnetometer
VAT inclusive; Computed calculations added locally.
Overview
The Compass Sensor QMC5883L / HMC5883L GY-271 is a compact 3-axis digital magnetometer designed to measure the Earth's magnetic field and provide directional information for electronic compass and orientation applications. Its small footprint makes it particularly useful for robotics, UAVs, autonomous vehicles, and other embedded projects where PCB space is limited.
This GY-271 module may be supplied with either a QMC5883L or HMC5883L-compatible magnetometer IC, depending on the board variant. Although these devices can have similar physical layouts and pin configurations, their I2C addresses and register maps are different, so the appropriate software library and configuration must be used for the IC fitted to the particular module.
The onboard interface circuitry makes the module convenient to connect with both 3.3V and 5V microcontrollers. Communication is handled through the standard I2C interface using SDA and SCL, while the dedicated DRDY (Data Ready) output can be used to detect when new magnetic measurement data is available.
For better heading accuracy, the sensor should be mounted away from motors, high-current wiring, speakers, permanent magnets, and large ferromagnetic objects. Calibration and, where required, tilt compensation and magnetic declination correction are important for obtaining useful compass headings.
Customer Reviews
Share your verified purchase experience with the community.
Earn Loyalty Rewards
Get 50 Points for reviewing + bonus points when upvoted!
Want to share your experience?
Sign in to leave a verified review for this product.
New here? Create a free account
Verified Comments Listing
Product Technical Information
Technical Details
The GY-271 QMC5883L / HMC5883L Compass Sensor is a small digital magnetic-field sensing module that measures magnetic field strength along three axes. A microcontroller can process these X, Y, and Z measurements to determine magnetic heading and orientation.
The module is commonly used with development boards such as Arduino and other microcontrollers through the I2C bus. Its compact design makes it convenient for small robotic platforms, autonomous vehicles, UAV projects, and educational electronics.
Features
- 3-axis digital magnetometer
- QMC5883L / HMC5883L sensor variants
- Measures magnetic field on X, Y, and Z axes
- I2C communication interface
- SDA and SCL interface pins
- Dedicated DRDY (Data Ready) output
- Onboard voltage regulation
- Onboard logic-level shifting
- Compatible with 3.3V and 5V microcontroller interfaces
- Compact PCB footprint
- Suitable for electronic compass and heading applications
- Unsoldered header pins included
Applications
- Arduino electronic compass projects
- UAV and drone heading systems
- Autonomous robots
- Line-following robots
- Mobile rover navigation
- Robot orientation detection
- Digital compass projects
- Pedometers and orientation devices
- STEM and educational projects
- Magnetic field measurement
- Embedded navigation systems
How It Works / Use Guide
The GY-271 measures the surrounding magnetic field along its X, Y, and Z axes. A microcontroller reads these measurements through the I2C interface and uses the data to calculate magnetic direction.
- Identify the sensor IC installed on the module.
- Connect VCC and GND to the appropriate power supply.
- Connect SDA and SCL to the microcontroller's I2C pins.
- Connect the DRDY pin if your application requires data-ready interrupt functionality.
- Install a software library compatible with the actual sensor IC.
- Confirm the I2C address using an I2C scanner if necessary.
- Calibrate the magnetometer before using it for compass heading calculations.
- Mount the module away from motors, power cables, magnets, and ferromagnetic materials.
- For applications where the sensor is tilted, use appropriate tilt-compensation calculations for improved heading accuracy.
QMC5883L vs HMC5883L
Although QMC5883L and HMC5883L modules can look very similar and may use compatible physical pin arrangements, they should not be treated as identical from a software perspective.
-
QMC5883L commonly uses I2C address
0x0D. -
HMC5883L commonly uses I2C address
0x1E. - Their register maps and initialization procedures are different.
- A library written specifically for HMC5883L may not work correctly with QMC5883L.
- Always identify the actual IC fitted to the module and use the corresponding library.
Important Notes
- The exact sensor IC may vary between GY-271/HW-127 board variants.
- Check the actual IC and I2C address before programming.
- Sensor heading accuracy depends on calibration, mounting position, environmental magnetic fields, and software processing.
- Keep the sensor away from high-current motor wires, motors, speakers, permanent magnets, and steel/iron hardware.
- Do not place the module immediately beside Li-Po battery power leads or other high-current conductors when accurate compass readings are required.
- The stated magnetic-field range and electrical characteristics can vary depending on whether the module uses QMC5883L or HMC5883L.
- Avoid exposing the module to excessive heat during soldering.
- Do not apply voltage outside the module's specified supply range.
- Physical dimensions may have minor manufacturing or measurement variation.
- Product images are for illustrative purposes only and may differ from the actual product.
Package Includes
- 1 × HW-127 / GY-271 QMC5883L / HMC5883L 3-Axis Compass Module
- 2 × 5-Pin Male Header Connectors, Straight and Right-Angle, Unsoldered
Frequently Asked Questions
You May Also Like
Seeed Studio 24GHz mmWave Human Presence Radar Sensor Module
Available on Pre-Order 📦
What Engineers & Builders Say
Trusted by makers, robotics researchers, and DIY electronics enthusiasts across Bangladesh.
"The ESP32 DIY Ambilight Kit arrived within 24 hours in perfect packaging. Everything worked out of the box with flawless code support!"
Tanvir Ahmed
Robotics Engineer
"KathalTech is my go-to store for sensors, NodeMCU boards, and microcontrollers in Bangladesh. Highly reliable service and genuine components."
Nusrat Jahan
IoT Researcher
"Super fast delivery and great support. The pickup point option made it very convenient to collect my project parts after classes."
Sabbir Hossain
University Student & Hobbyist
Sign in with Google +100 PTS
Get 100 Welcome Points & track your orders seamlessly.