element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sensors
  • Technologies
  • More
Sensors
Sensor Forum Help with 5883L crazyness.
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 16 replies
  • Answers 1 answer
  • Subscribers 342 subscribers
  • Views 3877 views
  • Users 0 members are here
  • 5883l
Related

Help with 5883L crazyness.

screamingtiger
screamingtiger over 10 years ago

shabaz

jw0752

 

I have collected data and cannot get it to point to the correct heading.  Its off quite a bit and I cannot adjust as the amount it is off is non-linear.  For example, at 0 degrees it shows 100 degrees.  But at 45 degrees it shows 170 degrees.  Z axis is level and remain constant for the most part.

 


Here is the data I collected, does it makes sense?  I used a compass on my phone and compared to the readings I am getting.

 

 

 

0 degrees North
X 0
Y 155
Z -530

 

Calculated heading: 100

 

 

90 degrees east

 

X -165
Y 100 (shouldn't this read 0 since it is pointing in same direction X was just at?)
Z -530
Calculated Heading: 224

 


180 degress South
X: 0
Y: -290
Z: -540

 

Calculating Heading: 286

 

 

 

270 degrees West

 

X: 250
Y: -100
Z: -550
Calculated Heading: 252

 


One thing I am thinking is odd, if at 0 degrees north X axis reads 0, if I rotate 90 degrees to right, would Y axis now read 0?

 

I am not sure what the axis is measuring, I thought it was force and it I point x axis in one direction, then Y axis in same direction, they would show the same reading...

 

X and Y are 90 degrees in parallel plane.
I ordered another magnometer hoping a different brand will help.  Its still 5883L but different maker of breakout.

  • Sign in to reply
  • Cancel

Top Replies

  • shabaz
    shabaz over 10 years ago in reply to screamingtiger +2
    Hi Joey, I took your code and added ALG_TEST stuff to it and modifying the declinationAngle variable: //#include "heading.h" #include <stdio.h> #include <iostream> //#include <wiringPi.h> //#include…
  • jw0752
    jw0752 over 10 years ago +1
    Hi Joey, This may be off base but if I treat your X and Y data as vectors and calculate Result = Sqrt( X^2 + Y^2) I get a Result that is at least in the ball park for the headings that you listed. Like…
  • jw0752
    jw0752 over 10 years ago +1
    Ok now you can see I really don't grasp it quickly as that is exactly what you were doing. No wonder my calculations matched yours. I will put my thinking cap back on and let you know if something better…
Parents
  • jw0752
    0 jw0752 over 10 years ago

    Is there a correction factor necessary for the angle of the Earth's magnetic field in your area?

     

    The Data Sheet mentions a calibration factor that can be calculated using the self test.

     

     

    HMC5883L 18 www.honeywell.com SCALE FACTOR CALIBRATION

     

     

     

     

     

     

    Using the self test method described above, the user can scale sensors’ sensitivity to match each other. Since placing device in positive bias mode (or alternatively negative bias mode) applies a known artificial field on all three axes, the resulting ADC measurements in data output registers can be used to scale the sensors. For example, if the expected self test value for X-axis is 766 and the actual value is 750 then a scale factor of (766/750) should be multiplied to all future readings of X-axis. Doing so for all three axes will ensure their sensitivity are well matched,

     

     

     

    The built-in self test can also be used to periodically compensate the scaling errors due to temperature variations. A compensation factor can be found by comparing the self test outputs with the ones obtained at a known temperature. For example, if the self test output is 750 at room temperature and 700 at the current temperature then a compensation factor of (750/700) should be applied to all current magnetic readings. A temperature sensor is not required using this method.

     

     

     

    John

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • screamingtiger
    0 screamingtiger over 10 years ago in reply to jw0752

    I'll check out the calibration, that may explain it.  I ordered another one of these since I already have 2 and one is completely junk.  So maybe 3rd time a charm?  Different brand though, same chip.

     

    The good news is that the chip is always the same, gives the same readings.  It just doesn't scale linear to the actual heading for an adjustment.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • screamingtiger
    0 screamingtiger over 10 years ago in reply to jw0752

    I'll check out the calibration, that may explain it.  I ordered another one of these since I already have 2 and one is completely junk.  So maybe 3rd time a charm?  Different brand though, same chip.

     

    The good news is that the chip is always the same, gives the same readings.  It just doesn't scale linear to the actual heading for an adjustment.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube