Compass test

For the navigation of my robot I want to use the CMPS03 Compass Module from Devantech ( This module has an I2C interface so it would be easy in combination with the USB-I2C interface ( I use.


To test this setting I made a simple wooden board with those two components on it. After connecting both modules I installed the driver for the USB-I2C module on my windows machine. No problems with that.

To test the working of the setup I used the I2C interface tool provided by Devantech. The configuration of reading the CMPS03 registers with this program is available after installing. So far so good.

I saw that I got wrong readings because not all numbers of the full circle came through. This was caused by the metal bolts and nuts I used to fix the CMPS03 module to the wooden board. They where a little bit magnetic. On the picture you see the solution for this problem with tie-raps and the wall plugs.


The screenshot shows the result of using the I2C interface tool from devantech. I am planning only to use register 1. This register represent the 360 degree in a single byte. The value from 0 till 255 should be accurate enough for the robot right now.

The software for this test was written in C++ and is running on a linux (Ubuntu) OS. Thanks to the information on from Christopher Friedt I managed to make it work. The code from Christopher was easy to change to meet my own needs.

You can find the code here: compass.