Meaning of "LSB/Unit" and "Unit/LSB"

LSB/unit or Unit/LSB is the factor(called sensitivity) with which you have to multiply the raw sensor data. Say Sensor A has X,Y and Z registers , the values coming in each of the registers needs to be Divided/multiplied with the LSB/unit or Unit/LSB factor. This is because the data sheet says @ the particular fullscale you will have this much sensitivity(LSB/unit or Unit/LSB)

for LSB/Unit :

x lsb means - 1 unit

1 lsb means - 1/x unit

value lsb(value in the register) = (1/x)*(value in the register) - Apply unitary method here.

similarly for Unit/LSB you have to multiply the sensitivity.

You can build Accelerometer,Magnetometer or Temperature sensor or may be Gyro-meter in one module, but what if a customer/User wants only one sensor?

Rgds, Rp


Now I got the trick. There are several things on this MEMS you have to know, but which are not mentioned in the datasheet:

  1. The accelerometer's output register is just 12 bits and not 16 bits, so you need to right-shift the value by 4 and multiply it with 0,001 G. Furthermore it's little-endian.
  2. The magnetometer's output register is 16 bits, but big-endian. Furthermore the vector order is (X|Z|Y) not (X|Y|Z). To calculate the correct value you need to devide X and Y by 980 gauss⁻¹, while it's 1100 gauss⁻¹ for Z.
  3. The temperature sensor works, but it's not calibrated. So you can use it to measure temperature change, but no absolute temperatures. It's also just 12 bits, but big-endian and you have to devide the output by 8 C⁻¹.

With that Information it's possible to use the LSM303DLHC. But who the hell invented this? "Let's build a new accelerometer, magnetometer and thermometer in one package and screw the user up by mixing word length and endianness up without mentioning it in the datasheet."


The datasheet is definitively unclear regarding the interpretation of the Acceleration registers. Genesis Rock solution assume it is 12-bits, which works. (Another solution is to assume gain is 16 mg/LSB instead of 1 mg/LSB, but as the last 4 bits of the accelerations seem to always be zeros the former solution makes more sense).

But both for the temperature and acceleration, if you take into account only the 12 most significant bits. The last two bits are still also always zero, so the effective resolution would be 10-bits which is confusing.

I also can't make sense of the temperature reading unless there is an unknown offset not specified in the datasheet.

I hope others can confirm they are getting the same results.