Sensor HMC5883L

Finally found some time to finalize my developments for the HMC5883L sensor.  At first it looked like an easy mission but I encountered some issues during development and testing.  Trying to follow litterally the operational example gave me problems getting the right values.  Finally after some trial and error I found out the way to go.  The datasheet is not written for software developers.  But that is a remark I can make for all datasheets I encountered.  But anyway it gives a great feeling once you reach that breakthrough and get the right readings.  You can find the most important information at HMC5883L.  I found the information about calculating the heading at Calculating Heading.

When you look at the sensor you see an X and Y axis.  The angle calculated is the angle between the geographic north and the X axis shown on the sensor.  Well at least it is how I interprete it with the received readings.  I did not go into detail on the Z axis readings.


Leave a Reply