HM55B Compass Module

Materials list
1) The HM55B Compass Module.
2) Microcontroller and a way to program it - I used a PIC18F6722 dev board.
3) Way to wire the circuit - I used jumper wires and a solderless breadboard.

Design details

Overall the Hitachi HM55B compass module works great. Interfacing the compass with my microcontroller was simple, but writing the compass driver took a lot longer than I thought it would. Parallax has an example program for the Basic Stamp microprocessor, but since I'm using the PIC CCS C compiler I needed to get it running on my platform. I originally thought I'd just port over their Basic Stamp software, but there were significant differences in how the languages worked and the capacities they exposed so I ended up writing my own software. My software calibrates the compass to north and then displays the angle in degrees from north you are currently pointing. The calibration could be improved on to get more accurate results but in its current state the accuracy of the compass is good enough for me.

Here is the souce code: source code
Here is the circuit diagram: HM55B
Here are some pictures: Pic 0, Pic 1

Please email any questions/comments/errors to