# PiicoDev Magnetometer QMC6310 - Guide for Raspberry Pi Pico

**URL:** https://forum.core-electronics.com.au/t/piicodev-magnetometer-qmc6310-guide-for-raspberry-pi-pico/13460
**Category:** Guides
**Created:** [20 March 2022 02:14 UTC](https://forum.core-electronics.com.au/t/piicodev-magnetometer-qmc6310-guide-for-raspberry-pi-pico/13460 "2022-03-20T02:14:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Michael](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael/32/3545_2.png) [@Michael](https://forum.core-electronics.com.au/u/Michael)
#### Post date: [20 March 2022 02:14 UTC](https://forum.core-electronics.com.au/t/piicodev-magnetometer-qmc6310-guide-for-raspberry-pi-pico/13460/1 "2022-03-20T02:14:26Z")

</div>

Michael just shared a new tutorial: [**"PiicoDev Magnetometer QMC6310 - Guide for Raspberry Pi Pico"**](http://core-electronics.com.au/tutorials/piicodev-magnetometer-qmc6310-guide-for-raspberry-pi-pico.html)  
  
 ![](https://core-electronics.com.au/media/kbase/feature-piicodev-magnetometer-qmc6310-raspberry-pi-pico.png)  
  
Let’s get started with the PiicoDev® Magnetometer. In this guide, we’ll connect the Magnetometer to our Raspberry Pi Pico, get it working as a compass, and read the magnetic field strength of a nearby magnet. Finally, we’ll remix the code to crea…  
  
[**Read more**](http://core-electronics.com.au/tutorials/piicodev-magnetometer-qmc6310-guide-for-raspberry-pi-pico.html)

---

<div class="post-metadata">

### Author: ![Philip95792](https://avatars.discourse-cdn.com/v4/letter/p/e47774/32.png) [@Philip95792](https://forum.core-electronics.com.au/u/Philip95792)
#### Post date: [27 May 2026 00:59 UTC](https://forum.core-electronics.com.au/t/piicodev-magnetometer-qmc6310-guide-for-raspberry-pi-pico/13460/2 "2026-05-27T00:59:04Z")

</div>

There appears to be a logic error in the calibration. Calibration uses “raw” readings  
d = self.read(raw=True)  
But those readings always have offsets subtracted. That means the only way to get a stable calibration is to delete the calibration.cal file (so offsets start at zero) and then run a calibration only once. Any time you repeat a calibration, it gets XYZ values that are distorted by the previous calibration.

This could be easily fixed if the calibration zeros the offset values before it starts its readings.

---

<div class="post-metadata">

### Author: ![Liam](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam/32/3562_2.png) [@Liam](https://forum.core-electronics.com.au/u/Liam)
#### Post date: [27 May 2026 01:20 UTC](https://forum.core-electronics.com.au/t/piicodev-magnetometer-qmc6310-guide-for-raspberry-pi-pico/13460/3 "2026-05-27T01:20:32Z")

</div>

Hi Philip,

Great catch, it looks like that was fixed with the revision into the MMC5603: [CE-PiicoDev-MMC5603-MicroPython-Module/PiicoDev\_MMC5603.py at main · CoreElectronics/CE-PiicoDev-MMC5603-MicroPython-Module · GitHub](https://github.com/CoreElectronics/CE-PiicoDev-MMC5603-MicroPython-Module/blob/main/PiicoDev_MMC5603.py#L230)

I’ll push a commit fixing the error, in the guide I recall instructions to delete the file if a new calibration was to be performed, but from a UX perspective it definitely makes sense to not have to prod around in the files.

Liam
