Author Topic: Hiking magnetometer - RM3100  (Read 432 times)

0 Members and 3 Guests are viewing this topic.

Offline RenateTopic starter

  • Super Contributor
  • ***
  • Posts: 1778
  • Country: de
    • Renate's Android Page
Hiking magnetometer - RM3100
« on: October 24, 2026, 07:22:59 am »
You probably have a phone with a magnetometer to tell compass direction.
If you're like me, you have probably run into times where the compass is pointing in the wrong direction (90 to 180° out).
You're probably saying, "Just calibrate it, where's the problem?"
The problem is that it always need calibrating and it hardly ever tells you that it needs it.

Android will tell you "low, medium, high quality" but the accuracy is rarely accurate.
My first attempt to fix the situation is to always monitor the absolute value of the field, i.e. sqrt(Hx*Hx + Hy*Hy + Hz*Hz).
This will tell you if you have a rogue external field or shielding or the offsets on the sensors has drifted out.
That's the root of the problem. Although the magnetoresistive sensors in your phone are sensitive they also drift like heck.

The obvious solution is to just drop $1000 on a flux gate compass. They're pretty good.
For a decade PNI Sensors has made the RM3100 sensor.
It's not a flux gate, but it is a related cousin. There is basically no drift.
You can get breakout boards from China or an evaluation board direct from PNI for $25.

My test solution is pairing the RM3100 with a Seeed Studios Xiao SAMD21 in a 30 x 100 x 14 mm 3D printed enclosure.
Yes, 100 mm is long, not because I need the internal space but because I want to center the sensor in the middle of my phone.
That way it's as far away from the top and bottom speakers.
I stuck the enclosure to the back of my phone using the Tesa black double-stick tape.
The USB Type C jack is at the bottom and can be connected to the phone with a special USB "U" plug.
I'll try to get a photo of the whole setup, but I can't do it with my phone!

I calibrated the fixed offsets from the magnet fields in the phone.
Both the X & Y had count offsets of 250 (3.3 µT).
The Z had a count offset of 1000 (13.3 µT).
The absolute value I measure of total compensated field is ~44 µT around here.

If I had another phone that I wanted to root I would try to wire the RM3100 directly into the phone's I²C.
That would definitely save some power and free up the USB jack.

Right now the RM3100 is used directly in my hiking app so it's not used by Google Maps.
There is no "mock location" possible for the magnetometer.

Anyone with any experience/notes on the RM3100?
 

Offline Henrik_V

  • Regular Contributor
  • *
  • Posts: 172
  • Country: de
  • “ground” is a convenient fantasy
Re: Hiking magnetometer - RM3100
« Reply #1 on: Yesterday at 08:24:23 am »
use a good old compass if you need reliability.
use a fiber gyro if you need to know north. (the better ones are able measure earth rotation)
Greetings from Germany
Henrik

The number you have dialed is imaginary, please turn your phone 90° and dial again!
 

Offline RenateTopic starter

  • Super Contributor
  • ***
  • Posts: 1778
  • Country: de
    • Renate's Android Page
Re: Hiking magnetometer - RM3100
« Reply #2 on: Yesterday at 09:06:38 am »
Yes, but the gyro is just being integrated as a convenience, not a necessity.
The magnetometer (resolved by fusing the acceleration of gravity) is telling you where north is.

I can set my app to only use the gyro.
I rotate my device 90° and see if the display moves more or less than 90°.
Then I can adjust the gain in the integrator.
It's absolutely not critical.

With the gyro, magnetometer and accelerometer working a quick rotation will slew to the correct heading, possibly with minor catching up from the magnetometer if the gain/integration of the gyro wasn't perfect.

A handheld compass is good, but it won't tell you if the magnet field is totally wacko.
Try using one on an electric train with overhead wires.

I'm still comparing the stock magnetometer to my add-on RM3100.
Yes, internal is accurate if you just calibrated it.
On my desk trying the internal out of the blue it was measuring 120 µT.
Sure, a calibration brought it down to 48 µT,
But there is no warning from Android, it still marks it as high accuracy.
 

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 4586
  • Country: gb
Re: Hiking magnetometer - RM3100
« Reply #3 on: Yesterday at 11:44:21 am »
great idea ,until yer stuck in the mountains with no signal and no battery left.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->