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.
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: