Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: airman00 on May 09, 2009, 11:16:43 AM

Title: Hacking NXT Compass Sensor
Post by: airman00 on May 09, 2009, 11:16:43 AM
In my quest for an accurate compass I found this - http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NMC1034 (http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NMC1034)
(http://www.hitechnic.com/PDGImages/Mindstorms%20Compass.jpg)
Quote
The NXT Compass Sensor is a digital compass that measures the earth's magnetic field and outputs a value representing the current heading. The magnetic heading is calculated to the nearest 1° and returned as a number from 0 to 359. The NXT Magnetic Compass Sensor updates the heading 100 times per second.

From the documenation it seems like plain old I2C communication, so it should work fine with microcontrollers like the Axon. Anyone have any experience with hacking the NXT protocol? Any tips or tricks?

Or , does anyone know of a compass which has 1° accuracy that has a different interface?
Title: Re: Hacking NXT Compass Sensor
Post by: hazzer123 on May 09, 2009, 11:28:30 AM
I'm using this one (http://www.sparkfun.com/commerce/product_info.php?products_id=7915) quite successfully. Simple I2C interface and it reports an angle in decidegrees. To get 1 degree accurate readings you would need to mount it so that it was always flat. Any small tilts throw the readings off quite a bit.

Title: Re: Hacking NXT Compass Sensor
Post by: Admin on May 30, 2009, 07:24:50 AM
If you really want accuracy, you need tilt compensation.

http://www.sparkfun.com/commerce/product_info.php?products_id=8960 (http://www.sparkfun.com/commerce/product_info.php?products_id=8960)

(http://www.sparkfun.com/commerce/images/products/08960-04-L.jpg)