Author Topic: Memsic i2c magnetic/(compass) sensor. What am I reading here?  (Read 3237 times)

0 Members and 1 Guest are viewing this topic.

Offline HSPalmTopic starter

  • Regular Contributor
  • *
  • Posts: 106
  • Country: no
Hi.
As my first post on this forum, I decided to ask for some help. I bought this
http://www.sureelectronics.net/goods.php?id=944 magnetic sensor from Sure Electronics because it was cheap and I wanted a way to learn i2c. Now I've setup up the i2c part, it's just that I don't know what the actual output of this thing is. I successfully read all 4 registers (x msb/lsb & y msb/lsb) and bit shifted them to two 12 bit  registers for output over UART.  The output on the x and y axes is changing between 0~300 when I turn the sensor module, BUT WHAT IS IT TELLING ME? The datasheet of the magnetic sensor chip is here http://gettheworkdone.net/images/NerdKits/Projects/I2C/Compass/MEMSIC%20documentation%201172-compass/MMC2120MG.pdf, I must be missing something.

Thank you!

Henrik
 

Offline armandas

  • Frequent Contributor
  • **
  • Posts: 336
  • Country: jp
    • My projects
Re: Memsic i2c magnetic/(compass) sensor. What am I reading here?
« Reply #1 on: June 22, 2011, 04:09:49 pm »
I haven't worked with magnetic sensors, but I would guess that you need to look at the specification table (as shown in the attached picture).

From what I understand, the output is biased at 2048 counts and will change with a (typical) rate of 512 counts/gauss. If you get 0 on the output, that would imply a magnetic field of |-2048 / 512| = 4 gauss.

I have no idea if this number makes any sense, and I might be totally wrong. Corrections are more than welcome!
 

Offline HSPalmTopic starter

  • Regular Contributor
  • *
  • Posts: 106
  • Country: no
Re: Memsic i2c magnetic/(compass) sensor. What am I reading here?
« Reply #2 on: June 22, 2011, 06:29:03 pm »
You were actually not far off at all. Memsic has released several application notes regarding their magnetic sensors, I got them in a zipped file from Sure Electronics download section, which describes how to properly take measurements, calibrate and calculate your correct values. It's an interesting read, and you learn a lot about how magnetic sensors works
http://www.sure-electronics.net/download/index.php?name=DC-SS503&type=0
 

Offline RayJones

  • Frequent Contributor
  • **
  • Posts: 490
    • Personal Website
Re: Memsic i2c magnetic/(compass) sensor. What am I reading here?
« Reply #3 on: June 22, 2011, 08:49:46 pm »
I'd suspect you are receiving X and Y components, which when put together can create a vector.

Using trigonometry (arctan2) you can then determine the angle of this vector. and hence direction?
The magnitude of the vector would then be the flux density.

You cannot simply use one component alone to determine the flux density.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: Memsic i2c magnetic/(compass) sensor. What am I reading here?
« Reply #4 on: June 22, 2011, 09:08:50 pm »
assuming you read it correctly. were you measuring earth magnetic field? i dont quite understand the question and familiar with the device. but i bought accelerometer from sureelectronics as well which will register earth g at one axis oriented downward.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf