Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›Adafruit MMC5603, SparkFun MMC5983MA

Component guide · Intermediate · 3 min read

Adafruit MMC5603, SparkFun MMC5983MA, Adafruit TMAG5273 3D Hall

and Digilent Pmod CMPS2 Magnetometers

By Geekobot Learning Team · Updated 29 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWhat the MMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometers isMMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometers pinoutWiring the MMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometersExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Short answer

These boards measure magnetic field in three axes. The MEMSIC MMC5603 and MMC5983MA are precise, low-noise compass sensors with a set and reset feature that removes offset. The TI TMAG5273 is a 3D Hall sensor for strong fields from nearby magnets, used for joysticks, knobs and position sensing. The Digilent Pmod CMPS2 is a compass module for FPGA and microcontroller boards.

Key specs at a glance

Range
±30 gauss (MMC5603), ±8 gauss (MMC5983MA), ±133 or 266 mT (TMAG5273)
Resolution
Up to 18-bit (MMC5983MA)
Interface
I2C (SPI on MMC5983MA)
Supply
3.3 V logic (Qwiic and STEMMA QT boards)
Data rate
Up to 1 kHz
Use
Compass, magnet position, current sensing

Models in this guide

These are alternatives. Pick the one that fits your project; you only need one.

  • Option 1Adafruit MMC5603 Triple-Axis Magnetometer Sensor – I2C/SPI Interface, STEMMA QT₹1,009
  • Option 2SparkFun Micro Magnetometer Breakout – MMC5983MA, Compass Sensor (Qwiic)₹2,566
  • Option 3Adafruit TMAG5273 (A2) 3D Hall Effect Magnetometer – ±133mT / 266mT – STEMMA QT₹939
  • Option 4Digilent Pmod CMPS2 3-Axis Digital Compass Module – I2C Interface₹1,189
01

What the MMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometers is

The MEMSIC MMC5603 and MMC5983MA are high-precision 3-axis magnetometers for digital compasses, drones and position sensing, with I2C or SPI.

Compass sensors measure the weak Earth field (about 0.5 gauss), so any nearby steel or magnet shifts the reading. The set and reset pulses on MMC parts cancel the sensor's own offset, but you still need hard and soft iron calibration for your device.

The TMAG5273 is the opposite: it is for strong nearby magnets, such as a magnet on a joystick or rotary knob.

02

MMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometers pinout

The pins on the MMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometers and what each one does.

PinFunction
VIN / 3V3Supply
GNDGround
SCL / SDAI2C
INTInterrupt (some boards)
PinFunction
VIN / 3V3
Supply
GND
Ground
SCL / SDA
I2C
INT
Interrupt (some boards)
03

Wiring the MMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometers

STEMMA QT and Qwiic boards plug in with one cable and have level shifting where noted.

MMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometers pinArduino UnoESP32
VCC5V (or 3.3V)3V3
GNDGNDGND
SDAA4GPIO 21
SCLA5GPIO 22
VCC
Arduino Uno:
5V (or 3.3V)
ESP32:
3V3
GND
Arduino Uno:
GND
ESP32:
GND
SDA
Arduino Uno:
A4
ESP32:
GPIO 21
SCL
Arduino Uno:
A5
ESP32:
GPIO 22
04

Example code

Heading here assumes the board is level; use an accelerometer for tilt compensation. Use SparkFun's MMC5983MA and Adafruit's TMAG5273 libraries for those boards.

Read the MMC5603 (Adafruit MMC56x3 library) · Arduino C++Verify & upload in Electrolark
#include <Adafruit_MMC56x3.h>

Adafruit_MMC5603 mag(12345);

void setup() {
  Serial.begin(115200);
  if (!mag.begin(MMC56X3_DEFAULT_ADDRESS, &Wire)) { Serial.println("MMC5603 not found"); while (1); }
}

void loop() {
  sensors_event_t e;
  mag.getEvent(&e);
  float heading = atan2(e.magnetic.y, e.magnetic.x) * 57.3;
  if (heading < 0) heading += 360;
  Serial.printf("x %.1f y %.1f z %.1f uT  heading %.0f\n", e.magnetic.x, e.magnetic.y, e.magnetic.z, heading);
  delay(200);
}
05

Setup and tuning

Wiring

VCC 3.3 V (1.8 V core on some), GND, SDA and SCL or SPI.

Library

use the Adafruit MMC56x3 or SparkFun MMC5983MA library.

SET/RESET

use the built-in set/reset pulses to remove offset.

Calibration

rotate in all directions to find hard-iron offsets.

Placement

keep away from motors, magnets and steel.

06

What you need

Shop this list6 of 7 found in our store · ₹10,687

  • Adafruit MMC5603 Triple-Axis Magnetometer Sensor – I2C/SPI Interface, STEMMA QT: the part this guide coversAdafruit MMC5603 Triple-Axis Magnetometer Sensor – I2C/SPI Interface, STEMMA QT₹1,009
  • SparkFun Micro Magnetometer Breakout – MMC5983MA, Compass Sensor (Qwiic): another version this guide coversSparkFun Micro Magnetometer Breakout – MMC5983MA, Compass Sensor (Qwiic)₹2,566
  • Adafruit TMAG5273 (A2) 3D Hall Effect Magnetometer – ±133mT / 266mT – STEMMA QT: another version this guide coversAdafruit TMAG5273 (A2) 3D Hall Effect Magnetometer – ±133mT / 266mT – STEMMA QT₹939
  • Digilent Pmod CMPS2 3-Axis Digital Compass Module – I2C Interface: another version this guide coversDigilent Pmod CMPS2 3-Axis Digital Compass Module – I2C Interface₹1,189
  • ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
  • Uno R3 development board: the controller used in the wiring tableFind this part
  • Adafruit BNO055 9-DOF fusion breakout: orientation without your own filterAdafruit BNO055 9-DOF Absolute Orientation IMU Fusion Breakout – STEMMA QT / Qwiic₹4,595Closest match, check the specs
07

Alternatives and when to choose them

  • ✓QMC5883L: low-cost GY-271 compass.
  • ✓LSM303 e-compass: adds tilt compensation.
  • ✓Hall effect sensors: simple magnet switches.
08

Common mistakes to avoid

  • !Mounting near motors.
  • !Skipping calibration.
  • !Using 5 V logic.
  • !Ignoring tilt.
09

Frequently asked questions

Why is my compass heading wrong?

It needs hard-iron calibration; rotate it in all directions away from metal and magnets.

What does SET/RESET do?

It removes sensor offset and restores sensitivity after strong fields.

Can it measure heading when tilted?

Yes, if you combine it with an accelerometer for tilt compensation.

Which is more precise?

The MMC5983MA, with lower noise and 18-bit output, suits precise compasses.

Is it 5 V tolerant?

No. Use 3.3 V power and logic, with level shifting for 5 V boards.

Parts for this guide

  • Adafruit MMC5603 Triple-Axis Magnetometer Sensor – I2C/SPI Interface, STEMMA QT
    ₹1,009View
  • SparkFun Micro Magnetometer Breakout – MMC5983MA, Compass Sensor (Qwiic)
    ₹2,566View
  • Adafruit TMAG5273 (A2) 3D Hall Effect Magnetometer – ±133mT / 266mT – STEMMA QT
    ₹939View
  • Digilent Pmod CMPS2 3-Axis Digital Compass Module – I2C Interface
    ₹1,189View
  • ESP32-WROOM-32 38-Pin Development Board
    ₹389View
  • Uno R3 Development Board (No Cable)
    ₹359View
  • Adafruit BNO055 9-DOF Absolute Orientation IMU Fusion Breakout – STEMMA QT / Qwiic
    ₹4,595View
Shop Accelerometers, Gyroscopes & IMUs

Keep learning

Component guideIntermediateQMC5883L Compass Module (GY-271)The QMC5883L is a 3-axis magnetometer that measures the Earth's magnetic field to give a compass heading.3 min read · SensorsComponent guideIntermediateHMC5883L Compass ModuleThe HMC5883L is a 3-axis digital compass from Honeywell that reports the magnetic field over I2C at address 0x1E.3 min read · SensorsComponent guideIntermediateMagnetometers and 9-Axis IMUsA 9-axis IMU adds a magnetometer to a gyroscope and accelerometer so it can give a stable heading as well as roll and pitch.3 min read · Sensors

Sources

  • MEMSIC MMC5603 and MMC5983MA datasheets
  • TI TMAG5273 datasheet
  • Digilent Pmod CMPS2 reference

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the MMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometers isMMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometers pinoutWiring the MMC5603, MMC5983MA, TMAG5273 and Pmod CMPS2 magnetometersExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide (Arduino Uno)3 items · ₹2,402

Adafruit MMC5603 Triple-Axis Magnetometer Sensor – I2C/SPI Interface, STEMMA QT · Digilent Pmod CMPS2 3-Axis Digital Compass Module – I2C Interface · Uno R3 CH340G ATmega328p Compatible Development Board

Run itChange the inputs and watch the output

Earth's field is about 40 to 50 uT in India. Heading assumes the board is flat.

Serial monitor115200 baud
x 27.6 y 15.8 z -28.4 uT  heading 30

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question