cancel
Showing results for 
Search instead for 
Did you mean: 

H3LIS331DLTR produces abnormal readings

NTamb.2
Associate

Hi!

We have been evaluating a few accelerometers from ST.

So far we have seen reasonable results from H3LIS100 and H3LIS200 devices.

However, H3LIS331DLTR is behaving contrary to our expectations.

We have the H3LIS331DLTR device on a PCB, interfaced via SPI with a microcontroller.

The H3LIS331DLTR device is mounted on the PCB such that the Z-axis of the H3LIS331DLTR device is perpendicular to the ground. The X and Y axes are in the plane of the PCB.

We have configured the H3LIS331 device with the following settings:

  • High-pass filter disabled (this is intentional)
  • Output data rate: 400Hz
  • Reference mode: normal
  • Block Data Update bit is set, so that both high and low byte of measurement can be read
  • Full-Scale bits are set to 00 (hence +/-100G full scale measurements)
  • Acquisition mode: polling by checking XYZ data ready flag in status register

However, we are reading +30G on the Z-axis measurement.

When we flip the PCB over, we are reading +15G on the Z-axis measurement.

The delta between the two measurements is much larger than 1G.

We are seeing these measurements on 2 PCBs, so it's not a one-off.

I've decided to post here, in the hope that someone will be able to guide us and point out something we may be missing.

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

Hi @NTamb.2​ ,

are you correctly converting the LSB units into physical units?

Please note that the data output for the H3LIS100 and the H3LIS200 device is on 8 bits, so that the sensitivity is respectively 780mg/digit and 1560mg/digit, while the H3LIS331DLTR data is on 12 bits, so the sensitivity is reduced by a factor 12. If you don't consider this difference and uses the same libraries, you will have a 16x value on this last sensor. You can refer to the C drivers on Github for the implementation of the conversion of LSB into physical units --> h3lis331dl_reg.c.

float_t h3lis331dl_from_fs100_to_mg(int16_t lsb)
{
  return ((float_t)lsb * 3.0625f);
}

Can be this one the issue?

-Eleon

View solution in original post

2 REPLIES 2
Eleon BORLINI
ST Employee

Hi @NTamb.2​ ,

are you correctly converting the LSB units into physical units?

Please note that the data output for the H3LIS100 and the H3LIS200 device is on 8 bits, so that the sensitivity is respectively 780mg/digit and 1560mg/digit, while the H3LIS331DLTR data is on 12 bits, so the sensitivity is reduced by a factor 12. If you don't consider this difference and uses the same libraries, you will have a 16x value on this last sensor. You can refer to the C drivers on Github for the implementation of the conversion of LSB into physical units --> h3lis331dl_reg.c.

float_t h3lis331dl_from_fs100_to_mg(int16_t lsb)
{
  return ((float_t)lsb * 3.0625f);
}

Can be this one the issue?

-Eleon

NTamb.2
Associate

Hi,

Yes, I found out a couple of days ago that the conversion was incorrect.

I was using the correct scaling factor (49mg/bit).

However the data I was receiving was left justified by 4 bits. Once I shifted the data by 4 bits, all the measurements looked correct.

I noticed in the datasheet mentioned that the resolution was 12-bits; but hadn't realized that the data would be left-justified when it arrives via the SPI interface (might be helpful if this detail is added).

Thanks for your response!