HMC5883 3-Axis Compass launched.
We haven't had a compass sensor since the chip on our last one went extinct (or at least was unavailable). We spun a board with a late model and very affordable Honeywell 3-Axis HMC5883 chip. It's a three axis chip but only the x & y axis are normally used for a normal compassing function - with the sensor held fairly level. For a tilt-free compass you need to add an accelerometer and then use the information from the Z channel (and some trig) to find the direction vector. The code is pretty simple.
We used our analog accelerometer and were able to configure the compass within about +-7 degrees while tilting it up to 45 degrees up or down. This was without a lot of calibration of the accelerometer so with some trickier math it should be easy to make a compass that is tilt resistant within about 3 or 4 degrees I'm guessing.
We've got two great app notes up on the site and will have some more soon. In the meantime, I'm putting 15 sensors up on the site for free. Just use the code "compass" (all lower case) and the first ten people who check out with one in their cart will get one free. One to a customer please.
Enter code: compass (lower case)
Written by Paul Badger on June 08, 2011