GY-271 QMC5883P magnetometer board, component side, with its loose 5-pin header

GY-271 QMC5883P Compass Module - 3-Axis Magnetometer, I2C, 3V to 5V

Unsoldered
$5.91 NZDRegular price $8.09 NZD25% off
Skip to product information
SKU: MOD-QMC5883P-GY271-UNSOL

GY-271 QMC5883P Compass Module - 3-Axis Magnetometer, I2C, 3V to 5V

$5.91 NZD Regular price $8.09 Black Friday 25% off Ends Mon 30 Nov
Headers

Easy 30-day returns · 12-month warranty

Availability:
Order before 7:30am (12pm weekends) for same-day dispatch
Delivery $5.99 urban, free from $50

NZ Post 1-2 days urban, 2-4 days rural

Delivery Details
  • Urban delivery from $5.99, free on orders from $50.
  • Rural delivery from $9.99, free on orders from $88.
  • Free pick-up in Te Awamutu.
  • We dispatch every day except public holidays.
Shipping policy

A GY-271 3-axis magnetometer board fitted with the QMC5883P sensor, for adding a digital compass heading or magnetic field readings to an Arduino, ESP32 or Raspberry Pi project. It runs from 3V to 5V and talks over I2C at address 0x2C, so it works with a QMC5883P library such as Adafruit QMC5883P, not the older QMC5883L or HMC5883L code. Choose Unsoldered with a loose header, or Soldered with the header already fitted.

Specifications

Sensor chipQMC5883P 3-axis magnetometer
Supply (VCC)3V to 5V, onboard regulator
Works with5V Arduino and 3.3V ESP32, Pi
InterfaceI2C, fixed address 0x2C
Field range±2, ±8, ±12 or ±30 gauss
Resolution16-bit, 2 mG noise on X and Y
Output rate10 to 200 Hz, up to 1.5 kHz continuous
PinsVCC, GND, SCL, SDA, DRDY (not used)
Board size14.0 x 13.0 mm, 1.55 g with header

Datasheets

What's in the box

1×
GY-271 QMC5883P magnetometer board

Unsoldered ships with a 5-pin 2.54 mm male header, loose and ready to solder. Soldered comes with the header soldered in, ready for a breadboard or jumper wires. Jumper wires and the microcontroller are not included.

Great for

Give a robot or rover a compass heading
Point an antenna, camera or solar panel north
Detect a magnet or steel moving past
Log magnetic field changes over time
Add heading to a GPS tracker build
Learn I2C sensors on an Arduino or ESP32

Wiring & getting started

  1. Fit the header

    On the Unsoldered option, fit the short ends of the 5-pin header through the board and solder all five pads. The Soldered option is ready to go.

  2. Wire four pins

    VCC to 5V on an Uno or Nano, or 3V3 on an ESP32. GND to GND. SCL to A5 and SDA to A4 on an Uno or Nano, or GPIO22 and GPIO21 on an ESP32. Leave DRDY unconnected.

  3. Install the library

    In the Arduino IDE open Tools > Manage Libraries, search QMC5883P and install Adafruit QMC5883P with its dependencies.

  4. Run the test sketch

    Upload the sketch from the Quick Start and open the Serial Monitor at 115200 baud. It prints QMC5883P found, then X, Y and Z in gauss that change as you turn the board.

Note: For a compass heading, mount the board level and away from steel screws, magnets, motors and speakers, then calibrate it in place. In New Zealand add about 19 to 27 degrees east of declination to turn magnetic north into true north. The datasheet has a calibrated heading sketch.

Frequently asked questions

Will it work with a 5V Arduino Uno or a 3.3V ESP32?
Yes, both. VCC takes 3V to 5V and an onboard regulator feeds the sensor. Power it from the same voltage as your board's I/O: 5V on an Uno, Nano or Mega, 3.3V on an ESP32 or Raspberry Pi.
My QMC5883L or HMC5883L sketch says no sensor found. Why?
This board uses the QMC5883P, which sits at I2C address 0x2C and has a different register map. QMC5883L code looks at 0x0D and HMC5883L code at 0x1E, so neither will find it. Install the Adafruit QMC5883P library from the Arduino Library Manager and start from its example or our Quick Start sketch.
What is the DRDY pin for?
Nothing on this version. The QMC5883P has no data-ready output, so leave DRDY unconnected. Your code checks the status register instead, which is what isDataReady() does in the library.
How accurate is the compass heading?
The sensor chip is rated for 1 to 2 degrees once calibrated. In practice that depends on calibrating it where it is mounted, keeping it level and keeping it away from steel, magnets, motors and cables carrying current. Add your local declination, about 19 to 27 degrees east across New Zealand, for true north.
Do I need to solder anything?
Only with the Unsoldered option, where the 5-pin header comes loose in the bag. Choose Soldered and the header arrives soldered in here in New Zealand, ready for a breadboard or jumper wires.
Can I run two of these on the same I2C bus?
No. The address is fixed at 0x2C, so two would clash. Put the second one on another I2C bus (an ESP32 has two) or use an I2C multiplexer.
Does it work with a Raspberry Pi and Python?
Yes. Power it from 3.3V, connect SDA to GPIO2 and SCL to GPIO3, enable I2C, and i2cdetect should show 2c. The adafruit-circuitpython-qmc5883p package reads it from Python.

Have a question about this product?

Send it through and we will get back to you by email.

About NZN

Useful parts, fair prices and someone local to help.

I'm Lukas, an engineering student and maker based in Te Awamutu. NZN grew out of a CNC build that dragged on for months because every missing cable, bolt or electronic part meant another overseas order. I started the shop so Kiwi makers can spend more time building and less time waiting for the next parcel.

  • Stocked here in New Zealand

    Stock is held here in New Zealand, and every order is dispatched by the next day, except on public holidays. The timer beside Add to cart shows when yours goes out. NZ Post aims for 1-2 days urban and 2-4 days rural. In Te Awamutu and Kihikihi you can choose local delivery at checkout: same day if you order before 8am, otherwise next day.

  • Fair prices, clearly shown

    Where a product has quantity pricing, the price for each quantity is listed above Add to cart. Free delivery starts at $50 for urban addresses and $88 for rural addresses.

  • 30-day returns and 12-month warranty

    Get in touch if something is not right and we will help sort it.

  • Practical product support

    Ask a product question and get help from a real person in New Zealand who knows the range.

You may also like