View Single Post
Posts: 4 | Thanked: 3 times | Joined on Sep 2009
#44
I don't know if there is continuing interest in this topic, but I can contribute a few bits of information and opinions.

NXP has a decent application note on building an electronic compass:
http://www.nxp.com/acrobat_download/...22_COMPASS.pdf

Note that to do tilt compensation you'll either have to combine magnetic field data from the magnetic sensors with tilt information from the N900's accelerometers or just put a 3-axis accelerometer on the external board. Assuming that there is access to raw 3-axis tilt info, the former is obviously preferable cost-wise (an ADXL320 runs $15 in single quantities).

The Honeywell HMC5843 seems to be the best candidate for a three-axis magnetometer, since it handles temperature compensation and offset correction by itself. There exist cheaper magnetoresistive sensors, e.g., the KMZ51 and KMZ52 mentioned in the above app note, but then you also need a preamp, ADC, temperature sensor, et cetera. Beyond that, to get three axes out of the KMZ5x parts, we need to mount one of them perpendicular to the other!

If it's possible to connect the HMC5843 directly to an I2C bus on the N900, we're done with the hardware. Otherwise, it's USB or Bluetooth depending on what resources are available. There's a lot of rumor right now, so we'll probably have to defer this discussion until the phones are actually in our hands. Clearly, not having to add a microcontroller and its consequent cost and power draw to the bill would be preferable.

The software to actually produce a compass reading will take the magnetic and gravitational data and do some math to turn it into a heading. From there, you can even use GPS data to easily convert from magnetic north to true north if desired.
 

The Following 3 Users Say Thank You to kwantam For This Useful Post: