GY-271 QMC5883P Triple-Axis Magnetometer Compass Board

SKU: FA2166-1
Sensor Chip

QMC5883P

Axes

3-axis (X, Y, Z)

ADC Resolution

16-bit

Measurement Range

±2 / ±8 / ±12 / ±30 Gauss (user selectable)

Interface

I2C (address 0x2C, up to 400 kHz)

Supply Voltage

3V – 5V DC (onboard regulator)

Data Rate

10/50/100/200 Hz (normal); up to 1500 Hz (continuous)

Module Dimensions

Approx. 14 × 13 mm

The GY-271 QMC5883P Triple-Axis Magnetometer Compass Board is a compact, high-precision magnetic field sensor designed for compass heading, orientation detection, and magnetic field measurement. Built around the QMC5883P chip, this module is the direct successor to the popular QMC5883L, offering wider measurement ranges (up to ±30 Gauss) and improved performance for demanding applications . It is ideal for Arduino projects, robotics navigation, drone stabilization, and IoT devices.

At the heart of the module is the QMC5883P, a 3-axis magnetoresistive sensor with 16-bit ADC resolution that measures magnetic fields across the X, Y, and Z axes . Unlike the older QMC5883L which maxed out at ±8 Gauss, the QMC5883P supports four user-selectable ranges: ±2, ±8, ±12, and ±30 Gauss . This wider range makes it more resilient in environments with stronger magnetic interference, such as near motors, transformers, or industrial equipment .

The module features built-in self-test capability and temperature compensation, ensuring reliable and stable readings across varying conditions . It includes onboard voltage regulation and level shifting, allowing operation from 3V to 5V supplies — making it directly compatible with both 3.3V and 5V microcontrollers like Arduino Uno, ESP32, and STM32 .

The I2C interface uses the fixed address 0x2C (7-bit), simplifying integration with existing libraries . The module measures approximately 14 × 13 mm with a standard 2.54mm pin header for breadboard and jumper wire connections .

Important Note: The QMC5883P uses a different register map and I2C address than the QMC5883L. It is not directly software-compatible with QMC5883L libraries. Use the Adafruit_QMC5883P library or dedicated QMC5883P drivers for proper operation .

Whether you are building a tilt-compensated compass, a robot with navigation capabilities, or a magnetic field detection system, the GY-271 QMC5883P provides a reliable, cost-effective foundation for magnetic sensing. It is suitable for individual makers, students, and businesses purchasing in bulk for product development or educational programs.


Features

  • QMC5883P 3-axis magnetometer — Measures magnetic fields in X, Y, and Z axes with 16-bit resolution

  • Wide measurement ranges — ±2, ±8, ±12, and ±30 Gauss user-selectable

  • High sensitivity — Up to 15,000 LSB/Gauss in the ±2 Gauss range

  • I2C interface — Fixed address 0x2C, up to 400 kHz bus speed

  • Wide supply voltage — 3V to 5V operation with onboard regulation and level shifting

  • Built-in self-test — Verifies sensor functionality on startup

  • Temperature compensation — Stable readings across temperature variations

  • Programmable data rate — 10/50/100/200 Hz in normal mode, up to 1500 Hz in continuous mode

  • Compact form factor — Approx. 14 × 13 mm with 2.54mm pin header

  • Direct successor to QMC5883L — Wider range, improved availability


Technical Specifications

# Parameter Specification
1 Sensor Chip QMC5883P
2 Axes 3-axis (X, Y, Z)
3 ADC Resolution 16-bit
4 Measurement Range ±2 / ±8 / ±12 / ±30 Gauss (user selectable)
5 Interface I2C (address 0x2C, up to 400 kHz)
6 Supply Voltage 3V – 5V DC (onboard regulator)
7 Data Rate 10/50/100/200 Hz (normal); up to 1500 Hz (continuous)
8 Module Dimensions Approx. 14 × 13 mm 

Usage

Getting Started

  1. Connect power — Supply 3V to 5V to the VCC pin and GND to ground .

  2. Connect I2C lines — Connect SDA to your microcontroller‘s I2C data line and SCL to the I2C clock line.

    • Arduino Uno: SDA → A4, SCL → A5

    • ESP32: SDA → GPIO21, SCL → GPIO22 (default)

    • ESP8266: SDA → D2, SCL → D1

  3. Install the library — Install the Adafruit_QMC5883P library through the Arduino Library Manager. It depends on Adafruit BusIO .

  4. Verify communication — Run an I2C scanner sketch to confirm the module’s address (0x2C) .

  5. Upload a test sketch — Use the library example to read magnetic field values on X, Y, and Z axes. Calculate heading using atan2(Y, X) .

Pin Connections

Module Pin Function Arduino Uno ESP32 ESP8266
VCC Power 5V or 3.3V 3.3V 3.3V
GND Ground GND GND GND
SDA I2C Data A4 GPIO21 D2
SCL I2C Clock A5 GPIO22 D1

Key Differences from QMC5883L

Parameter QMC5883L QMC5883P
I2C Address 0x0D (or 0x1E) 0x2C
Max Range ±8 Gauss ±30 Gauss
Chip ID 0xFF 0x80
Software Compatibility QMC5883L libraries QMC5883P libraries (e.g., Adafruit)

Calibration Notes

For accurate compass heading, the QMC5883P should be calibrated to compensate for hard-iron and soft-iron magnetic distortions . The common approach involves rotating the sensor through all orientations and recording min/max values for each axis, then applying offset and scale corrections in your code .

Typical Applications

  • Compass heading — Determine direction relative to magnetic north

  • Robotics navigation — Provide heading reference for mobile robots

  • Tilt-compensated compass — Combine with accelerometer for accurate heading at any orientation

  • Magnetic field detection — Detect presence of magnetic materials or fields

  • Drone stabilization — Orientation reference for flight controllers

  • Industrial monitoring — Magnetic field measurement near motors and equipment

Notes for Business Buyers

  • QMC5883L replacement — The QMC5883P is the recommended successor as QMC5883L is being discontinued .

  • Wider range advantage — ±30 Gauss capability makes it suitable for environments with stronger magnetic interference .

  • Software migration required — Register map and I2C address differ from QMC5883L; firmware updates are necessary .

  • Suitable for bulk purchasing — Ideal for product development, educational kits, and commercial deployments.

Q: What is the GY-271 QMC5883P module used for?

It is a 3-axis magnetometer for compass heading, orientation detection, magnetic field measurement, and navigation applications in Arduino and microcontroller projects .

Q: Is the QMC5883P compatible with QMC5883L libraries?

No. The QMC5883P uses a different I2C address (0x2C vs. 0x0D) and a different register map. You must use a dedicated QMC5883P library such as Adafruit_QMC5883P .

Q: What is the I2C address of this module?

The fixed 7-bit I2C address is 0x2C .

Q: What is the measurement range?

The module supports ±2, ±8, ±12, and ±30 Gauss user-selectable ranges .

Q: What voltage does the module require?

It operates from 3V to 5V thanks to its onboard voltage regulator and level shifting .

Q: How do I calculate compass heading?

Use the formula heading = atan2(Y, X) where Y and X are the magnetic field readings. Convert the result to degrees and adjust for declination if needed .

Q: Does the module require calibration?

Yes. For accurate compass heading, the QMC5883P should be calibrated to compensate for magnetic distortions in your environment .

Q: What is the difference between QMC5883P and QMC5883L?

The QMC5883P offers wider measurement ranges (up to ±30 Gauss vs. ±8 Gauss) and a different I2C address (0x2C vs. 0x0D). It is the direct successor to the QMC5883L .

Q: Can I use this module with an ESP32?

Yes. Connect SDA to GPIO21 and SCL to GPIO22 (default I2C pins), and use the Adafruit_QMC5883P library .

Q: Can I purchase in bulk for a product development project?

Yes. This module is suitable for both individual users and business purchasing, including product development, educational programs, and commercial deployments.