zeta_5416
Posts: 12
Joined: Wed Jul 01, 2015 5:43 am

What are the values returned by get_compass_raw measured in?

Wed Jul 01, 2015 9:35 pm

In the documentation for the Python Astro Pi API, it is stated that the values returned by get_compass_raw 'are Floats representing the magnetic intensity of the axis in teslas'.

Either my Sense HAT must be malfunctioning, or my local magnetic field is indeed ~7 times that required to levitate a frog.

I have ensured that there are no nearby devices which could possibly interfere with my results. Is this an error with the documentation? I am wondering whether the results are in fact supposed to be in milliteslas. Any clarification would be helpful.

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: What are the values returned by get_compass_raw measured

Thu Jul 02, 2015 10:29 am

I'll double check this.
You may find that the mag doesn't behave correctly until you've calibrated it. Make sure you note this post at the bottom.

zeta_5416
Posts: 12
Joined: Wed Jul 01, 2015 5:43 am

Re: What are the values returned by get_compass_raw measured

Thu Jul 02, 2015 6:27 pm

Hmm, I thought that I'd calibrated it. Not seen that final post which you referenced, but even after reinstalling and updating everything, then re-calibrating and placing RTIMULib.ini in /etc/, I am still getting mildly worrying results. After calibration, my local magnetic field strength is only ~4.5 times that required to levitate a frog now - so that's a bonus, I suppose.

By the looks of things, the results that I am currently getting should be in the order of magnitude of 10 to the -6 Teslas, so the documentation should probably specify microteslas (µT). Hope this helps.

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: What are the values returned by get_compass_raw measured

Mon Jul 06, 2015 9:50 am

We've just checked this out and the unit is indeed microteslas. Thanks for pointing this out.
P.S. The LSM9DS1 datasheet says gauss but this is converted by RTIMULib into microteslas before it's passed up to the Astro Pi library.

zeta_5416
Posts: 12
Joined: Wed Jul 01, 2015 5:43 am

Re: What are the values returned by get_compass_raw measured

Mon Jul 06, 2015 10:10 am

Thanks for the clarification.

Return to “Astro Pi”