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

$7.99 NZD
Save 5% at 2+
Skip to product information
SKU: MOD-QMC5883P-GY271

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

$7.99 NZD
Availability:
Order before 7:30am for same-day dispatch 7-day dispatch, excluding public holidays

NZ Post: 1-2 days urban · 2-4 days rural

Shipping from $5.99 urban / $9.99 rural.

Buy more, pay less Prices shown are per unit. Add enough of this item and the lower rate applies on its own at checkout. There is no code to enter and you do not need to buy a pack. Choosing a tier here just sets the quantity for you. Larger quantities go out in the same bag, so packing, handling and postage cost us less per unit. We pass that saving straight on to you, so you can buy more for less.

Easy 30-day returns · 12-month warranty

Free Urban delivery on orders over $66
Urban $66 Rural $88

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.

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

Ships with a 5-pin 2.54 mm male header, loose and ready to solder. 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. Solder the header

    Fit the short ends of the 5-pin header through the board and solder all five pads.

  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

Answers to the questions buyers ask most.

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?
Yes. The 5-pin header comes loose in the bag, so solder it to the board or solder wires straight to the pads.
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.

Why Buy from 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

    Orders are picked and packed in Te Awamutu and dispatched within 24 hours every day, excluding public holidays. NZ Post target delivery is 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

    Prices are kept competitive and quantity discounts are shown upfront. Free delivery starts at $66 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