Make sense of accelerometer data H3LIS100DL

Thread Starter

crnewton

Joined Sep 16, 2022
3
I am using the H3LIS100DL accelerometer (datasheet), but can't make sense of the output values:

I'm using the default poll_data example, and get readings, but on a static sensor I expect static values, but they aren't.
To make sense of the data we have the following info from the datasheet:
- Values in the OUT_ registers are expressed as two’s complement
- Sensor is 8bit, +-100G, sensitivity of 780 mg/digit

When placing the accelerometer flat on my desk (static, no movement) I get the following output:

Code:

Acceleration [mg]:0.00 0.00 3120.00
Acceleration [mg]:0.00 0.00 2340.00
Acceleration [mg]:-780.00 0.00 3120.00
Acceleration [mg]:0.00 0.00 3120.00
Acceleration [mg]:0.00 0.00 3120.00
Acceleration [mg]:0.00 0.00 2340.00
Acceleration [mg]:0.00 0.00 3120.00
Acceleration [mg]:0.00 0.00 2340.00
Acceleration [mg]:0.00 0.00 3120.00
Acceleration [mg]:0.00 0.00 2340.00
Acceleration [mg]:0.00 0.00 2340.00
Acceleration [mg]:0.00 0.00 3120.00

(out of 1024 samples I get only variants of the specific values).

When placing the sensor upside down I get the following output:

Code:

Acceleration [mg]:0.00 0.00 780.00
Acceleration [mg]:0.00 0.00 780.00
Acceleration [mg]:0.00 0.00 780.00
Acceleration [mg]:0.00 0.00 780.00
Acceleration [mg]:0.00 0.00 780.00
Acceleration [mg]:0.00 0.00 780.00
Acceleration [mg]:0.00 0.00 780.00
Acceleration [mg]:0.00 0.00 780.00

(this continues for all samples)

This acceleration [mg] is calculated as followed (taking z value 3120 as example):
OUT_Z reg_value = 00000100 (dec 4)
adjusted for sensitivity = 4 * 780 = 3120

I'm using the default library example, and can follow the conversions, but all my output data is a multiply of 4 (because of multiplication with sensitivity?)
But I can't figure out what I'm doing wrong, the output should be in mg (default example that comes with library).
So my questions are:

1. Why is the data from the static sensor varying? (but upside down it's not)
2. I'm expecting a value of 1g or 9.8 m/s (0.001, 0.0098 in mg) on the z-axis (+-1.5g TyOff), why am I getting the values 780, 3120, 2340? (multiples of 4)

I hope someone can give me some insights.
 
Last edited by a moderator:

Thread Starter

crnewton

Joined Sep 16, 2022
3
I can't seem to edit my post, but all my output data is a multiply of 4, which points to my mistake.
But I can't figure out where my mistake is using the datasheet.
 

austin944

Joined Mar 25, 2023
6
You generally won't get a static value from the sensor, unless you enable the high-pass filter. Looks like you can enable the high-pass filter here in the example code (currently commented out):
//h3lis100dl_hp_path_set(&dev_ctx, H3LIS100DL_HP_ON_OUT);
And then comment out this part of the code:
h3lis100dl_hp_path_set(&dev_ctx, H3LIS100DL_HP_DISABLE);
 

Thread Starter

crnewton

Joined Sep 16, 2022
3
You generally won't get a static value from the sensor, unless you enable the high-pass filter. Looks like you can enable the high-pass filter here in the example code (currently commented out):
//h3lis100dl_hp_path_set(&dev_ctx, H3LIS100DL_HP_ON_OUT);
And then comment out this part of the code:
h3lis100dl_hp_path_set(&dev_ctx, H3LIS100DL_HP_DISABLE);
Thank you. But isn't 3.120g way more noise then expected?

I did setup & enable the high-pass filter, and also filtered the 4 lsb out (4*780 = 3120).
So now I end up with no data if the sensor is static, but not sure if filtering out 3g of acceleration is a good idea.
 

austin944

Joined Mar 25, 2023
6
Thank you. But isn't 3.120g way more noise then expected?

I did setup & enable the high-pass filter, and also filtered the 4 lsb out (4*780 = 3120).
So now I end up with no data if the sensor is static, but not sure if filtering out 3g of acceleration is a good idea.
If you are wanting to measure G forces close to gravity, then you might look into a sensor
where the max range is closer to gravity. It will give you greater resolution and more accuracy,
but at the expense of less range. Like this:
https://www.adafruit.com/product/2809
It has a configurable max range between 2g and 16g.
Or you could combine different G sensors with different ranges.
What are the ranges of G forces that you will expect, and what accuracy do you require in each
range? Do you really expect a 100G acceleration (the max range of your sensor)?
 
Top