H3LIS331DL Odd output data (Negative fixed width integer int16_t)

Hi All,

I’m new to Arduino,

But I’ve coded in the past on various platforms, just been a while so it’s slowly coming back to me.

Having an issue with the data output of the H3LIS331DL.

Correct me if I don’t understand correctly, but I’ve wired up the H3LIS331DL IMU and have it working with my Arduino RP2040, however, I’m getting odd output values for each axis, specifically negative int16_t values and it’s VERY jumpy.

The average rest values are int16_t (-5X, -5Y, 30Z) and again for the ConvertedToG values (-.3X, -.3Y, 1.5Z)).

At rest, the values fluctuate a lot for the base int16_t values (-/+10 range) and again for the ConvertedToG values (-/+0.25g range).

Am I missing something here? any help would be appreciated, thanks.

(I also may have supplied 3.3v to one of the MOSI/MISO pins :shock: )

Using mostly the example code

Settings;

baud rates match tried a few.

xl.setPowerMode(LIS331::NORMAL);

xl.setODR(LIS331::DR_50HZ);

xl.setFullScale(LIS331::LOW_RANGE);

xl.convertToG(100,x)

xl.convertToG(100,y)

xl.convertToG(100,z)

For the H3LIS331DL high g accelerometer, that is normal noise. According to the data sheet, typical offset values are +/- 1 g.

What does this mean?

(-/+0.25g range)

Are you sure you have the correct device? The low g range of the H3LIS331DL is +/- 100 g.

On the output from the convertToG, the values fluctuate +/-0.25g

Must have read the data sheet incorrectly, I wasn’t expecting negative int16_t values which though me off.

I hope so, I’m doing some impact force testing on some equipment and I’m expecting to see forces up to maybe 30-50g.

Thanks for clarifying

Acceleration is a vector, and the individual axial values have a direction as well as a magnitude! Negative values make perfect sense.