Tangible compass, part 1: getting the basics to work

2008 November 24

The main component for this little experiment is a HMC6343 compass module with tilt compensation (from Honeywell, datasheet). This little IC is great because you can tilt and hold it on the side and the heading will be right. Regular compass modules just failed when there are not totally held flat. I help some colleagues of mine over the year and getting a workable heading value in a handheld prototype was totally not feasible (ref. Kristofer’s and Fabricio’s degree projects).

So this little module outputs values over I2C and it proved to be relatively simple to interface with a regular Arduino. The only thing to remember is that the Arduino talks I2C on specific pins: analog inputs 4 (SDA) and 5 (SCL).

What it does: The servo points in a particular direction (the door in the back) and as you rotate the base (cart on wheels), it keeps pointing in the specified direction. It works also with the compass tilted on the side.

Next step: use a continuous rotation servo or a stepper motor as the servo is now limited to 180 degrees of rotation.

Current (hacked) Arduino source code (largely derived from Mathieu Glachant’s work): hmc6343_01

Comments are closed.