MAG3110 output values

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MAG3110 output values

2,861 Views
nicolasdecroze
Contributor I

Hello,

I try to use MAG3110 sensor with an arduino due board.

I have a question about the output values and the link with RAW bit in crtl_reg2.

My configuration :

     crtl_reg1 = 0xC9

     OFF_X register = 0x00

     OFF_Y register = 0x00

     OFF_Z register = 0x00

When i "test" with a small magnet i have :

  • If RAW bit is 1 (ctrl_reg2 = 0xA0), the output values i have are between -32768 LSB and +32767 LSB.
  • If RAW bit is 0 (ctrl_reg2 = 0x80) the output values i have are still between -32768 LSB and +32767 LSB.

I don't really understand what is the effect of RAW bit...

When RAW bit is 1, the output values souldn't be between -20000 LSB and +20000 LSB?

Many thanks for help.

regards.

Labels (1)
0 Kudos
Reply
10 Replies

1,474 Views
david_diaz
NXP Employee
NXP Employee

Hello Nicolas,

I glad you find useful the Bare Metal example project.

Thank you very much for your input. I have solved the problem.

FreeMaster.jpg

I made a mistake configuring the variables at the FreeMASTER project. Please download the file again.

Have an excellent day.

David

0 Kudos
Reply

1,474 Views
nicolasdecroze
Contributor I

Hello David,

No problem :smileyhappy:

Last question, if you approach a magnet in front of the sensor, for example on the Z axis (see photo below)

The saturation value is +/- 32768 LSB => 3276,8µT => 3,2768mT ?

Is that ok?

Have an excellent day.

Nicolas DECROZE.

IMG_4995.JPG

0 Kudos
Reply

1,474 Views
david_diaz
NXP Employee
NXP Employee

Hello Nicolas,

The strength of a typical refrigerator magnet is about 5mT. I assume your output reading is correct.

Based on the example mentioned before, please note that the first time you power on the board, the sensor launches a calibration procedure to correct measured magnetic fields and well estimate the output.

In this case, to calibrate the sensor, I recommend to make a full rotation with the magnet (doesn’t bother the rotation direction).

When the calibration is over and finalized, the red LED is turned off and a green LED appears.

I hope this information will be useful for you.

If I misunderstood your question, feel free to let me know.  I will be glad to help.

Have a great day.

David Diaz.

Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos
Reply

1,474 Views
nicolasdecroze
Contributor I

OK David many thanks for your help.

My problem is that i did not understand the +- 1000µT full scale range of the datasheet.

For me the sensor could only measure 1000µT Max but this is not the case.

If i understand well, it is possible to measure more than 1000µT it depend of the user define offset and zero-flux offset values.

Have a great day.

best regards.

Nicolas DECROZE

0 Kudos
Reply

1,474 Views
david_diaz
NXP Employee
NXP Employee

Hello Nicolas,

Indeed, the MAG3110 is designed to work in a range of +/- 1000 μT. Going beyond this value can cause stress on the device causing a permanent damage to the device.  Please be aware about this situation.

Accept my apologies for the confusion.

Regards,

David

0 Kudos
Reply

1,474 Views
nicolasdecroze
Contributor I

Hello David,

Permanent damages are not defined by the absolute maximum ratings?

The value in the datasheet is 100000µT (100mT) in the absolute maximum ratings tab.

If after 1000µT it may cause permanent damage it is a bad news for me because magnetic field in my application can reach around 4mT...

Regards,

Nicolas DECROZE

0 Kudos
Reply

1,474 Views
david_diaz
NXP Employee
NXP Employee

Hello Nicolas,

Based on the MAG3110 datasheet , the RAW bit is used to correct, or not, the output data value using the user offsets.

The user offsets are automatically subtracted by the MAG3110 logic when CTRL_REG2[RAW] = 0 before the magnetic field readings are written to the data measurement output registers OUT_X/Y/Z.

In this case, as you are writing 0x00 to the user offset registers, you are not capable to see any correction at the output value. You may write any other value than 0.

If you write any other value to the user offset registers with CTRL_REG2[RAW] = 0, the correction will be done automatically.

Please let me know any update about your application.

If I misunderstood your question, feel free to let me know.  I will be glad to help.

Have a great day.

David Diaz.

Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos
Reply

1,474 Views
nicolasdecroze
Contributor I

Hello David,

Many thanks for your reply, it is more clear for the user offsets.

I understand how the user offsets works but i have one more question.

I don't really understand the link between output values i have and magnetic field values in µT.

Let me explain :

I made two tests with a magnet (cylinder 5*5mm ferrite)

First test without user offsets :

(Z axis for example) The max output values are +/- 32768 LSB => 32768*0.1µT = 3276.8µT

Second test with user offsets : (measurements of value without correction and after correction to have X,Y and Z values around 0 LSB).

(Z axis for example) The max output values are +/- 32768 LSB => 32768*0.1µT = 3276.8µT

(In the two cases i did not measure the distance between magnet and sensor who is not the subject for the moment)

I' don't really understand the link between output values which can reach +/-32768 and the full scale range who is +/- 1000µT.

What is the magnetic field value in µT when output values is, for example, 32768 LSB?

Many thanks for your help.

Best regards.

Nicolas

0 Kudos
Reply

1,474 Views
david_diaz
NXP Employee
NXP Employee

Hello Nicolas,

Please accept my apologies for the delay.

In this case you should, review the manner in which you are writing to the Offset Registers.

In order to do that, you may refer to the MAG3110 – Bare metal example project.

Please let me know if despite this material you still have the same output. I am glad to help.

Have a great day.

Regards,

David

0 Kudos
Reply

1,474 Views
nicolasdecroze
Contributor I

Hello david,

Many thanks it is more clear.

One more question.

In your example, I can't find the link between Xout_16-bit (61552 DECIMAL) and Xout_ut (-671.6 uT). (surrounded in red on the picture below).

If i follow your source code, i found -3984 DECIMAL and -398.4 uT.

Is there a problem in my conversion?

MAG3110.png

Many thanks for your help.

Nicolas DECROZE

0 Kudos
Reply