2023-03-10 06:03 AM
resources:
I am using the H3LIS100DL accelerometer with the default h3lis100dl_read_data_polling.c example, and can read it's output, but the acceleration varies while the sensor is static:
When placing the H3LIS100DL static on a flat surface I get the following output:
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
When I rotate the sensor 180 degrees (upside-down) I get the following readings:
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
Why is my static sensor outputting various values on the z axis?
when my sensor isn't moving.
The output values are calculated as followed:
I'm expecting a static sensor will output constant acceleration values.
But this isn't the case. Can anyone explain why?
The wake_up example works correctly, the free_fall example does not:
Running the free_fall example results in continous printing of "free fall" (even when sensor is static laying on my desk.
Running the wake_up example results in only triggering a wake_up when I hit the sensor, the correct wake_up axis is triggered.