No negative Data on BMM350

Hi,

I am using a BMM350 and I am struggling to understand the data I get. According to the manual, the data in the registers are signed integers ("Data registers for X,Y and Z magnetic channel and temperature channel provide data in 24bit registers in 21bit signed-integer format (21LSBs used)").

For a signed integer I would expect for positive values to start with 0 and for negative values to start with 1. Furthermore I would exspect that turning the sensor by 180° would change the sign of the measurement, turning a positive into a negative reading and vice versa. Please comment if I made any wrong assumptions up to this point.

When using the sensor I always get positive readings and the MSB-byte is always zero. Based on above understanding I would expect to be able to turn a positive reading into a negative one by turning the sensor upside down and then the MSB-byte should contain a different value then zero. This is true for all three axis.

Thanks for helping

Best reply by FAE_CA1

Hi,

BMM350 raw data doesn't give you useful information. You need to use API to convert the raw data to meaningful magnetic field values in the unit of uT.

If you log BMM350 data in the unit of uT and rotate BMM350 in 3D space randomly, you can then plot BMM350 x/y/z data in 3D. If the sphere or ellipsoid is located in the first quadrant, then all BMM350 x/y/z data will be positive due to the offsets or hard-iron effects.

If you want to see negative magnetic field values, you can use a magnet to approach to BMM350 to change the offsets.

Thanks.

View original
6 replies