{"product_id":"gy-271-qmc5883p-magnetometer-compass-module","title":"GY-271 QMC5883P Compass Module - 3-Axis Magnetometer, I2C, 3V to 5V","description":"\u003cdiv class=\"nznpd\"\u003e\n\u003cdiv class=\"nznpd__lead\"\u003e\u003cp class=\"nznpd__intro\"\u003eA 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.\u003c\/p\u003e\u003c\/div\u003e\n\u003csection class=\"nznpd__block\"\u003e\u003ch3 class=\"nznpd__h\"\u003eSpecifications\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__specs\"\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eSensor chip\u003c\/span\u003e\u003cstrong\u003eQMC5883P 3-axis magnetometer\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eSupply (VCC)\u003c\/span\u003e\u003cstrong\u003e3V to 5V, onboard regulator\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eWorks with\u003c\/span\u003e\u003cstrong\u003e5V Arduino and 3.3V ESP32, Pi\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eInterface\u003c\/span\u003e\u003cstrong\u003eI2C, fixed address 0x2C\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eField range\u003c\/span\u003e\u003cstrong\u003e±2, ±8, ±12 or ±30 gauss\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eResolution\u003c\/span\u003e\u003cstrong\u003e16-bit, 2 mG noise on X and Y\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eOutput rate\u003c\/span\u003e\u003cstrong\u003e10 to 200 Hz, up to 1.5 kHz continuous\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003ePins\u003c\/span\u003e\u003cstrong\u003eVCC, GND, SCL, SDA, DRDY (not used)\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eBoard size\u003c\/span\u003e\u003cstrong\u003e14.0 x 13.0 mm, 1.55 g with header\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\u003c\/section\u003e\n\u003csection class=\"nznpd__block\"\u003e\u003ch3 class=\"nznpd__h\"\u003eDatasheets\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__ds\"\u003e\n\u003ca class=\"nznpd__dsbar\" href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/GY271-QMC5883P-Datasheet-v3-r1-2026-10-07.pdf\" target=\"_blank\" rel=\"noopener\" aria-label=\"Download the GY-271 QMC5883P technical datasheet PDF\"\u003e\u003csvg width=\"20\" height=\"20\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"\u003e\u003c\/path\u003e\u003cpolyline points=\"14 2 14 8 20 8\"\u003e\u003c\/polyline\u003e\u003c\/svg\u003e\u003cspan\u003eFull technical datasheet\u003c\/span\u003e\u003cspan class=\"nznpd__dsmeta\"\u003ePDF\u003csvg width=\"17\" height=\"17\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"\u003e\u003c\/path\u003e\u003cpolyline points=\"7 10 12 15 17 10\"\u003e\u003c\/polyline\u003e\u003cline x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"\u003e\u003c\/line\u003e\u003c\/svg\u003e\u003c\/span\u003e\u003c\/a\u003e\n\u003ca id=\"quick-start-guide\" class=\"nznpd__dsbar\" href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/GY271-QMC5883P-QuickStart-r1-2026-10-07.pdf\" target=\"_blank\" rel=\"noopener\" aria-label=\"Download the GY-271 QMC5883P Quick Start PDF\"\u003e\u003csvg width=\"20\" height=\"20\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"\u003e\u003c\/path\u003e\u003cpolyline points=\"14 2 14 8 20 8\"\u003e\u003c\/polyline\u003e\u003c\/svg\u003e\u003cspan\u003eQuick Start: wiring and test sketch\u003c\/span\u003e\u003cspan class=\"nznpd__dsmeta\"\u003ePDF\u003csvg width=\"17\" height=\"17\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"\u003e\u003c\/path\u003e\u003cpolyline points=\"7 10 12 15 17 10\"\u003e\u003c\/polyline\u003e\u003cline x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"\u003e\u003c\/line\u003e\u003c\/svg\u003e\u003c\/span\u003e\u003c\/a\u003e\n\u003c\/div\u003e\u003c\/section\u003e\n\u003csection class=\"nznpd__block\"\u003e\u003ch3 class=\"nznpd__h\"\u003eWhat's in the box\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__included\"\u003e\n\u003cdiv class=\"nznpd__qty\"\u003e1×\u003c\/div\u003e\n\u003cdiv\u003e\n\u003cstrong\u003eGY-271 QMC5883P magnetometer board\u003c\/strong\u003e\u003cp\u003eShips with a 5-pin 2.54 mm male header, loose and ready to solder. Jumper wires and the microcontroller are not included.\u003c\/p\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\u003c\/section\u003e\n\u003csection class=\"nznpd__block\"\u003e\u003ch3 class=\"nznpd__h\"\u003eGreat for\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__uses\"\u003e\n\u003cdiv class=\"nznpd__use\"\u003eGive a robot or rover a compass heading\u003c\/div\u003e\n\u003cdiv class=\"nznpd__use\"\u003ePoint an antenna, camera or solar panel north\u003c\/div\u003e\n\u003cdiv class=\"nznpd__use\"\u003eDetect a magnet or steel moving past\u003c\/div\u003e\n\u003cdiv class=\"nznpd__use\"\u003eLog magnetic field changes over time\u003c\/div\u003e\n\u003cdiv class=\"nznpd__use\"\u003eAdd heading to a GPS tracker build\u003c\/div\u003e\n\u003cdiv class=\"nznpd__use\"\u003eLearn I2C sensors on an Arduino or ESP32\u003c\/div\u003e\n\u003c\/div\u003e\u003c\/section\u003e\n\u003csection class=\"nznpd__block\"\u003e\u003cdiv class=\"nznpd__qs\"\u003e\n\u003ch3\u003eWiring \u0026amp; getting started\u003c\/h3\u003e\n\u003col class=\"nznpd__steps\"\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eSolder the header\u003c\/strong\u003e\u003cp\u003eFit the short ends of the 5-pin header through the board and solder all five pads.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eWire four pins\u003c\/strong\u003e\u003cp\u003eVCC 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.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eInstall the library\u003c\/strong\u003e\u003cp\u003eIn the Arduino IDE open Tools \u0026gt; Manage Libraries, search QMC5883P and install Adafruit QMC5883P with its dependencies.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eRun the test sketch\u003c\/strong\u003e\u003cp\u003eUpload 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.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003c\/ol\u003e\n\u003c\/div\u003e\u003c\/section\u003e\n\u003cp class=\"nznpd__note\"\u003e\u003cstrong\u003eNote:\u003c\/strong\u003e 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.\u003c\/p\u003e\n\u003c\/div\u003e","brand":"NZN Electronics","offers":[{"title":"Default Title","offer_id":67621360304224,"sku":"MOD-QMC5883P-GY271","price":7.99,"currency_code":"NZD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/gy-271-qmc5883p-magnetometer-compass-module.png?v=1791345972","url":"https:\/\/www.nznelectronics.co.nz\/products\/gy-271-qmc5883p-magnetometer-compass-module","provider":"NZN Electronics","version":"1.0","type":"link"}