The QMC6309, produced by QST Corporation, is a compact and energy-efficient digital magnetometer designed to detect magnetic fields across three axes (X, Y, Z). It integrates both magnetic sensing elements and signal-conditioning circuitry into a single silicon chip.
The QMC6309 stands out as a diminutive, energy-efficient, and accurate 3-axis magnetometer solution, ideal for compact and embedded electronics like VR trackers and flight controllers. With its seamless integration of sensing and signal conditioning, it provides high-precision magnetic field data with minimal PCB footprint.
Pin Configuration
- VCC : Power supply
- GND : Ground connection
- SDA : SDA of GLYPH board
- SCL : SCL of GLYPH board
Key Features
- 3-axis magnetic field sensing (X, Y, Z)
- I²C digital interface for easy MCU integration
- 16-bit ADC resolution for high-precision measurements
- Wide supply voltage range: 2.5 V – 3.6 V
- Low operating current: ~2 mA (ideal for battery-powered devices)
- Designed for consumer electronics like VR trackers, wearables, and flight controllers
Applications
- VR / AR Trackers – orientation tracking and drift correction
- Robotics & Drones – navigation, stabilization, and position control
- Consumer Electronics – smartwatches, handheld devices, portable gadgets
- Flight Controllers – magnetic heading reference in UAVs and quadcopters
- Research & Education – low-cost magnetometer for embedded learning projects
QMC6309 Simple Example
Step 1: Hardware Required
- Glyph Boards
- QMC6309
Step 2: Circuit Diagram
Step 3: Code Setup
- Open Arduino IDE.
- Make sure to install the library
- Copy and paste the following code into the Arduino IDE:
Step 4: Upload the Code
- Connect the Board
- Connect your GLYPH board to your computer
- Select the Board and Port
Do the following settings in your Arduino IDE,
Tools > Board > esp32 > Pcbcupid GLYPH C3
For the Pcbcupid Glyph C3 to appear under Tools > Board > esp32, the esp32 board version installed in the Arduino IDE should be greater or equal to 3.1.0.
Tools > Port and select the port connected to your GLYPH.
Tools > USB CDC on Boot > Enabled
If USB CDC on BOOT not enabled, you won’t be seeing any serial data on Arduino IDE.
-
Upload the Code
- Click the upload button (➡️ icon) or use the shortcut
CRTL + U in Arduino IDE to upload the code to the board.
Step 5: Observe the Output
The output shows the smoothed compass heading in degrees (0–360°) along with its cardinal direction (e.g., N, NE, E, SE, etc.).
Might not have accurate reading as this was not the intended purpose, This module is very useful to find strong magnetic field in 3 dimensional space.
QMC6309 with oled
Step 1: Hardware Required
- Glyph Boards
- QMC6309
- OLED Display
Step 2: Circuit Diagram
Step 3: Code Setup
- Open Arduino IDE.
- Make sure to install the “Audio Tool” library
- Copy and paste the following code into the Arduino IDE:
Step 4: Upload the Code
- Connect the Board
- Connect your GLYPH board to your computer
- Select the Board and Port
Do the following settings in your Arduino IDE,
Tools > Board > esp32 > Pcbcupid GLYPH C3
For the Pcbcupid Glyph C3 to appear under Tools > Board > esp32, the esp32 board version installed in the Arduino IDE should be greater or equal to 3.1.0.
Tools > Port and select the port connected to your GLYPH.
Tools > USB CDC on Boot > Enabled
If USB CDC on BOOT not enabled, you won’t be seeing any serial data on Arduino IDE.
-
Upload the Code
- Click the upload button (➡️ icon) or use the shortcut
CRTL + U in Arduino IDE to upload the code to the board.
Step 5: Observe the Output
outputs real-time X, Y, Z magnetometer readings as both serial text and dynamic bar graphs on an OLED, showing deviation from running average with percentage values.
