QMC5883L Compass Module – 3-Axis Magnetic Sensor I2C for Arduino
QMC5883L Compass Module – 3-Axis Magnetic Sensor I2C
The QMC5883L is a 3-axis magnetometer sensor module that provides compass heading and magnetic field strength via I2C communication, compatible with Arduino, ESP32, and Raspberry Pi boards.
Key Specifications
| Operating Voltage | 3.3V – 5V DC (onboard LDO regulator) |
| Current Consumption | less than 1 mA in active mode |
| Sensing Range | ±2 gauss / ±8 gauss (configurable) |
| Resolution | 16‑bit per axis (0.15 µT/LSB at ±2 gauss) |
| Interface | I2C, default address 0x0D |
| Output Data Rate | up to 200 Hz |
| Module Dimensions | ~13 mm × 13 mm |
What You Can Build With This
- Digital Compass Display: Connect an Arduino, QMC5883L, and an OLED screen to show live heading in degrees – perfect for first-time sensor projects.
- Wireless Heading Logger: Use an ESP32 to read magnetic field data and transmit it over WiFi to a cloud dashboard for remote monitoring.
- Robot Orientation Tracker: Attach the module to a Raspberry Pi‑powered robot, combine with Python scripts, and log tilt‑compensated yaw angles.
- Magnetic Field Mapper: CBSE / ATL students can map the magnetic environment of a classroom, detect metallic objects, and learn about soft and hard iron distortions.
- Indoor Positioning System: For B.Tech or Smart India Hackathon, implement magnetic fingerprinting to estimate indoor location without GPS.
Compatibility
| Platform | Compatible | Connection | Library / Method |
|---|---|---|---|
| Arduino Uno R3 | Yes | SDA → A4, SCL → A5 | Wire.h, QMC5883LCompass |
| Arduino Nano | Yes | SDA → A4, SCL → A5 | Wire.h, QMC5883LCompass |
| Arduino Mega 2560 | Yes | SDA → 20, SCL → 21 | Wire.h, QMC5883LCompass |
| ESP8266 NodeMCU | Yes | SDA → D2 (GPIO4), SCL → D1 (GPIO5) | Wire.h, QMC5883LCompass |
| ESP32 Dev Board | Yes | SDA → 21, SCL → 22 (default) | Wire.h, QMC5883LCompass |
| Raspberry Pi Pico | Yes | SDA → GP0, SCL → GP1 | MicroPython machine.I2C, custom driver |
| Raspberry Pi 4 / 5 | Yes | SDA → GPIO2 (pin 3), SCL → GPIO3 (pin 5) | smbus2 / python‑smbus, QMC5883L library |
Wiring and Interface Notes
Connect VCC to 3.3V (the onboard regulator allows 5V input, but I2C lines are already 3.3V‑tolerant), GND to ground, and SDA/SCL to the corresponding microcontroller pins. Add 4.7 kΩ pull‑up resistors on the I2C lines if your board doesn’t include them. On Raspberry Pi, enable I2C via raspi‑config and install python3‑smbus for quick testing.
Frequently Asked Questions
Is the QMC5883L directly interchangeable with the popular HMC5883L?
No, although the pinout is identical, the internal registers and data format are different. You must use a dedicated library such as “QMC5883LCompass” by keepworking for correct readings.
Can this module work reliably near large metal objects or strong magnets?
Yes, but nearby ferrous materials will distort the magnetic field and reduce accuracy. Always perform a hard‑ and soft‑iron calibration routine before use.
What you can build with this
Shipping Information
- Prepaid Orders: ₹75 for orders up to ₹999, FREE shipping above ₹999
- COD Orders: ₹125 shipping + ₹50 COD fee = ₹175 total
- Delivery Timeline: Dispatch in 1-2 days, delivery in 2-7 days depending on location
Returns & Warranty
- 7-Day Return: Manufacturing defects only (approval required)
- Warranty: 7 days from delivery
- Non-Returnable: Batteries, consumables, cut wires, clearance items