Memsic 2125 converting raw data to Acceleration(G)
Hi all,
I am having trouble trying to figure out out to convert the raw xy data from the Memsic 2125 to acceleration(g-force). I get 0.400.000 on each axis at level, 0.300.000 at 90 degrees in one direction per axis and 0.500.000 at 90 degrees per axis in the other direction. These values are from acc.Mx and acc.My. I tried using the formula from the demo for acc.ro, but that doesnt work the same. Any clues?
Thanks.
Jason
I am having trouble trying to figure out out to convert the raw xy data from the Memsic 2125 to acceleration(g-force). I get 0.400.000 on each axis at level, 0.300.000 at 90 degrees in one direction per axis and 0.500.000 at 90 degrees per axis in the other direction. These values are from acc.Mx and acc.My. I tried using the formula from the demo for acc.ro, but that doesnt work the same. Any clues?
Thanks.
Jason
Comments
Please post your code, or a URL link to the exact code that you are using.
All of the pins are properly connected to the Memsic 2125 correct?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Thanks
I think I can answer your question... or at least I can explain the numbers that you are seeing.
First it might help to know that the resolution of the RAW values if the Propeller is running at 80MHz is 12.5ns or (0.0000000125 seconds)
At Zero g, the pulse width generated from the Memsic 2125 is 5ms (page 2 of this PDF www.parallax.com/Portals/0/Downloads/docs/prod/acc/memsickit.pdf ) .... 5ms = 0.005 seconds
0.005 seconds divided by 0.0000000125 seconds = 400,000 <- Zero G returned RAW value
For every 'g' the pulse width varies by 1.25ms, so if you tilt the sensor on one axis the Memsic 2125 generates a pulse of 6.25ms ... tilting it in the other direction the Memsic 2125 generates a pulse of 3.75ms.
6.25ms = 0.00625 seconds ... divided by 0.0000000125 seconds = 500,000 <- Indicating +1g
3.75ms = 0.00375 seconds ... divided by 0.0000000125 seconds = 300,000 <- Indicating -1g
If you want to display the mg from the RAW values then apply the formula below...
mg = (RAW - 400000) / 100
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Thanks much!
Jason