AnsweredAssumed Answered

Wrong magnetic values with LIS3MDL

Question asked by DAMIEN.DULAU on Feb 13, 2017
Latest reply on Feb 20, 2017 by DAMIEN.DULAU

Hello I don't understand why I get value  aroung 1.3 Gauss ?

Configuration :

   LIS3_CTRL_REG2 = 0x00;   // Full scale +/- 4 G

   LIS3_CTRL_REG1 = 0x1C;   // ODR=80Hz, XY LowPower

   LIS3_CTRL_REG4 = 0x00;   // Z LowPower

   LIS3_CTRL_REG3 = 0x00;   // Continuous-conversion mode

   LIS3_CTRL_REG5 = 0x40;   // BDU = 1

 

and I receive :

   LIS3_OUT_X_L = 0xEB

   LIS3_OUT_X_H = 0xEE

      => MagX = 0xEEEB = -4373

   LIS3_OUT_Y_L = 0x94 

   LIS3_OUT_Y_H = 0x07

      => MagY = 0x0794 = 1940

   LIS3_OUT_Z_L = 0x4A 

   LIS3_OUT_Z_H = 0x1E

      => MagZ = 0x1E4A = 7754

 

Magnetic calculation : Mg = sqrt ( MagX*MagX + MagY*MagY + MagZ*MagZ ) / 6842  = sqrt ( 83011245) / 6842

                                    Mg = 9111,05 / 6842 = 1.33 Gauss ????

 

I get this value with 2 Lis3mdl and same code.

This result seems to be wrong ? Normaly I should get something around 0.5 Gauss isn't it ?

Is there anything bad in my logic ?

 

Thx for your help

Outcomes