Limit of accelerometer reading?

Posted on
  • I was looking at the datasheet for the accelerometer in the bangleJS2 and was wondering about the magnitude range that is available.

    https://www.espruino.com/datasheets/KX02­3-1025.pdf

    I see there is a +/- 2, 4, and 8g sensitivity setting that is 'user selectable':

    "Resolution and acceleration ranges are user selectable via I2C or SPI." (I don't know much about these protocols)

    But I am wondering how / if we can interact with that through the API and also what the 'default' setting is.

    At the moment, through experimentation, I haven't been able to produce a reading above 5.65 g's (total magnitude). I could see that reading coming from a combination of axes though, which leads me to think the accelerometer is in 4g mode, however it is possible that my timid nature / feeble physique are imposing the limit here, not the sensor (lol)

    EDIT: I may be finding what I need over in
    https://github.com/espruino/BangleApps/b­lob/master/apps/accelrec/app.js

    Using deduction, it seems like you CAN change those things with accelWR, the default is 4gs, and you just need to find the right numbers in the datasheet that correspond with the setting you want to change. I actually think I have what I need - just have to review the data sheet in more detail.

    EDIT: again. I think I have everything I need. Thank you Espruino forums for being a rubber duck for me :)

    So here's the D/L for anyone else that comes by.

    The default is definitely 4g's. You configure the accelerometer by writing to these eight bit binary numbers called "registers". The two important registers in the manual I referenced are called "ODCNTL" and "CNTL1". References for these are on pages 40 and 44 of the manual.

    Once you change the sensitivity of the sensor, your magnitude numbers from bangle will either be 0.5 at rest of 2.0 at rest (instead of 1.0), so correct for that accordingly.

    My goal was to measure peak throw acceleration, but I think humans can pull of 10's of g's when throwing objects so I might be out of luck with even the 8g setting.

  • The default is definitely 4g's

    Yes, in the unlikely case you already didn't find out this too, the source is here
    https://github.com/espruino/Espruino/blo­b/master/libs/banglejs/jswrap_bangle.c#L­3812

  • I'm trying this also. Also the update ratio plays big role in what readings you get.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Limit of accelerometer reading?

Posted by Avatar for Philip @Philip

Actions