Saturday, 1 March 2014

MPU9150 vs HMC5883L: Trade-Off Analysis

Hello again!

As promised, here is the trade-off analysis comparing the magnetometer of the MPU-9150 chip, from Invensense, and the 3-axis digital compass HMC5883L, from Honeywell.

Our main doubt about the magnetometer of the MPU was the level of noise present in the measurements. The information was scarce (less than a third of a page in a 52 page document!) and we already knew the Honeywell sensor. So, as you saw in the last posts, we got a breakout of the MPU-9150 from Sparkfun and started measuring the magnetic fields around us!

The first thing to do was to calibrate both magnetometers at the same location. We did it in post processing and we are available to provide the calibration data, raw and already processed, if you would like it.

A point that became clear from the start was that the measurement range of the MPU magnetometer was not variable. We could not change it from the +-12 Gauss full scale! We no other choice, we left it as it was and set the HMC magnetometer to a full scale of +-1.3 Gauss. Our HMC magnetometer is inserted in a Mongoose board and we used this scale in other previous (unreported in the blog!) projects with good results.

From the start, we knew that the large measurement range could negatively impact the performance of the MPU's magnetometer. But one is only positive when something is actually tested!

The figure below illustrates the results of the calibrated data for both sensors during a static test. We subtracted the mean value of each axis so we could be compare them more easily.

As you can see, the noise intensity is much higher for the MPU magnetometer as its measurements envelope the ones from the HMC completely. The following table shows the standard deviation of the measurements on each axis, for the two devices. Remember that the test is a static one and all the variation seen is noise.

Standard deviation of the measurements, in milliGauss:
Standard deviation of the measurements, in % of FS:

Obviously, the standard deviation of the measurements of the MPU are larger, in terms of actual value in milliGauss, with an average of 10 mG, while the HMC presents noise with 2.5 mG average. However, if we look at the standard deviation as a percentage of the full scale of the sensors, we see a less intense noise from the MPU.

So, in conclusion, we decided to keep the HMC5883L 3-axis compass or get the HMC5983, which is basically the same sensor as the 58, but with a maximum output rate of 200 Hz (the one from the 58 is 75 Hz in continuous mode).

The MPU-9150, namely its magnetometer, does not meet our demands! It is a shame that the measurement range of the magnetometer cannot be changed to something less than 12 Gauss because we believe, from the results obtained, that the noise intensity and its accuracy would be better than the ones from HMC. In our opinion, the typical uses of this chip, namely in smartphones and tablets, requires the full scale to be large. This in order to coupe with the intense magnetic fields generated by the batteries and communication antennas. Another fallback, from our point-of-view, is the difficulty we found in communicating directly with the magnetometer. Since we are not interested in using the data fusion algorithms in the MPU chip, to be able to access the magnetometer data easily and fast is a very important factor to us.

We hope you find this analysis interesting and useful!


PS: Shortly, we will be posting a small video in which we show you how the difference in noise level between the devices influences the yaw determination. Keep an eye out! ;)


  1. Thank you for this helpful review.

  2. Can you please tell me, how can I calibrate an MPU 9150 magnetometer ?