Shop OBEX P1 Docs P2 Docs Learn Events
What is your favorite I2C compass module? — Parallax Forums

What is your favorite I2C compass module?

Bill HenningBill Henning Posts: 6,445
edited 2014-11-03 09:20 in Robotics
Hi,

I am working on adding support for compasses to the RoboPi firmware and API (see http://www.mikronauts.com/raspberry-pi/robopi/ for more info). For those of you not familiar with it, RoboPi is Propeller based :-)

I am starting with the HMC6352 and HMC5883L based I2C compass modules as I have some kicking around my lab, but I thought I'd ask y'all for your favorite inexpensive I2C compass modules.

Thanks,

Bill

p.s.

No GPS modules, just compass modules please!

Comments

  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-11-02 21:48
    My favorite is a module (not sold by Parallax) that combines a 3-axis HMCXXXX magnetometer with a 3-axis accelerometer, and (using a built-in processor) returns the direction in degrees, tilt compensated. THAT is what people want (for robots anyway). What they get is a mishmash of breakout boards that seem to change all the time, output confusing raw data, and in general make us re-create the wheel over and over.

    I know you asked what our fav compasses are, but I kindly suggest that addresses the need part way. As you are developing this for an API, I wonder if it would be worthwhile to take 1 each (at most 2 each) of the most popular 3-axis compasses and accelerometers -- maybe the ones Parallax sells -- and do the tilt compensation and raw data crunching. The API returns tilt compensated degrees, 0 to 359. Everyone understands that result. People will opt for whatever product you've specified for the API if you do their work for them. They won't care if it's not their favorite. (The device should, however, be reasonably priced, and have good availability.)
  • DomanikDomanik Posts: 233
    edited 2014-11-02 22:11
    (using a built-in processor) returns the direction in degrees, tilt compensated. THAT is what people want (for robots anyway)

    +1 to that.

    Dom...
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-11-03 06:53
    Gordon, GREAT suggestion. I'll search for some likely candidates that integrate a magnetometer with a three axis accelerometer.

    Adding separate accelerometer support was already on the "to do" list, so adding the math for tilt compensated compass makes a TON of sense.

    There are tilt compensated compass modules out there, but they cost significantly more than non-tilt compensated magnetometer + accelerometer, and doing the work in the firmware makes a lot of sense.
    My favorite is a module (not sold by Parallax) that combines a 3-axis HMCXXXX magnetometer with a 3-axis accelerometer, and (using a built-in processor) returns the direction in degrees, tilt compensated. THAT is what people want (for robots anyway). What they get is a mishmash of breakout boards that seem to change all the time, output confusing raw data, and in general make us re-create the wheel over and over.

    I know you asked what our fav compasses are, but I kindly suggest that addresses the need part way. As you are developing this for an API, I wonder if it would be worthwhile to take 1 each (at most 2 each) of the most popular 3-axis compasses and accelerometers -- maybe the ones Parallax sells -- and do the tilt compensation and raw data crunching. The API returns tilt compensated degrees, 0 to 359. Everyone understands that result. People will opt for whatever product you've specified for the API if you do their work for them. They won't care if it's not their favorite. (The device should, however, be reasonably priced, and have good availability.)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-11-03 08:31
    As I mentioned on Let's Make Robots, I like the inexpensive HMC5883L modules. At close to $2 each, they're cheap enough to add to all your projects.

    As long as you establish what "level" is to begin with, you can can use the three axes readings to determine both your tilt and your heading.

    I've tried to figure out when an accelerometer would be needed to get a heading from a HMC5883L or other three axes magnetometer and I can only think of a few cases where one of the axes is aligned with the magnetic field when the magnetometer can't sense both heading and tilt at the same time. I'm not sure an accelerometer would help in these few extreme cases.

    I ought to clean up my object to read from the sensor to make it easier to integrate into other programs. As it is now, I believe my object while return both heading and tilt. I'll try to take a look at it today to make sure I'm remembering correctly.
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-11-03 09:20
    Thanks again Duane - I will take a close look at your object!

    I will definitely support the HMC5883 as its price is unbeatable, and the HMC6352 as I already have code for that. I'll dig around in my lab, I am pretty sure I have one or two I2C accelerometer modules already. If not, I'll order some :)

    I plan to also support I2C accelerometers later, however I don't plan API support for analog output accelerometers as they would chew up three of the eight ADC channels on RoboPi.
Sign In or Register to comment.