I have a BMI088 and am trying to get an accelerometer reading.
The data sheet and specs for Bosch Sensortec are here:
The sensitivity per range is this (its a 16 bit signed integer):
- ± 3 g: 10920 LSB/g
- ± 6 g: 5460 LSB/g
- ± 12 g: 2730 LSB/g
- ± 24 g: 1365 LSB/g
Yet, the formula they give to calculate the force in mg is this:
mg = accel_int16 / 32768 * 1000 * 2^((range register value) +1)
Where the range register has the following values:
- ± 3g = 0x0
- ± 6g = 0x1
- ± 12g = 0x2
- ± 24g = 0x3
If we do the math on that and plug in the highest value (+32768) and highest range register value (0x3), we get a force of 16000mg or 16g, so a range of -16g to +16, not -24g to +24g.
So what is the correct conversion?
If we do simply, accel_int16 LSB / 1365 LSB/g we get a maximum value of 24g for 32768 which is intuitively what one would expect. Going by the same logic of a linear response, we might also say, each value (LSB) represents a LSB/mg, which would be
32768*x = 24000mg
x = 0.7324
In this case we can take a reading, multiply by 0.7324 to get our mg.
What am I doing wrong or not understanding? Why does the data sheet formula not give me the correct range?
The second part to that question, is, I want to have a scale factor to convert from LSB to to meters/second/second, so intuitively one would think it would be:
scale = 0.7324 * 0.001 * ~9.8m/s/s
Again, if we follow the datasheet formula we get
scale = 0.4883 * 0.001 * ~9.8m/s/s
Am I misunderstanding something fundamental here? Or does a 24g accelerometer only measure in a 16g range for some reason?