Notifications
Clear all

How to with 3 axis compass magnetometer module

9 Posts
4 Users
3 Reactions
662 Views
robotBuilder
(@robotbuilder)
Member
Joined: 6 years ago
Posts: 2337
Topic starter  

Hi all,

I recently bought the module pictured below but can't find any tutorial on how to wire it up and any code to use it. Hoping someone might read this and know how or have a link that might provide the information I need to use it.

Thank you.

compass3axis

 

 

 


   
Quote
THRandell
(@thrandell)
Brain Donor
Joined: 4 years ago
Posts: 283
 

@robotbuilder

You’re a little light on details about your breakout board.

Back in 2018 I bought this 3-axis magnetometer from Pololu https://www.pololu.com/product/2127  It wasn’t exactly a great match with my phone’s compass, but it was fun to use.  As I recall, I would never have been able to figured out how to use it without the Arduino library that they supplied.  I’ve learned alot about using sensors and microcontrollers from their libraries.  You might want to check them out.

Tom

To err is human.
To really foul up, use a computer.


   
Ron reacted
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 6 years ago
Posts: 2337
Topic starter  

@thrandell 

That is all the details I have. I will check with Jaycar. Sometimes there is a techie there that may be able to help.

It is from Duinotech.

3 axisCompass1
3 axisCompass2

 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 4 years ago
Posts: 2602
 

@robotbuilder 

That kinda looks like Amazon's "https://www.amazon.ca/DKARDU-QMC5883L-Compass-Magnetometer-Electronic/dp/B09F3LHNB3"

In which case the Arduino library might be relevant ...

https://github.com/mprograms/QMC5883LCompass

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
THRandell
(@thrandell)
Brain Donor
Joined: 4 years ago
Posts: 283
 

Wow @will, that’s pretty impressive sleuthing!

To err is human.
To really foul up, use a computer.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 6 years ago
Posts: 2337
Topic starter  

@will 

Thanks for the find Will.

https://github.com/mprograms/QMC5883LCompass/?tab=readme-ov-file

I wired it up to the Mega but all I get is zeros and a heading N.

The TX led on the Mega flashes away.

I triple checked the wiring 🙂

VCC O ---- O +5v
GND O ---- O GND
SCL O ---- O A5
SDA O ---- O A4
DRDY O ---- X NOT CONNECTED

When I clicked for,
Board Hookup Reference
QMC5883L hookup to Arduino Uno / Nano. For other boards see Arduino Wire Reference

I get an error.

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>B77FRFMD5MHRYS1J</RequestId>
<HostId>2EvuuKessSVW8A6ZwP4jQPn0NZ8bT1QP9f+TJcs8ePp0uiyrLDHNpmTEb7s222LNcNiNUG7Ndl6btaAqcnaUEnVA4zeQwkNV</HostId>
</Error>

 


   
ReplyQuote
Lee G
(@lee-g)
Member
Joined: 4 years ago
Posts: 82
 

@robotbuilder 

Which driver are you using for this?  You might try the Arduino-HMC5883L driver. Apparently there is a difference between the QMC5883 driver and this HMC5883L driver. This one might work. (No guarantees!)

Regards,


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 6 years ago
Posts: 2337
Topic starter  

@lee-g 

The HMC5883L is very different in appearance.

I installed and included this driver as per code example.

#include<QMC5883LCompass.h>
 
 

   
ReplyQuote
Lee G
(@lee-g)
Member
Joined: 4 years ago
Posts: 82
 

@robotbuilder 

OK, sorry. I was looking at reviews on Amazon.com for a Hiletgo QMC5883 board that looks similar to the one you showed, and they were talking about how the drivers were different. This library worked, where the QMC5883 driver didn’t.

Have a good day.


   
ReplyQuote