Page 1 of 1

HMC6352 Compass with I2C interface

Posted: Mon Jul 26, 2010 6:40 pm
by Harry Tuttle
HMC6352 Compass with I2C interface

Lost your direction? Why not try out the Honeywell HMC6352 Compass Module?

You can buy the HMC6352 ready mounted on a Sparkfun breakout board, all you have to do is solder on header pins or wires and connect the usual I2C pullup resistors (Pin outs are the same as the blinkM in my previous post)
The module returns the heading in tenths of a degree, 0 to 3599 in two bytes.

See data sheet for full details:
http://www.magneticsensors.com/datasheets/HMC6352.pdf

The programme is as simple as possible and is intended as a beginners starting point:
Main sets up the LCD on PORT A, the I2C interface and sets the address variables of the HMC6352 .
Then a loop is started to read the heading , combine the two bytes and then display the formatted result on the LCD display.
Compass.fcf
(9 KiB) Downloaded 553 times

Re: HMC6352 Compass with I2C interface

Posted: Wed Jul 28, 2010 8:43 am
by Benj
Thanks for that Harry,

Looks like a great project, a digital compass is something I've been wanting to have a play with for a while.

Many thanks for sharing with the forum.